1
0

Fix GotoExpr to use VM.currentFunction

This commit is contained in:
otya128
2016-12-24 19:40:24 +09:00
parent ce71082b29
commit 2c970f6dea
2 changed files with 4 additions and 6 deletions

View File

@@ -927,10 +927,8 @@ class GotoFalse : Code
}
class GotoExpr : Code
{
Scope sc;
this(Scope sc)
this()
{
this.sc = sc;
}
override void execute(VM vm)
{
@@ -939,9 +937,9 @@ class GotoExpr : Code
if(label.isString)
{
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
{