integer test_x138 array B_nextFree576 integer B_firstFree124 integer B_maxIndex440 array B_typeId103 integer test_x138 = 2 integer B_firstFree124 = 0 integer B_maxIndex440 = 0 function initGlobals582() { } function main996() { initGlobals582(); init_test167(); } function config684() { } function init_test167() { local integer a430 test_x_138 = 2; a_430 = new_A107(); if (B_typeId_103[a_430] == 0) { if (a_430 == 0) { error858("Nullpointer exception when calling A.A"); } else { error858("Called A.A on invalid object."); }; } else { }; destroyA164(a_430); if (test_x_138 == 6) { testSuccess170(); } else { }; } IS_NATIVE function testSuccess170() { } function destroyA164(integer this486) { test_x_138 = ((test_x_138 + 1) * 2); if (B_typeId_103[this_486] == 0) { error858("Double free: object of type A"); } else { B_nextFree_576[B_firstFree_124] = this_486; B_firstFree_124 = (B_firstFree_124 + 1); B_typeId_103[this_486] = 0; }; } function new_A107() returns integer { local integer this199 if (B_firstFree_124 == 0) { if (B_maxIndex_440 < 32768) { B_maxIndex_440 = (B_maxIndex_440 + 1); this_199 = B_maxIndex_440; B_typeId_103[this_199] = 2; } else { error858("Out of memory: Could not create A."); this_199 = 0; }; } else { B_firstFree_124 = (B_firstFree_124 - 1); this_199 = B_nextFree_576[B_firstFree_124]; B_typeId_103[this_199] = 2; }; return this_199; } function error858(string msg120) { $debugPrint197((msg_120 + (" " + #getStackTrace()))); }