integer test_x538 array B_nextFree168 integer B_firstFree205 integer B_maxIndex789 array B_typeId816 integer test_x538 = 2 integer B_firstFree205 = 0 integer B_maxIndex789 = 0 function initGlobals192() { } function main195() { initGlobals192(); init_test631(); } function config143() { } function init_test631() { local integer a191 test_x_538 = 2; a_191 = new_X366(); if (B_typeId_816[a_191] == 0) { if (a_191 == 0) { error186("Nullpointer exception when calling A.A"); } else { error186("Called A.A on invalid object."); }; } else { }; destroyA237(a_191); if (test_x_538 == 6) { testSuccess731(); } else { }; } IS_NATIVE function testSuccess731() { } function destroyA237(integer this113) { test_x_538 = ((test_x_538 + 1) * 2); if (B_typeId_816[this_113] == 0) { error186("Double free: object of type A"); } else { B_nextFree_168[B_firstFree_205] = this_113; B_firstFree_205 = (B_firstFree_205 + 1); B_typeId_816[this_113] = 0; }; } function new_X366() returns integer { local integer this210 if (B_firstFree_205 == 0) { if (B_maxIndex_789 < 32768) { B_maxIndex_789 = (B_maxIndex_789 + 1); this_210 = B_maxIndex_789; B_typeId_816[this_210] = 3; } else { error186("Out of memory: Could not create X."); this_210 = 0; }; } else { B_firstFree_205 = (B_firstFree_205 - 1); this_210 = B_nextFree_168[B_firstFree_205]; B_typeId_816[this_210] = 3; }; return this_210; } function error186(string msg806) { $debugPrint378((msg_806 + (" " + #getStackTrace()))); }