array A_nextFree211 integer A_firstFree121 integer A_maxIndex204 array A_typeId112 integer wurst_stack_depth111 array wurst_stack895 integer A_firstFree121 = 0 integer A_maxIndex204 = 0 integer wurst_stack_depth111 = 0 function initGlobals870() { } function main172() { initGlobals870(); init_Test997("when calling init_Test in instanceMaxCount, line 1"); } function config115() { } function init_Test997(string __wurst_stackPos131) { local integer a122 local integer e171 local integer count1187 wurst_stack_895[wurst_stack_depth_111] = __wurst_stackPos_131; wurst_stack_depth_111 = (wurst_stack_depth_111 + 1); a_122 = new_A453("when calling new_A in instanceMaxCount, line 6"); new_A453("when calling new_A in instanceMaxCount, line 7"); new_A453("when calling new_A in instanceMaxCount, line 8"); new_A453("when calling new_A in instanceMaxCount, line 9"); e_171 = new_A453("when calling new_A in instanceMaxCount, line 10"); count1_187 = maxInstanceCount189(1); dispatch_A_destroyA175(a_122, "when calling dispatch_A_destroyA in instanceMaxCount, line 12"); dispatch_A_destroyA175(e_171, "when calling dispatch_A_destroyA in instanceMaxCount, line 13"); e_171 = maxInstanceCount189(1); if ((count1_187 == 5) and (e_171 == 5)) { testSuccess906(); } else { }; wurst_stack_depth_111 = (wurst_stack_depth_111 - 1); } IS_NATIVE function testSuccess906() { } function new_A453(string __wurst_stackPos918) returns integer { local integer this214 wurst_stack_895[wurst_stack_depth_111] = __wurst_stackPos_918; wurst_stack_depth_111 = (wurst_stack_depth_111 + 1); wurst_stack_895[wurst_stack_depth_111] = "when calling alloc_A in instanceMaxCount, line 4"; wurst_stack_depth_111 = (wurst_stack_depth_111 + 1); if (A_firstFree_121 == 0) { if (A_maxIndex_204 < 32768) { A_maxIndex_204 = (A_maxIndex_204 + 1); this_214 = A_maxIndex_204; A_typeId_112[this_214] = 1; } else { error199("Out of memory: Could not create A.", "when calling error in instanceMaxCount, line 4"); this_214 = 0; }; } else { A_firstFree_121 = (A_firstFree_121 - 1); this_214 = A_nextFree_211[A_firstFree_121]; A_typeId_112[this_214] = 1; }; wurst_stack_depth_111 = ((wurst_stack_depth_111 - 1) - 1); return this_214; } function maxInstanceCount189(integer typeId249) returns integer { return A_maxIndex_204; } function error199(string msg745, string __wurst_stackPos172) { local integer stacktraceIndex850 local integer stacktraceLimit582 wurst_stack_895[wurst_stack_depth_111] = __wurst_stackPos_172; wurst_stack_depth_111 = (wurst_stack_depth_111 + 1); __wurst_stackPos_172 = ""; stacktraceIndex_850 = wurst_stack_depth_111; stacktraceLimit_582 = 0; loop { stacktraceIndex_850 = (stacktraceIndex_850 - 1); stacktraceLimit_582 = (stacktraceLimit_582 + 1); exitwhen ((stacktraceLimit_582 > 20) or (stacktraceIndex_850 < 0)); __wurst_stackPos_172 = (__wurst_stackPos_172 + (" " + wurst_stack_895[stacktraceIndex_850])); }; $debugPrint170((msg_745 + (" " + __wurst_stackPos_172))); wurst_stack_depth_111 = (wurst_stack_depth_111 - 1); } function dispatch_A_destroyA175(integer this121, string __wurst_stackPos181) { wurst_stack_895[wurst_stack_depth_111] = __wurst_stackPos_181; wurst_stack_depth_111 = (wurst_stack_depth_111 + 1); if (A_typeId_112[this_121] == 0) { if (this_121 == 0) { error199("Nullpointer exception when calling A.A", "when calling error in instanceMaxCount, line 4"); } else { error199("Called A.A on invalid object.", "when calling error in instanceMaxCount, line 4"); }; } else { }; wurst_stack_895[wurst_stack_depth_111] = "when calling destroyA in instanceMaxCount, line 4"; wurst_stack_depth_111 = (wurst_stack_depth_111 + 1); wurst_stack_895[wurst_stack_depth_111] = "when calling dealloc_A in instanceMaxCount, line 4"; wurst_stack_depth_111 = (wurst_stack_depth_111 + 1); if (A_typeId_112[this_121] == 0) { error199("Double free: object of type A", "when calling error in instanceMaxCount, line 4"); } else { A_nextFree_211[A_firstFree_121] = this_121; A_firstFree_121 = (A_firstFree_121 + 1); A_typeId_112[this_121] = 0; }; wurst_stack_depth_111 = (((wurst_stack_depth_111 - 1) - 1) - 1); }