integer test_x237 array B_nextFree115 integer B_firstFree166 integer B_maxIndex142 array B_typeId198 integer test_x237 = 2 integer B_firstFree166 = 0 integer B_maxIndex142 = 0 function initGlobals749() { } function main278() { initGlobals749(); init_test124(); } function config128() { } function init_test124() { local integer a108 test_x_237 = 2; a_108 = new_X144(); if (B_typeId_198[a_108] == 0) { if (a_108 == 0) { error610("Nullpointer exception when calling X.X"); } else { error610("Called X.X on invalid object."); }; } else { }; destroyX688(a_108); if (test_x_237 == 6) { testSuccess161(); } else { }; } IS_NATIVE function testSuccess161() { } function destroyX688(integer this196) { test_x_237 = ((test_x_237 + 1) * 2); if (B_typeId_198[this_196] == 0) { error610("Double free: object of type X"); } else { B_nextFree_115[B_firstFree_166] = this_196; B_firstFree_166 = (B_firstFree_166 + 1); B_typeId_198[this_196] = 0; }; } function new_X144() returns integer { local integer this132 if (B_firstFree_166 == 0) { if (B_maxIndex_142 < 32768) { B_maxIndex_142 = (B_maxIndex_142 + 1); this_132 = B_maxIndex_142; B_typeId_198[this_132] = 3; } else { error610("Out of memory: Could not create X."); this_132 = 0; }; } else { B_firstFree_166 = (B_firstFree_166 - 1); this_132 = B_nextFree_115[B_firstFree_166]; B_typeId_198[this_132] = 3; }; return this_132; } function error610(string msg213) { $debugPrint432((msg_213 + (" " + #getStackTrace()))); }