string test_s149 array C_nextFree717 integer C_firstFree757 integer C_maxIndex162 array C_typeId578 integer wurst_stack_depth127 array wurst_stack899 string test_s149 = "" integer C_firstFree757 = 0 integer C_maxIndex162 = 0 integer wurst_stack_depth127 = 0 function initGlobals116() { } function main194() { initGlobals116(); init_test560("when calling init_test in initdestroy.wurst, line 1"); } function config472() { } function init_test560(string __wurst_stackPos194) { wurst_stack_899[wurst_stack_depth_127] = __wurst_stackPos_194; wurst_stack_depth_127 = (wurst_stack_depth_127 + 1); test_s_149 = ""; dispatch_C_destroyC913(new_C819("when calling new_C in initdestroy.wurst, line 52"), "when calling dispatch_C_destroyC in initdestroy.wurst, line 54"); if (test_s_149 != "ABCcba") { testFail303(("fail, result = " + test_s_149)); } else { }; testSuccess103(); wurst_stack_depth_127 = (wurst_stack_depth_127 - 1); } IS_NATIVE function testFail303(string msg363) { } IS_NATIVE function testSuccess103() { } function new_C819(string __wurst_stackPos580) returns integer { local integer this101 wurst_stack_899[wurst_stack_depth_127] = __wurst_stackPos_580; wurst_stack_depth_127 = (wurst_stack_depth_127 + 1); wurst_stack_899[wurst_stack_depth_127] = "when calling alloc_C in initdestroy.wurst, line 38"; wurst_stack_depth_127 = (wurst_stack_depth_127 + 1); if (C_firstFree_757 == 0) { if (C_maxIndex_162 < 32768) { C_maxIndex_162 = (C_maxIndex_162 + 1); this_101 = C_maxIndex_162; C_typeId_578[this_101] = 1; } else { error324("Out of memory: Could not create C.", "when calling error in initdestroy.wurst, line 35"); this_101 = 0; }; } else { C_firstFree_757 = (C_firstFree_757 - 1); this_101 = C_nextFree_717[C_firstFree_757]; C_typeId_578[this_101] = 1; }; wurst_stack_depth_127 = (wurst_stack_depth_127 - 1); test_s_149 = (test_s_149 + "A"); test_s_149 = ((test_s_149 + "B") + "C"); wurst_stack_depth_127 = (wurst_stack_depth_127 - 1); return this_101; } function error324(string msg130, string __wurst_stackPos196) { local integer stacktraceIndex571 local integer stacktraceLimit104 wurst_stack_899[wurst_stack_depth_127] = __wurst_stackPos_196; wurst_stack_depth_127 = (wurst_stack_depth_127 + 1); __wurst_stackPos_196 = ""; stacktraceIndex_571 = wurst_stack_depth_127; stacktraceLimit_104 = 0; loop { stacktraceIndex_571 = (stacktraceIndex_571 - 1); stacktraceLimit_104 = (stacktraceLimit_104 + 1); exitwhen ((stacktraceLimit_104 > 20) or (stacktraceIndex_571 < 0)); __wurst_stackPos_196 = (__wurst_stackPos_196 + (" " + wurst_stack_899[stacktraceIndex_571])); }; $debugPrint819((msg_130 + (" " + __wurst_stackPos_196))); wurst_stack_depth_127 = (wurst_stack_depth_127 - 1); } function dispatch_C_destroyC913(integer this601, string __wurst_stackPos114) { wurst_stack_899[wurst_stack_depth_127] = __wurst_stackPos_114; wurst_stack_depth_127 = (wurst_stack_depth_127 + 1); if (C_typeId_578[this_601] == 0) { if (this_601 == 0) { error324("Nullpointer exception when calling C.C", "when calling error in initdestroy.wurst, line 35"); } else { error324("Called C.C on invalid object.", "when calling error in initdestroy.wurst, line 35"); }; } else { }; wurst_stack_899[wurst_stack_depth_127] = "when calling destroyC in initdestroy.wurst, line 35"; wurst_stack_depth_127 = (wurst_stack_depth_127 + 1); test_s_149 = (((test_s_149 + "c") + "b") + "a"); wurst_stack_899[wurst_stack_depth_127] = "when calling dealloc_C in initdestroy.wurst, line 42"; wurst_stack_depth_127 = (wurst_stack_depth_127 + 1); if (C_typeId_578[this_601] == 0) { error324("Double free: object of type C", "when calling error in initdestroy.wurst, line 35"); } else { C_nextFree_717[C_firstFree_757] = this_601; C_firstFree_757 = (C_firstFree_757 + 1); C_typeId_578[this_601] = 0; }; wurst_stack_depth_127 = (((wurst_stack_depth_127 - 1) - 1) - 1); }