integer test_x730 array B_nextFree469 integer B_firstFree152 integer B_maxIndex594 array B_typeId189 integer test_x730 = 2 integer B_firstFree152 = 0 integer B_maxIndex594 = 0 function initGlobals980() { } function main768() { initGlobals980(); init_test481(); } function config374() { } function init_test481() { local integer a187 test_x_730 = 2; a_187 = new_X834(); if (B_typeId_189[a_187] == 0) { if (a_187 == 0) { error352("Nullpointer exception when calling X.X"); } else { error352("Called X.X on invalid object."); }; } else { }; destroyX209(a_187); if (test_x_730 == 6) { testSuccess115(); } else { }; } IS_NATIVE function testSuccess115() { } function destroyX209(integer this120) { test_x_730 = ((test_x_730 + 1) * 2); if (B_typeId_189[this_120] == 0) { error352("Double free: object of type X"); } else { B_nextFree_469[B_firstFree_152] = this_120; B_firstFree_152 = (B_firstFree_152 + 1); B_typeId_189[this_120] = 0; }; } function new_X834() returns integer { local integer this209 if (B_firstFree_152 == 0) { if (B_maxIndex_594 < 32768) { B_maxIndex_594 = (B_maxIndex_594 + 1); this_209 = B_maxIndex_594; B_typeId_189[this_209] = 3; } else { error352("Out of memory: Could not create X."); this_209 = 0; }; } else { B_firstFree_152 = (B_firstFree_152 - 1); this_209 = B_nextFree_469[B_firstFree_152]; B_typeId_189[this_209] = 3; }; return this_209; } function error352(string msg192) { $debugPrint294((msg_192 + (" " + #getStackTrace()))); }