integer test_x493 array B_nextFree554 integer B_firstFree167 integer B_maxIndex164 array B_typeId803 integer test_x493 = 2 integer B_firstFree167 = 0 integer B_maxIndex164 = 0 function initGlobals194() { } function main700() { initGlobals194(); init_test829(); } function config148() { } function init_test829() { local integer a565 local integer this188 test_x_493 = 2; a_565 = new_A178(); this_188 = a_565; if (B_typeId_803[this_188] == 0) { if (this_188 == 0) { error147("Nullpointer exception when calling A.A"); } else { error147("Called A.A on invalid object."); }; } else { }; destroyA210(this_188); if (test_x_493 == 6) { testSuccess164(); } else { }; } IS_NATIVE function testSuccess164() { } function destroyA210(integer this699) { local integer obj149 test_x_493 = (test_x_493 + 1); test_x_493 = (test_x_493 * 2); obj_149 = this_699; if (B_typeId_803[obj_149] == 0) { error147("Double free: object of type A"); } else { B_nextFree_554[B_firstFree_167] = obj_149; B_firstFree_167 = (B_firstFree_167 + 1); B_typeId_803[obj_149] = 0; }; } function new_A178() returns integer { local integer this344 local integer this157 if (B_firstFree_167 == 0) { if (B_maxIndex_164 < 32768) { B_maxIndex_164 = (B_maxIndex_164 + 1); this_157 = B_maxIndex_164; B_typeId_803[this_157] = 2; } else { error147("Out of memory: Could not create A."); this_157 = 0; }; } else { B_firstFree_167 = (B_firstFree_167 - 1); this_157 = B_nextFree_554[B_firstFree_167]; B_typeId_803[this_157] = 2; }; this_344 = this_157; return this_344; } function error147(string msg188) { $debugPrint184((msg_188 + (" " + #getStackTrace()))); }