array test_b137 array Blub_nextFree638 integer Blub_firstFree135 integer Blub_maxIndex588 array Blub_typeId970 array Blub_x131 integer wurst_stack_depth629 array wurst_stack183 integer Blub_firstFree135 = 0 integer Blub_maxIndex588 = 0 integer wurst_stack_depth629 = 0 function initGlobals186() { } function main668() { initGlobals186(); init_test120("when calling init_test in Classes_lifecycle.wurst, line 1"); } function config555() { } function init_test120(string __wurst_stackPos731) { local integer i193 wurst_stack_183[wurst_stack_depth_629] = __wurst_stackPos_731; wurst_stack_depth_629 = (wurst_stack_depth_629 + 1); test_b_137[0] = new_Blub146(0, "when calling new_Blub in Classes_lifecycle.wurst, line 19"); test_b_137[1] = new_Blub146(1, "when calling new_Blub in Classes_lifecycle.wurst, line 20"); test_b_137[2] = new_Blub146(2, "when calling new_Blub in Classes_lifecycle.wurst, line 21"); test_b_137[3] = new_Blub146(3, "when calling new_Blub in Classes_lifecycle.wurst, line 22"); test_b_137[4] = new_Blub146(4, "when calling new_Blub in Classes_lifecycle.wurst, line 23"); test_b_137[5] = new_Blub146(5, "when calling new_Blub in Classes_lifecycle.wurst, line 24"); test_b_137[6] = new_Blub146(6, "when calling new_Blub in Classes_lifecycle.wurst, line 25"); test_b_137[7] = new_Blub146(7, "when calling new_Blub in Classes_lifecycle.wurst, line 26"); dispatch_Blub_destroyBlub272(test_b_137[0], "when calling dispatch_Blub_destroyBlub in Classes_lifecycle.wurst, line 28"); dispatch_Blub_destroyBlub272(test_b_137[6], "when calling dispatch_Blub_destroyBlub in Classes_lifecycle.wurst, line 29"); dispatch_Blub_destroyBlub272(test_b_137[2], "when calling dispatch_Blub_destroyBlub in Classes_lifecycle.wurst, line 30"); dispatch_Blub_destroyBlub272(test_b_137[4], "when calling dispatch_Blub_destroyBlub in Classes_lifecycle.wurst, line 31"); test_b_137[8] = new_Blub146(8, "when calling new_Blub in Classes_lifecycle.wurst, line 35"); test_b_137[9] = new_Blub146(9, "when calling new_Blub in Classes_lifecycle.wurst, line 36"); i_193 = 0; loop { exitwhen (i_193 >= 10); if (((i_193 mod 2) == 1) and (Blub_x_131[test_b_137[i_193]] != i_193)) { testFail641(((("fail " + I2S331(i_193)) + ", ") + I2S331(Blub_x_131[test_b_137[i_193]]))); } else { }; i_193 = (i_193 + 1); }; testSuccess103(); wurst_stack_depth_629 = (wurst_stack_depth_629 - 1); } IS_NATIVE IS_EXTERN @extern function I2S331(integer i296) returns string { } IS_NATIVE function testFail641(string msg209) { } IS_NATIVE function testSuccess103() { } function new_Blub146(integer x190, string __wurst_stackPos137) returns integer { local integer this188 wurst_stack_183[wurst_stack_depth_629] = __wurst_stackPos_137; wurst_stack_depth_629 = (wurst_stack_depth_629 + 1); wurst_stack_183[wurst_stack_depth_629] = "when calling alloc_Blub in Classes_lifecycle.wurst, line 10"; wurst_stack_depth_629 = (wurst_stack_depth_629 + 1); if (Blub_firstFree_135 == 0) { if (Blub_maxIndex_588 < 32768) { Blub_maxIndex_588 = (Blub_maxIndex_588 + 1); this_188 = Blub_maxIndex_588; Blub_typeId_970[this_188] = 1; } else { error143("Out of memory: Could not create Blub.", "when calling error in Classes_lifecycle.wurst, line 8"); this_188 = 0; }; } else { Blub_firstFree_135 = (Blub_firstFree_135 - 1); this_188 = Blub_nextFree_638[Blub_firstFree_135]; Blub_typeId_970[this_188] = 1; }; wurst_stack_depth_629 = (wurst_stack_depth_629 - 1); Blub_x_131[this_188] = x_190; wurst_stack_depth_629 = (wurst_stack_depth_629 - 1); return this_188; } function error143(string msg199, string __wurst_stackPos136) { local integer stacktraceIndex588 local integer stacktraceLimit478 wurst_stack_183[wurst_stack_depth_629] = __wurst_stackPos_136; wurst_stack_depth_629 = (wurst_stack_depth_629 + 1); __wurst_stackPos_136 = ""; stacktraceIndex_588 = wurst_stack_depth_629; stacktraceLimit_478 = 0; loop { stacktraceIndex_588 = (stacktraceIndex_588 - 1); stacktraceLimit_478 = (stacktraceLimit_478 + 1); exitwhen ((stacktraceLimit_478 > 20) or (stacktraceIndex_588 < 0)); __wurst_stackPos_136 = (__wurst_stackPos_136 + (" " + wurst_stack_183[stacktraceIndex_588])); }; $debugPrint163((msg_199 + (" " + __wurst_stackPos_136))); wurst_stack_depth_629 = (wurst_stack_depth_629 - 1); } function dispatch_Blub_destroyBlub272(integer this147, string __wurst_stackPos989) { wurst_stack_183[wurst_stack_depth_629] = __wurst_stackPos_989; wurst_stack_depth_629 = (wurst_stack_depth_629 + 1); if (Blub_typeId_970[this_147] == 0) { if (this_147 == 0) { error143("Nullpointer exception when calling Blub.Blub", "when calling error in Classes_lifecycle.wurst, line 8"); } else { error143("Called Blub.Blub on invalid object.", "when calling error in Classes_lifecycle.wurst, line 8"); }; } else { }; wurst_stack_183[wurst_stack_depth_629] = "when calling destroyBlub in Classes_lifecycle.wurst, line 8"; wurst_stack_depth_629 = (wurst_stack_depth_629 + 1); wurst_stack_183[wurst_stack_depth_629] = "when calling dealloc_Blub in Classes_lifecycle.wurst, line 8"; wurst_stack_depth_629 = (wurst_stack_depth_629 + 1); if (Blub_typeId_970[this_147] == 0) { error143("Double free: object of type Blub", "when calling error in Classes_lifecycle.wurst, line 8"); } else { Blub_nextFree_638[Blub_firstFree_135] = this_147; Blub_firstFree_135 = (Blub_firstFree_135 + 1); Blub_typeId_970[this_147] = 0; }; wurst_stack_depth_629 = (((wurst_stack_depth_629 - 1) - 1) - 1); }