array test_b123 array Blub_nextFree503 integer Blub_firstFree438 integer Blub_maxIndex826 array Blub_typeId985 array Blub_x916 integer wurst_stack_depth744 array wurst_stack119 integer Blub_firstFree438 = 0 integer Blub_maxIndex826 = 0 integer wurst_stack_depth744 = 0 function initGlobals163() { } function main143() { initGlobals163(); init_test154("when calling init_test in Classes_lifecycle.wurst, line 1"); } function config118() { } function init_test154(string __wurst_stackPos105) { local integer i180 wurst_stack_119[wurst_stack_depth_744] = __wurst_stackPos_105; wurst_stack_depth_744 = (wurst_stack_depth_744 + 1); test_b_123[0] = new_Blub751(0, "when calling new_Blub in Classes_lifecycle.wurst, line 19"); test_b_123[1] = new_Blub751(1, "when calling new_Blub in Classes_lifecycle.wurst, line 20"); test_b_123[2] = new_Blub751(2, "when calling new_Blub in Classes_lifecycle.wurst, line 21"); test_b_123[3] = new_Blub751(3, "when calling new_Blub in Classes_lifecycle.wurst, line 22"); test_b_123[4] = new_Blub751(4, "when calling new_Blub in Classes_lifecycle.wurst, line 23"); test_b_123[5] = new_Blub751(5, "when calling new_Blub in Classes_lifecycle.wurst, line 24"); test_b_123[6] = new_Blub751(6, "when calling new_Blub in Classes_lifecycle.wurst, line 25"); test_b_123[7] = new_Blub751(7, "when calling new_Blub in Classes_lifecycle.wurst, line 26"); dispatch_Blub_destroyBlub105(test_b_123[0], "when calling dispatch_Blub_destroyBlub in Classes_lifecycle.wurst, line 28"); dispatch_Blub_destroyBlub105(test_b_123[6], "when calling dispatch_Blub_destroyBlub in Classes_lifecycle.wurst, line 29"); dispatch_Blub_destroyBlub105(test_b_123[2], "when calling dispatch_Blub_destroyBlub in Classes_lifecycle.wurst, line 30"); dispatch_Blub_destroyBlub105(test_b_123[4], "when calling dispatch_Blub_destroyBlub in Classes_lifecycle.wurst, line 31"); test_b_123[8] = new_Blub751(8, "when calling new_Blub in Classes_lifecycle.wurst, line 35"); test_b_123[9] = new_Blub751(9, "when calling new_Blub in Classes_lifecycle.wurst, line 36"); i_180 = 0; loop { exitwhen (i_180 >= 10); if (((i_180 mod 2) == 1) and (Blub_x_916[test_b_123[i_180]] != i_180)) { testFail322(((("fail " + I2S145(i_180)) + ", ") + I2S145(Blub_x_916[test_b_123[i_180]]))); } else { }; i_180 = (i_180 + 1); }; testSuccess130(); wurst_stack_depth_744 = (wurst_stack_depth_744 - 1); } IS_NATIVE IS_EXTERN @extern function I2S145(integer i192) returns string { } IS_NATIVE function testFail322(string msg153) { } IS_NATIVE function testSuccess130() { } function new_Blub751(integer x148, string __wurst_stackPos193) returns integer { local integer this116 wurst_stack_119[wurst_stack_depth_744] = __wurst_stackPos_193; wurst_stack_depth_744 = (wurst_stack_depth_744 + 1); wurst_stack_119[wurst_stack_depth_744] = "when calling alloc_Blub in Classes_lifecycle.wurst, line 10"; wurst_stack_depth_744 = (wurst_stack_depth_744 + 1); if (Blub_firstFree_438 == 0) { if (Blub_maxIndex_826 < 32768) { Blub_maxIndex_826 = (Blub_maxIndex_826 + 1); this_116 = Blub_maxIndex_826; Blub_typeId_985[this_116] = 1; } else { error807("Out of memory: Could not create Blub.", "when calling error in Classes_lifecycle.wurst, line 8"); this_116 = 0; }; } else { Blub_firstFree_438 = (Blub_firstFree_438 - 1); this_116 = Blub_nextFree_503[Blub_firstFree_438]; Blub_typeId_985[this_116] = 1; }; wurst_stack_depth_744 = (wurst_stack_depth_744 - 1); Blub_x_916[this_116] = x_148; wurst_stack_depth_744 = (wurst_stack_depth_744 - 1); return this_116; } function error807(string msg608, string __wurst_stackPos472) { local integer stacktraceIndex421 local integer stacktraceLimit211 wurst_stack_119[wurst_stack_depth_744] = __wurst_stackPos_472; wurst_stack_depth_744 = (wurst_stack_depth_744 + 1); __wurst_stackPos_472 = ""; stacktraceIndex_421 = wurst_stack_depth_744; stacktraceLimit_211 = 0; loop { stacktraceIndex_421 = (stacktraceIndex_421 - 1); stacktraceLimit_211 = (stacktraceLimit_211 + 1); exitwhen ((stacktraceLimit_211 > 20) or (stacktraceIndex_421 < 0)); __wurst_stackPos_472 = (__wurst_stackPos_472 + (" " + wurst_stack_119[stacktraceIndex_421])); }; $debugPrint183((msg_608 + (" " + __wurst_stackPos_472))); wurst_stack_depth_744 = (wurst_stack_depth_744 - 1); } function dispatch_Blub_destroyBlub105(integer this334, string __wurst_stackPos199) { wurst_stack_119[wurst_stack_depth_744] = __wurst_stackPos_199; wurst_stack_depth_744 = (wurst_stack_depth_744 + 1); if (Blub_typeId_985[this_334] == 0) { if (this_334 == 0) { error807("Nullpointer exception when calling Blub.Blub", "when calling error in Classes_lifecycle.wurst, line 8"); } else { error807("Called Blub.Blub on invalid object.", "when calling error in Classes_lifecycle.wurst, line 8"); }; } else { }; wurst_stack_119[wurst_stack_depth_744] = "when calling destroyBlub in Classes_lifecycle.wurst, line 8"; wurst_stack_depth_744 = (wurst_stack_depth_744 + 1); wurst_stack_119[wurst_stack_depth_744] = "when calling dealloc_Blub in Classes_lifecycle.wurst, line 8"; wurst_stack_depth_744 = (wurst_stack_depth_744 + 1); if (Blub_typeId_985[this_334] == 0) { error807("Double free: object of type Blub", "when calling error in Classes_lifecycle.wurst, line 8"); } else { Blub_nextFree_503[Blub_firstFree_438] = this_334; Blub_firstFree_438 = (Blub_firstFree_438 + 1); Blub_typeId_985[this_334] = 0; }; wurst_stack_depth_744 = (((wurst_stack_depth_744 - 1) - 1) - 1); }