array test_b728 array Blub_nextFree582 integer Blub_firstFree133 integer Blub_maxIndex179 array Blub_typeId576 array Blub_x141 integer wurst_stack_depth135 array wurst_stack306 integer Blub_firstFree133 = 0 integer Blub_maxIndex179 = 0 integer wurst_stack_depth135 = 0 function initGlobals153() { } function main800() { initGlobals153(); init_test151("when calling init_test in Classes_lifecycle.wurst, line 1"); } function config207() { } function init_test151(string __wurst_stackPos134) { local integer i453 wurst_stack_306[wurst_stack_depth_135] = __wurst_stackPos_134; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); test_b_728[0] = new_Blub108(0, "when calling new_Blub in Classes_lifecycle.wurst, line 19"); test_b_728[1] = new_Blub108(1, "when calling new_Blub in Classes_lifecycle.wurst, line 20"); test_b_728[2] = new_Blub108(2, "when calling new_Blub in Classes_lifecycle.wurst, line 21"); test_b_728[3] = new_Blub108(3, "when calling new_Blub in Classes_lifecycle.wurst, line 22"); test_b_728[4] = new_Blub108(4, "when calling new_Blub in Classes_lifecycle.wurst, line 23"); test_b_728[5] = new_Blub108(5, "when calling new_Blub in Classes_lifecycle.wurst, line 24"); test_b_728[6] = new_Blub108(6, "when calling new_Blub in Classes_lifecycle.wurst, line 25"); test_b_728[7] = new_Blub108(7, "when calling new_Blub in Classes_lifecycle.wurst, line 26"); dispatch_Blub_destroyBlub253(test_b_728[0], "when calling dispatch_Blub_destroyBlub in Classes_lifecycle.wurst, line 28"); dispatch_Blub_destroyBlub253(test_b_728[6], "when calling dispatch_Blub_destroyBlub in Classes_lifecycle.wurst, line 29"); dispatch_Blub_destroyBlub253(test_b_728[2], "when calling dispatch_Blub_destroyBlub in Classes_lifecycle.wurst, line 30"); dispatch_Blub_destroyBlub253(test_b_728[4], "when calling dispatch_Blub_destroyBlub in Classes_lifecycle.wurst, line 31"); test_b_728[8] = new_Blub108(8, "when calling new_Blub in Classes_lifecycle.wurst, line 35"); test_b_728[9] = new_Blub108(9, "when calling new_Blub in Classes_lifecycle.wurst, line 36"); i_453 = 0; loop { exitwhen (i_453 >= 10); if (((i_453 mod 2) == 1) and (Blub_x_141[test_b_728[i_453]] != i_453)) { testFail557(((("fail " + I2S285(i_453)) + ", ") + I2S285(Blub_x_141[test_b_728[i_453]]))); } else { }; i_453 = (i_453 + 1); }; testSuccess229(); wurst_stack_depth_135 = (wurst_stack_depth_135 - 1); } IS_NATIVE IS_EXTERN @extern function I2S285(integer i866) returns string { } IS_NATIVE function testFail557(string msg405) { } IS_NATIVE function testSuccess229() { } function new_Blub108(integer x127, string __wurst_stackPos402) returns integer { local integer this169 wurst_stack_306[wurst_stack_depth_135] = __wurst_stackPos_402; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); wurst_stack_306[wurst_stack_depth_135] = "when calling alloc_Blub in Classes_lifecycle.wurst, line 10"; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); if (Blub_firstFree_133 == 0) { if (Blub_maxIndex_179 < 32768) { Blub_maxIndex_179 = (Blub_maxIndex_179 + 1); this_169 = Blub_maxIndex_179; Blub_typeId_576[this_169] = 1; } else { error113("Out of memory: Could not create Blub.", "when calling error in Classes_lifecycle.wurst, line 8"); this_169 = 0; }; } else { Blub_firstFree_133 = (Blub_firstFree_133 - 1); this_169 = Blub_nextFree_582[Blub_firstFree_133]; Blub_typeId_576[this_169] = 1; }; wurst_stack_depth_135 = (wurst_stack_depth_135 - 1); Blub_x_141[this_169] = x_127; wurst_stack_depth_135 = (wurst_stack_depth_135 - 1); return this_169; } function error113(string msg127, string __wurst_stackPos474) { local integer stacktraceIndex101 local integer stacktraceLimit162 wurst_stack_306[wurst_stack_depth_135] = __wurst_stackPos_474; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); __wurst_stackPos_474 = ""; stacktraceIndex_101 = wurst_stack_depth_135; stacktraceLimit_162 = 0; loop { stacktraceIndex_101 = (stacktraceIndex_101 - 1); stacktraceLimit_162 = (stacktraceLimit_162 + 1); exitwhen ((stacktraceLimit_162 > 20) or (stacktraceIndex_101 < 0)); __wurst_stackPos_474 = (__wurst_stackPos_474 + (" " + wurst_stack_306[stacktraceIndex_101])); }; $debugPrint424((msg_127 + (" " + __wurst_stackPos_474))); wurst_stack_depth_135 = (wurst_stack_depth_135 - 1); } function dispatch_Blub_destroyBlub253(integer this621, string __wurst_stackPos827) { wurst_stack_306[wurst_stack_depth_135] = __wurst_stackPos_827; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); if (Blub_typeId_576[this_621] == 0) { if (this_621 == 0) { error113("Nullpointer exception when calling Blub.Blub", "when calling error in Classes_lifecycle.wurst, line 8"); } else { error113("Called Blub.Blub on invalid object.", "when calling error in Classes_lifecycle.wurst, line 8"); }; } else { }; wurst_stack_306[wurst_stack_depth_135] = "when calling destroyBlub in Classes_lifecycle.wurst, line 8"; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); wurst_stack_306[wurst_stack_depth_135] = "when calling dealloc_Blub in Classes_lifecycle.wurst, line 8"; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); if (Blub_typeId_576[this_621] == 0) { error113("Double free: object of type Blub", "when calling error in Classes_lifecycle.wurst, line 8"); } else { Blub_nextFree_582[Blub_firstFree_133] = this_621; Blub_firstFree_133 = (Blub_firstFree_133 + 1); Blub_typeId_576[this_621] = 0; }; wurst_stack_depth_135 = (((wurst_stack_depth_135 - 1) - 1) - 1); }