array A_nextFree713 integer A_firstFree186 integer A_maxIndex150 array A_typeId155 integer wurst_stack_depth273 array wurst_stack193 integer A_firstFree186 = 0 integer A_maxIndex150 = 0 integer wurst_stack_depth273 = 0 function initGlobals112() { } function main162() { initGlobals112(); init_Test195("when calling init_Test in instanceMaxCount, line 1"); } function config141() { } function init_Test195(string __wurst_stackPos186) { local integer a102 local integer e631 local integer count1687 wurst_stack_193[wurst_stack_depth_273] = __wurst_stackPos_186; wurst_stack_depth_273 = (wurst_stack_depth_273 + 1); a_102 = new_A190("when calling new_A in instanceMaxCount, line 6"); new_A190("when calling new_A in instanceMaxCount, line 7"); new_A190("when calling new_A in instanceMaxCount, line 8"); new_A190("when calling new_A in instanceMaxCount, line 9"); e_631 = new_A190("when calling new_A in instanceMaxCount, line 10"); count1_687 = maxInstanceCount399(1); dispatch_A_destroyA851(a_102, "when calling dispatch_A_destroyA in instanceMaxCount, line 12"); dispatch_A_destroyA851(e_631, "when calling dispatch_A_destroyA in instanceMaxCount, line 13"); e_631 = maxInstanceCount399(1); if ((count1_687 == 5) and (e_631 == 5)) { testSuccess749(); } else { }; wurst_stack_depth_273 = (wurst_stack_depth_273 - 1); } IS_NATIVE function testSuccess749() { } function new_A190(string __wurst_stackPos144) returns integer { local integer this456 wurst_stack_193[wurst_stack_depth_273] = __wurst_stackPos_144; wurst_stack_depth_273 = (wurst_stack_depth_273 + 1); wurst_stack_193[wurst_stack_depth_273] = "when calling alloc_A in instanceMaxCount, line 4"; wurst_stack_depth_273 = (wurst_stack_depth_273 + 1); if (A_firstFree_186 == 0) { if (A_maxIndex_150 < 32768) { A_maxIndex_150 = (A_maxIndex_150 + 1); this_456 = A_maxIndex_150; A_typeId_155[this_456] = 1; } else { error559("Out of memory: Could not create A.", "when calling error in instanceMaxCount, line 4"); this_456 = 0; }; } else { A_firstFree_186 = (A_firstFree_186 - 1); this_456 = A_nextFree_713[A_firstFree_186]; A_typeId_155[this_456] = 1; }; wurst_stack_depth_273 = ((wurst_stack_depth_273 - 1) - 1); return this_456; } function maxInstanceCount399(integer typeId214) returns integer { return A_maxIndex_150; } function error559(string msg162, string __wurst_stackPos827) { local integer stacktraceIndex449 local integer stacktraceLimit165 wurst_stack_193[wurst_stack_depth_273] = __wurst_stackPos_827; wurst_stack_depth_273 = (wurst_stack_depth_273 + 1); __wurst_stackPos_827 = ""; stacktraceIndex_449 = wurst_stack_depth_273; stacktraceLimit_165 = 0; loop { stacktraceIndex_449 = (stacktraceIndex_449 - 1); stacktraceLimit_165 = (stacktraceLimit_165 + 1); exitwhen ((stacktraceLimit_165 > 20) or (stacktraceIndex_449 < 0)); __wurst_stackPos_827 = (__wurst_stackPos_827 + (" " + wurst_stack_193[stacktraceIndex_449])); }; $debugPrint162((msg_162 + (" " + __wurst_stackPos_827))); wurst_stack_depth_273 = (wurst_stack_depth_273 - 1); } function dispatch_A_destroyA851(integer this463, string __wurst_stackPos210) { wurst_stack_193[wurst_stack_depth_273] = __wurst_stackPos_210; wurst_stack_depth_273 = (wurst_stack_depth_273 + 1); if (A_typeId_155[this_463] == 0) { if (this_463 == 0) { error559("Nullpointer exception when calling A.A", "when calling error in instanceMaxCount, line 4"); } else { error559("Called A.A on invalid object.", "when calling error in instanceMaxCount, line 4"); }; } else { }; wurst_stack_193[wurst_stack_depth_273] = "when calling destroyA in instanceMaxCount, line 4"; wurst_stack_depth_273 = (wurst_stack_depth_273 + 1); wurst_stack_193[wurst_stack_depth_273] = "when calling dealloc_A in instanceMaxCount, line 4"; wurst_stack_depth_273 = (wurst_stack_depth_273 + 1); if (A_typeId_155[this_463] == 0) { error559("Double free: object of type A", "when calling error in instanceMaxCount, line 4"); } else { A_nextFree_713[A_firstFree_186] = this_463; A_firstFree_186 = (A_firstFree_186 + 1); A_typeId_155[this_463] = 0; }; wurst_stack_depth_273 = (((wurst_stack_depth_273 - 1) - 1) - 1); }