integer test_x100 array B_nextFree815 integer B_firstFree100 integer B_maxIndex705 array B_typeId335 integer test_x100 = 2 integer B_firstFree100 = 0 integer B_maxIndex705 = 0 function initGlobals604() { } function main377() { initGlobals604(); init_test167(); } function config835() { } function init_test167() { local integer a431 local integer this113 test_x_100 = 2; a_431 = new_X263(); this_113 = a_431; if (B_typeId_335[this_113] == 0) { if (this_113 == 0) { error208("Nullpointer exception when calling A.A"); } else { error208("Called A.A on invalid object."); }; } else { }; destroyA127(this_113); if (test_x_100 == 6) { testSuccess127(); } else { }; } IS_NATIVE function testSuccess127() { } function destroyA127(integer this913) { local integer obj997 test_x_100 = (test_x_100 + 1); test_x_100 = (test_x_100 * 2); obj_997 = this_913; if (B_typeId_335[obj_997] == 0) { error208("Double free: object of type A"); } else { B_nextFree_815[B_firstFree_100] = obj_997; B_firstFree_100 = (B_firstFree_100 + 1); B_typeId_335[obj_997] = 0; }; } function new_X263() returns integer { local integer this172 local integer this119 local integer this151 if (B_firstFree_100 == 0) { if (B_maxIndex_705 < 32768) { B_maxIndex_705 = (B_maxIndex_705 + 1); this_119 = B_maxIndex_705; B_typeId_335[this_119] = 3; } else { error208("Out of memory: Could not create X."); this_119 = 0; }; } else { B_firstFree_100 = (B_firstFree_100 - 1); this_119 = B_nextFree_815[B_firstFree_100]; B_typeId_335[this_119] = 3; }; this_172 = this_119; this_151 = this_172; return this_172; } function error208(string msg744) { $debugPrint211((msg_744 + (" " + #getStackTrace()))); }