Fix RESTORE

This commit is contained in:
otya128 committed 2016-12-15 00:32:30 +09:00
1 parent 18ff3016e6
commit ec0579e110
1 file changed
+12 -1
+12 -1
View File
@@ -1719,7 +1719,18 @@ class RestoreExprCode : Code
vm.pop(label);
if(!label.isString)
throw new TypeMismatch();
datatable.dataIndex = datatable.label[label.stringValue];
if (label.stringValue in datatable.label)
{
datatable.dataIndex = datatable.label[label.stringValue];
}
else if (label.stringValue in vm.currentSlot.globalDataTable.label)
{
datatable.dataIndex = vm.currentSlot.globalDataTable.label[label.stringValue];
}
else
{
throw new UndefinedLabel();
}
}
override string toString(VM vm)
{