string test_s160 array T_nextFree266 integer T_firstFree129 integer T_maxIndex139 array T_typeId144 string test_s160 = "" integer T_firstFree129 = 0 integer T_maxIndex139 = 0 function initGlobals476() { } function main159() { local integer t314 initGlobals476(); test_s_160 = ""; t_314 = new_A135(); dispatch_T_destroyT206(t_314); if (test_s_160 == "C") { testSuccess159(); } else { }; } function config136() { } IS_NATIVE function testSuccess159() { } function destroyA207(integer this837) { local integer obj184 test_s_160 = (test_s_160 + "C"); obj_184 = this_837; if (T_typeId_144[obj_184] == 0) { error206("Double free: object of type A"); } else { T_nextFree_266[T_firstFree_129] = obj_184; T_firstFree_129 = (T_firstFree_129 + 1); T_typeId_144[obj_184] = 0; }; } function new_A135() returns integer { local integer this137 local integer this121 if (T_firstFree_129 == 0) { if (T_maxIndex_139 < 32768) { T_maxIndex_139 = (T_maxIndex_139 + 1); this_121 = T_maxIndex_139; T_typeId_144[this_121] = 2; } else { error206("Out of memory: Could not create A."); this_121 = 0; }; } else { T_firstFree_129 = (T_firstFree_129 - 1); this_121 = T_nextFree_266[T_firstFree_129]; T_typeId_144[this_121] = 2; }; this_137 = this_121; return this_137; } function destroyB182(integer this105) { local integer obj135 test_s_160 = (test_s_160 + "B"); test_s_160 = (test_s_160 + "C"); obj_135 = this_105; if (T_typeId_144[obj_135] == 0) { error206("Double free: object of type B"); } else { T_nextFree_266[T_firstFree_129] = obj_135; T_firstFree_129 = (T_firstFree_129 + 1); T_typeId_144[obj_135] = 0; }; } function error206(string msg197) { $debugPrint424((msg_197 + (" " + #getStackTrace()))); } function dispatch_T_destroyT206(integer this103) { local integer this821 local integer obj521 if (T_typeId_144[this_103] == 0) { if (this_103 == 0) { error206("Nullpointer exception when calling T.T"); } else { error206("Called T.T on invalid object."); }; } else { }; if (T_typeId_144[this_103] <= 3) { if (T_typeId_144[this_103] <= 2) { destroyA207(this_103); } else { destroyB182(this_103); }; } else { this_821 = this_103; obj_521 = this_821; if (T_typeId_144[obj_521] == 0) { error206("Double free: object of type T"); } else { T_nextFree_266[T_firstFree_129] = obj_521; T_firstFree_129 = (T_firstFree_129 + 1); T_typeId_144[obj_521] = 0; }; }; }