Fix local data
This commit is contained in:
@@ -1421,6 +1421,8 @@ class CallFunctionCode : Code
|
|||||||
//TODO:args
|
//TODO:args
|
||||||
auto bp = vm.stacki;
|
auto bp = vm.stacki;
|
||||||
vm.push(Value(vm.currentData));
|
vm.push(Value(vm.currentData));
|
||||||
|
vm.currentData.index = 0;
|
||||||
|
vm.currentData.table = func.scope_.data;
|
||||||
vm.push(Value(vm.bp));
|
vm.push(Value(vm.bp));
|
||||||
vm.pushpc;//vm.push(Value(vm.pc));
|
vm.pushpc;//vm.push(Value(vm.pc));
|
||||||
vm.bp = bp;
|
vm.bp = bp;
|
||||||
@@ -1494,6 +1496,8 @@ class CallFunctionS : Code
|
|||||||
//TODO:args
|
//TODO:args
|
||||||
auto bp = vm.stacki;
|
auto bp = vm.stacki;
|
||||||
vm.push(Value(vm.currentData));
|
vm.push(Value(vm.currentData));
|
||||||
|
vm.currentData.index = 0;
|
||||||
|
vm.currentData.table = func.scope_.data;
|
||||||
vm.push(Value(vm.bp));
|
vm.push(Value(vm.bp));
|
||||||
vm.pushpc;//vm.push(Value(vm.pc));
|
vm.pushpc;//vm.push(Value(vm.pc));
|
||||||
vm.bp = bp;
|
vm.bp = bp;
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ class Scope
|
|||||||
{
|
{
|
||||||
this();
|
this();
|
||||||
this.func = func;
|
this.func = func;
|
||||||
|
func.scope_ = this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class DataTable
|
class DataTable
|
||||||
@@ -94,6 +95,7 @@ class Function
|
|||||||
int[wstring] label;
|
int[wstring] label;
|
||||||
bool returnExpr;
|
bool returnExpr;
|
||||||
int outArgCount;
|
int outArgCount;
|
||||||
|
Scope scope_;
|
||||||
bool isCommon;
|
bool isCommon;
|
||||||
VMSlot slot;/*common function*/
|
VMSlot slot;/*common function*/
|
||||||
bool isDead;/*common function*/
|
bool isDead;/*common function*/
|
||||||
|
|||||||
Reference in New Issue
Block a user