1
0

Fix local data

This commit is contained in:
otya128
2016-12-24 16:44:08 +09:00
parent 197fdeb33d
commit be9afb82ca
2 changed files with 6 additions and 0 deletions

View File

@@ -1421,6 +1421,8 @@ class CallFunctionCode : Code
//TODO:args
auto bp = vm.stacki;
vm.push(Value(vm.currentData));
vm.currentData.index = 0;
vm.currentData.table = func.scope_.data;
vm.push(Value(vm.bp));
vm.pushpc;//vm.push(Value(vm.pc));
vm.bp = bp;
@@ -1494,6 +1496,8 @@ class CallFunctionS : Code
//TODO:args
auto bp = vm.stacki;
vm.push(Value(vm.currentData));
vm.currentData.index = 0;
vm.currentData.table = func.scope_.data;
vm.push(Value(vm.bp));
vm.pushpc;//vm.push(Value(vm.pc));
vm.bp = bp;

View File

@@ -67,6 +67,7 @@ class Scope
{
this();
this.func = func;
func.scope_ = this;
}
}
class DataTable
@@ -94,6 +95,7 @@ class Function
int[wstring] label;
bool returnExpr;
int outArgCount;
Scope scope_;
bool isCommon;
VMSlot slot;/*common function*/
bool isDead;/*common function*/