integer test_x248 array B_nextFree101 integer B_firstFree824 integer B_maxIndex472 array B_typeId158 integer test_x248 = 2 integer B_firstFree824 = 0 integer B_maxIndex472 = 0 function initGlobals503() { } function main167() { initGlobals503(); init_test135(); } function config278() { } function init_test135() { local integer a183 local integer this159 test_x_248 = 2; a_183 = new_A289(); this_159 = a_183; if (B_typeId_158[this_159] == 0) { if (this_159 == 0) { error522("Nullpointer exception when calling A.A"); } else { error522("Called A.A on invalid object."); }; } else { }; destroyA160(this_159); if (test_x_248 == 6) { testSuccess284(); } else { }; } IS_NATIVE function testSuccess284() { } function destroyA160(integer this189) { local integer obj745 test_x_248 = (test_x_248 + 1); test_x_248 = (test_x_248 * 2); obj_745 = this_189; if (B_typeId_158[obj_745] == 0) { error522("Double free: object of type A"); } else { B_nextFree_101[B_firstFree_824] = obj_745; B_firstFree_824 = (B_firstFree_824 + 1); B_typeId_158[obj_745] = 0; }; } function new_A289() returns integer { local integer this213 local integer this214 if (B_firstFree_824 == 0) { if (B_maxIndex_472 < 32768) { B_maxIndex_472 = (B_maxIndex_472 + 1); this_214 = B_maxIndex_472; B_typeId_158[this_214] = 2; } else { error522("Out of memory: Could not create A."); this_214 = 0; }; } else { B_firstFree_824 = (B_firstFree_824 - 1); this_214 = B_nextFree_101[B_firstFree_824]; B_typeId_158[this_214] = 2; }; this_213 = this_214; return this_213; } function error522(string msg117) { $debugPrint700((msg_117 + (" " + #getStackTrace()))); }