Fix data
This commit is contained in:
@@ -354,7 +354,16 @@ class VM
|
|||||||
}
|
}
|
||||||
void restoreData(wstring label)
|
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;
|
int olddti;
|
||||||
void pushDataIndex()
|
void pushDataIndex()
|
||||||
@@ -549,6 +558,7 @@ class VM
|
|||||||
{
|
{
|
||||||
vm.setCurrentSlot(func.slot.index);
|
vm.setCurrentSlot(func.slot.index);
|
||||||
}
|
}
|
||||||
|
vm.currentData.table = func.scope_.data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
enum CodeType
|
enum CodeType
|
||||||
@@ -1591,6 +1601,14 @@ class ReturnFunction : Code
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
vm.currentFunction = cfunc.func;
|
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;
|
vm.stacki -= func.argCount;
|
||||||
if(func.returnExpr)
|
if(func.returnExpr)
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class BuiltinFunctions
|
|||||||
va = f;
|
va = f;
|
||||||
}
|
}
|
||||||
//一応可変長は最後
|
//一応可変長は最後
|
||||||
if(va && (va.outoptional != 0 && va.outoptional <= outargc && va.results.length >= outargc) || va.results.length == outargc) return va;
|
if(va && ((va.outoptional != 0 && va.outoptional <= outargc && va.results.length >= outargc) || va.results.length == outargc)) return va;
|
||||||
writeln("====function overloads===");
|
writeln("====function overloads===");
|
||||||
writefln("func = %s argc = %d outargc = %d", func[0].name, argc, outargc);
|
writefln("func = %s argc = %d outargc = %d", func[0].name, argc, outargc);
|
||||||
foreach(f; func)
|
foreach(f; func)
|
||||||
|
|||||||
Reference in New Issue
Block a user