integer test_x540 array B_nextFree233 integer B_firstFree163 integer B_maxIndex259 array B_typeId185 integer test_x540 = 2 integer B_firstFree163 = 0 integer B_maxIndex259 = 0 function initGlobals375() { } function main967() { initGlobals375(); init_test208(); } function config134() { } function init_test208() { local integer a907 test_x_540 = 2; a_907 = new_X172(); if (B_typeId_185[a_907] == 0) { if (a_907 == 0) { error714("Nullpointer exception when calling X.X"); } else { error714("Called X.X on invalid object."); }; } else { }; destroyX137(a_907); if (test_x_540 == 6) { testSuccess211(); } else { }; } IS_NATIVE function testSuccess211() { } function destroyX137(integer this159) { test_x_540 = ((test_x_540 + 1) * 2); if (B_typeId_185[this_159] == 0) { error714("Double free: object of type X"); } else { B_nextFree_233[B_firstFree_163] = this_159; B_firstFree_163 = (B_firstFree_163 + 1); B_typeId_185[this_159] = 0; }; } function new_X172() returns integer { local integer this117 if (B_firstFree_163 == 0) { if (B_maxIndex_259 < 32768) { B_maxIndex_259 = (B_maxIndex_259 + 1); this_117 = B_maxIndex_259; B_typeId_185[this_117] = 3; } else { error714("Out of memory: Could not create X."); this_117 = 0; }; } else { B_firstFree_163 = (B_firstFree_163 - 1); this_117 = B_nextFree_233[B_firstFree_163]; B_typeId_185[this_117] = 3; }; return this_117; } function error714(string msg165) { $debugPrint103((msg_165 + (" " + #getStackTrace()))); }