array C_nextFree130 integer C_firstFree195 integer C_maxIndex204 array C_typeId461 integer C_firstFree195 = 0 integer C_maxIndex204 = 0 function initGlobals114() { } function main553() { initGlobals114(); init_test325(); } function config110() { } function init_test325() { local integer a741 a_741 = new_C111(); dispatch_C_destroyC177(a_741); a_741 = new_C111(); dispatch_C_destroyC177(a_741); a_741 = new_C111(); if (a_741 != new_C111()) { testSuccess152(); } else { }; } IS_NATIVE function testSuccess152() { } function new_C111() returns integer { local integer this391 if (C_firstFree_195 == 0) { if (C_maxIndex_204 < 32768) { C_maxIndex_204 = (C_maxIndex_204 + 1); this_391 = C_maxIndex_204; C_typeId_461[this_391] = 1; } else { error161("Out of memory: Could not create C."); this_391 = 0; }; } else { C_firstFree_195 = (C_firstFree_195 - 1); this_391 = C_nextFree_130[C_firstFree_195]; C_typeId_461[this_391] = 1; }; return this_391; } function error161(string msg666) { $debugPrint134((msg_666 + (" " + #getStackTrace()))); } function dispatch_C_destroyC177(integer this214) { if (C_typeId_461[this_214] == 0) { if (this_214 == 0) { error161("Nullpointer exception when calling C.C"); } else { error161("Called C.C on invalid object."); }; } else { }; if (C_typeId_461[this_214] == 0) { error161("Double free: object of type C"); } else { C_nextFree_130[C_firstFree_195] = this_214; C_firstFree_195 = (C_firstFree_195 + 1); C_typeId_461[this_214] = 0; }; }