// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1365 globals integer Test_x=0 integer array VoidFunction_nextFree integer VoidFunction_firstFree=0 integer VoidFunction_maxIndex=0 integer array VoidFunction_typeId integer wurst_stack_depth=0 string array wurst_stack endglobals native testSuccess takes nothing returns nothing function error takes string msg, string w__wurst_stackPos returns nothing local integer stacktraceIndex local integer stacktraceLimit set wurst_stack[wurst_stack_depth] = w__wurst_stackPos set wurst_stack_depth = wurst_stack_depth + 1 set w__wurst_stackPos = "" set stacktraceIndex = wurst_stack_depth set stacktraceLimit = 0 loop set stacktraceIndex = stacktraceIndex - 1 set stacktraceLimit = stacktraceLimit + 1 exitwhen stacktraceLimit > 20 or stacktraceIndex < 0 set w__wurst_stackPos = w__wurst_stackPos + "\n " + wurst_stack[stacktraceIndex] endloop call BJDebugMsg(msg + "\n" + w__wurst_stackPos) set wurst_stack_depth = wurst_stack_depth - 1 endfunction function cyc_foo takes integer funcChoice, integer i, string w__wurst_stackPos, integer t, string w__wurst_stackPos_1 returns nothing if funcChoice == 0 then set wurst_stack[wurst_stack_depth] = w__wurst_stackPos set wurst_stack_depth = wurst_stack_depth + 1 set Test_x = Test_x + 1 set wurst_stack[wurst_stack_depth] = "when calling alloc_VoidFunction_Test in cycle_with_generics, line 8" set wurst_stack_depth = wurst_stack_depth + 1 if VoidFunction_firstFree == 0 then if VoidFunction_maxIndex < 32768 then set VoidFunction_maxIndex = VoidFunction_maxIndex + 1 set funcChoice = VoidFunction_maxIndex set VoidFunction_typeId[funcChoice] = 2 else call error("Out of memory: Could not create VoidFunction_Test.", "when calling error in cycle_with_generics, line 8") set funcChoice = 0 endif else set VoidFunction_firstFree = VoidFunction_firstFree - 1 set funcChoice = VoidFunction_nextFree[VoidFunction_firstFree] set VoidFunction_typeId[funcChoice] = 2 endif set wurst_stack_depth = wurst_stack_depth - 1 call cyc_foo(1, funcChoice, null, i, "when calling call in cycle_with_generics, line 9") set wurst_stack_depth = wurst_stack_depth - 1 elseif funcChoice == 1 then set wurst_stack[wurst_stack_depth] = w__wurst_stackPos_1 set wurst_stack_depth = wurst_stack_depth + 1 if VoidFunction_typeId[i] == 0 then if i == 0 then call error("Nullpointer exception when calling VoidFunction.call", "when calling error in cycle_with_generics, line 4") else call error("Called VoidFunction.call on invalid object.", "when calling error in cycle_with_generics, line 4") endif endif set wurst_stack[wurst_stack_depth] = "when calling call_Test in cycle_with_generics, line 4" set wurst_stack_depth = wurst_stack_depth + 1 if VoidFunction_typeId[i] <= 2 then set i = t - 1 set wurst_stack[wurst_stack_depth] = "when calling bar in cycle_with_generics, line 8" set wurst_stack_depth = wurst_stack_depth + 1 set Test_x = Test_x + 1 set wurst_stack[wurst_stack_depth] = "when calling alloc_VoidFunction_Test in cycle_with_generics, line 12" set wurst_stack_depth = wurst_stack_depth + 1 if VoidFunction_firstFree == 0 then if VoidFunction_maxIndex < 32768 then set VoidFunction_maxIndex = VoidFunction_maxIndex + 1 set funcChoice = VoidFunction_maxIndex set VoidFunction_typeId[funcChoice] = 3 else call error("Out of memory: Could not create VoidFunction_Test.", "when calling error in cycle_with_generics, line 12") set funcChoice = 0 endif else set VoidFunction_firstFree = VoidFunction_firstFree - 1 set funcChoice = VoidFunction_nextFree[VoidFunction_firstFree] set VoidFunction_typeId[funcChoice] = 3 endif set wurst_stack_depth = wurst_stack_depth - 1 if i > 0 then call cyc_foo(1, funcChoice, null, i, "when calling call in cycle_with_generics, line 14") endif set wurst_stack_depth = wurst_stack_depth - 1 - 1 else call cyc_foo(0, t - 1, "when calling foo in cycle_with_generics, line 12", 0, null) set wurst_stack_depth = wurst_stack_depth - 1 endif set wurst_stack_depth = wurst_stack_depth - 1 endif endfunction function bar takes integer i, string w__wurst_stackPos returns nothing local integer this set wurst_stack[wurst_stack_depth] = w__wurst_stackPos set wurst_stack_depth = wurst_stack_depth + 1 set Test_x = Test_x + 1 set wurst_stack[wurst_stack_depth] = "when calling alloc_VoidFunction_Test in cycle_with_generics, line 12" set wurst_stack_depth = wurst_stack_depth + 1 if VoidFunction_firstFree == 0 then if VoidFunction_maxIndex < 32768 then set VoidFunction_maxIndex = VoidFunction_maxIndex + 1 set this = VoidFunction_maxIndex set VoidFunction_typeId[this] = 3 else call error("Out of memory: Could not create VoidFunction_Test.", "when calling error in cycle_with_generics, line 12") set this = 0 endif else set VoidFunction_firstFree = VoidFunction_firstFree - 1 set this = VoidFunction_nextFree[VoidFunction_firstFree] set VoidFunction_typeId[this] = 3 endif set wurst_stack_depth = wurst_stack_depth - 1 if i > 0 then call cyc_foo(1, this, null, i, "when calling call in cycle_with_generics, line 14") endif set wurst_stack_depth = wurst_stack_depth - 1 endfunction function initGlobals takes nothing returns nothing endfunction function main takes nothing returns nothing call initGlobals() set wurst_stack[wurst_stack_depth] = "when calling init_Test in cycle_with_generics, line 1" set wurst_stack_depth = wurst_stack_depth + 1 call bar(10, "when calling bar in cycle_with_generics, line 16") if Test_x == 11 then call testSuccess() endif set wurst_stack_depth = wurst_stack_depth - 1 endfunction function config takes nothing returns nothing endfunction