string test_s108 array C_nextFree170 integer C_firstFree916 integer C_maxIndex697 array C_typeId189 integer wurst_stack_depth135 array wurst_stack200 string test_s108 = "" integer C_firstFree916 = 0 integer C_maxIndex697 = 0 integer wurst_stack_depth135 = 0 function initGlobals178() { } function main134() { initGlobals178(); init_test450("when calling init_test in initdestroy.wurst, line 1"); } function config151() { } function init_test450(string __wurst_stackPos198) { wurst_stack_200[wurst_stack_depth_135] = __wurst_stackPos_198; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); test_s_108 = ""; dispatch_C_destroyC154(new_C325("when calling new_C in initdestroy.wurst, line 52"), "when calling dispatch_C_destroyC in initdestroy.wurst, line 54"); if (test_s_108 != "ABCcba") { testFail725(("fail, result = " + test_s_108)); } else { }; testSuccess566(); wurst_stack_depth_135 = (wurst_stack_depth_135 - 1); } IS_NATIVE function testFail725(string msg137) { } IS_NATIVE function testSuccess566() { } function new_C325(string __wurst_stackPos143) returns integer { local integer this896 wurst_stack_200[wurst_stack_depth_135] = __wurst_stackPos_143; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); wurst_stack_200[wurst_stack_depth_135] = "when calling alloc_C in initdestroy.wurst, line 38"; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); if (C_firstFree_916 == 0) { if (C_maxIndex_697 < 32768) { C_maxIndex_697 = (C_maxIndex_697 + 1); this_896 = C_maxIndex_697; C_typeId_189[this_896] = 1; } else { error186("Out of memory: Could not create C.", "when calling error in initdestroy.wurst, line 35"); this_896 = 0; }; } else { C_firstFree_916 = (C_firstFree_916 - 1); this_896 = C_nextFree_170[C_firstFree_916]; C_typeId_189[this_896] = 1; }; wurst_stack_depth_135 = (wurst_stack_depth_135 - 1); test_s_108 = (test_s_108 + "A"); test_s_108 = ((test_s_108 + "B") + "C"); wurst_stack_depth_135 = (wurst_stack_depth_135 - 1); return this_896; } function error186(string msg162, string __wurst_stackPos173) { local integer stacktraceIndex185 local integer stacktraceLimit233 wurst_stack_200[wurst_stack_depth_135] = __wurst_stackPos_173; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); __wurst_stackPos_173 = ""; stacktraceIndex_185 = wurst_stack_depth_135; stacktraceLimit_233 = 0; loop { stacktraceIndex_185 = (stacktraceIndex_185 - 1); stacktraceLimit_233 = (stacktraceLimit_233 + 1); exitwhen ((stacktraceLimit_233 > 20) or (stacktraceIndex_185 < 0)); __wurst_stackPos_173 = (__wurst_stackPos_173 + (" " + wurst_stack_200[stacktraceIndex_185])); }; $debugPrint514((msg_162 + (" " + __wurst_stackPos_173))); wurst_stack_depth_135 = (wurst_stack_depth_135 - 1); } function dispatch_C_destroyC154(integer this842, string __wurst_stackPos139) { wurst_stack_200[wurst_stack_depth_135] = __wurst_stackPos_139; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); if (C_typeId_189[this_842] == 0) { if (this_842 == 0) { error186("Nullpointer exception when calling C.C", "when calling error in initdestroy.wurst, line 35"); } else { error186("Called C.C on invalid object.", "when calling error in initdestroy.wurst, line 35"); }; } else { }; wurst_stack_200[wurst_stack_depth_135] = "when calling destroyC in initdestroy.wurst, line 35"; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); test_s_108 = (((test_s_108 + "c") + "b") + "a"); wurst_stack_200[wurst_stack_depth_135] = "when calling dealloc_C in initdestroy.wurst, line 42"; wurst_stack_depth_135 = (wurst_stack_depth_135 + 1); if (C_typeId_189[this_842] == 0) { error186("Double free: object of type C", "when calling error in initdestroy.wurst, line 35"); } else { C_nextFree_170[C_firstFree_916] = this_842; C_firstFree_916 = (C_firstFree_916 + 1); C_typeId_189[this_842] = 0; }; wurst_stack_depth_135 = (((wurst_stack_depth_135 - 1) - 1) - 1); }