string test_s113 array T_nextFree110 integer T_firstFree108 integer T_maxIndex765 array T_typeId137 string test_s113 = "" integer T_firstFree108 = 0 integer T_maxIndex765 = 0 function initGlobals938() { } function main180() { local integer t189 initGlobals938(); test_s_113 = ""; t_189 = new_A478(); dispatch_T_destroyT131(t_189); if (test_s_113 == "C") { testSuccess186(); } else { }; } function config526() { } IS_NATIVE function testSuccess186() { } function destroyA942(integer this511) { local integer obj201 test_s_113 = (test_s_113 + "C"); obj_201 = this_511; if (T_typeId_137[obj_201] == 0) { error177("Double free: object of type A"); } else { T_nextFree_110[T_firstFree_108] = obj_201; T_firstFree_108 = (T_firstFree_108 + 1); T_typeId_137[obj_201] = 0; }; } function new_A478() returns integer { local integer this114 local integer this178 if (T_firstFree_108 == 0) { if (T_maxIndex_765 < 32768) { T_maxIndex_765 = (T_maxIndex_765 + 1); this_178 = T_maxIndex_765; T_typeId_137[this_178] = 2; } else { error177("Out of memory: Could not create A."); this_178 = 0; }; } else { T_firstFree_108 = (T_firstFree_108 - 1); this_178 = T_nextFree_110[T_firstFree_108]; T_typeId_137[this_178] = 2; }; this_114 = this_178; return this_114; } function destroyB187(integer this555) { local integer obj151 test_s_113 = (test_s_113 + "B"); test_s_113 = (test_s_113 + "C"); obj_151 = this_555; if (T_typeId_137[obj_151] == 0) { error177("Double free: object of type B"); } else { T_nextFree_110[T_firstFree_108] = obj_151; T_firstFree_108 = (T_firstFree_108 + 1); T_typeId_137[obj_151] = 0; }; } function error177(string msg372) { $debugPrint164((msg_372 + (" " + #getStackTrace()))); } function dispatch_T_destroyT131(integer this179) { local integer this413 local integer obj115 if (T_typeId_137[this_179] == 0) { if (this_179 == 0) { error177("Nullpointer exception when calling T.T"); } else { error177("Called T.T on invalid object."); }; } else { }; if (T_typeId_137[this_179] <= 3) { if (T_typeId_137[this_179] <= 2) { destroyA942(this_179); } else { destroyB187(this_179); }; } else { this_413 = this_179; obj_115 = this_413; if (T_typeId_137[obj_115] == 0) { error177("Double free: object of type T"); } else { T_nextFree_110[T_firstFree_108] = obj_115; T_firstFree_108 = (T_firstFree_108 + 1); T_typeId_137[obj_115] = 0; }; }; }