1
0
This commit is contained in:
otya128
2017-07-04 22:07:47 +09:00
parent af1a6aa6f2
commit 3dc9b4e0e5
2 changed files with 20 additions and 2 deletions

View File

@@ -354,7 +354,16 @@ class VM
}
void restoreData(wstring label)
{
currentData.index = currentData.table.label[label];
if (label in currentData.table.label)
currentData.index = currentData.table.label[label];
else if (label in currentSlot.globalData.table.label)
{
currentData.index = currentSlot.globalData.table.label[label];
}
else
{
throw new UndefinedLabel();
}
}
int olddti;
void pushDataIndex()
@@ -549,6 +558,7 @@ class VM
{
vm.setCurrentSlot(func.slot.index);
}
vm.currentData.table = func.scope_.data;
}
}
enum CodeType
@@ -1591,6 +1601,14 @@ class ReturnFunction : Code
else
{
vm.currentFunction = cfunc.func;
if (vm.currentFunction)
{
vm.currentData.table = vm.currentFunction.scope_.data;
}
else
{
vm.currentData.table = vm.currentSlot.globalData.table;
}
}
vm.stacki -= func.argCount;
if(func.returnExpr)