Fix variable definition from direct mode
This commit is contained in:
@@ -331,7 +331,7 @@ class Compiler
|
|||||||
code ~= new PushG(global);
|
code ~= new PushG(global);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(sc.func)
|
if(sc.func && !isDirectMode)
|
||||||
{
|
{
|
||||||
code ~= new PushL(sc.func.getLocalVarIndex(name, this));
|
code ~= new PushL(sc.func.getLocalVarIndex(name, this));
|
||||||
return;
|
return;
|
||||||
@@ -359,7 +359,7 @@ class Compiler
|
|||||||
code ~= new PushGRef(global);
|
code ~= new PushGRef(global);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(sc.func)
|
if(sc.func && !isDirectMode)
|
||||||
{
|
{
|
||||||
code ~= new PushLRef(sc.func.getLocalVarIndex(name, this));
|
code ~= new PushLRef(sc.func.getLocalVarIndex(name, this));
|
||||||
return;
|
return;
|
||||||
@@ -388,7 +388,7 @@ class Compiler
|
|||||||
code ~= new PopG(global);
|
code ~= new PopG(global);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(sc.func)
|
if(sc.func && !isDirectMode)
|
||||||
{
|
{
|
||||||
code ~= new PopL(sc.func.getLocalVarIndex(name, this));
|
code ~= new PopL(sc.func.getLocalVarIndex(name, this));
|
||||||
return;
|
return;
|
||||||
@@ -464,7 +464,7 @@ class Compiler
|
|||||||
}
|
}
|
||||||
int defineVarIndex(wstring name, Scope sc)
|
int defineVarIndex(wstring name, Scope sc)
|
||||||
{
|
{
|
||||||
if(sc.func)
|
if(sc.func && !isDirectMode)
|
||||||
{
|
{
|
||||||
return sc.func.defineLocalVarIndex(name, this);
|
return sc.func.defineLocalVarIndex(name, this);
|
||||||
}
|
}
|
||||||
@@ -472,7 +472,7 @@ class Compiler
|
|||||||
}
|
}
|
||||||
int defineVarIndexVoid(wstring name, Scope sc)
|
int defineVarIndexVoid(wstring name, Scope sc)
|
||||||
{
|
{
|
||||||
if(sc.func)
|
if(sc.func && !isDirectMode)
|
||||||
{
|
{
|
||||||
return sc.func.defineLocalVarIndexVoid(name, this);
|
return sc.func.defineLocalVarIndexVoid(name, this);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user