diff --git a/SMILEBASIC/VM.d b/SMILEBASIC/VM.d index da684c0..0381cb3 100644 --- a/SMILEBASIC/VM.d +++ b/SMILEBASIC/VM.d @@ -1406,10 +1406,6 @@ class CallFunctionCode : Code { throw new IllegalFunctionCall(name.to!string); } - if (func.isCommon) - { - vm.setCurrentSlot(func.slot.index); - } vm.pushBackTrace(name); //TODO:args auto bp = vm.stacki; @@ -1426,6 +1422,10 @@ class CallFunctionCode : Code vm.stack[bp + v.index] = Value(v.type); } } + if (func.isCommon) + { + vm.setCurrentSlot(func.slot.index); + } } override string toString(VM vm) {