Fix GotoExpr to use VM.currentFunction
This commit is contained in:
@@ -927,10 +927,8 @@ class GotoFalse : Code
|
|||||||
}
|
}
|
||||||
class GotoExpr : Code
|
class GotoExpr : Code
|
||||||
{
|
{
|
||||||
Scope sc;
|
this()
|
||||||
this(Scope sc)
|
|
||||||
{
|
{
|
||||||
this.sc = sc;
|
|
||||||
}
|
}
|
||||||
override void execute(VM vm)
|
override void execute(VM vm)
|
||||||
{
|
{
|
||||||
@@ -939,9 +937,9 @@ class GotoExpr : Code
|
|||||||
if(label.isString)
|
if(label.isString)
|
||||||
{
|
{
|
||||||
int pc;
|
int pc;
|
||||||
if (sc && sc.func)
|
if (vm.currentFunction)
|
||||||
{
|
{
|
||||||
pc = sc.func.label.get(label.castDString, int.min);
|
pc = vm.currentFunction.label.get(label.castDString, int.min);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1007,7 +1007,7 @@ class Compiler
|
|||||||
if(!gotou.label)
|
if(!gotou.label)
|
||||||
{
|
{
|
||||||
compileExpression(gotou.labelexpr, s);
|
compileExpression(gotou.labelexpr, s);
|
||||||
genCode(new GotoExpr(s));
|
genCode(new GotoExpr());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user