Skip to content

Commit

Permalink
Merge pull request #5 from friuns2/IenumeratorFix
Browse files Browse the repository at this point in the history
fixed IEnumerator
  • Loading branch information
pjc0247 authored Apr 7, 2022
2 parents 3b94149 + b4af255 commit 73e7422
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Slowsharp/Runner/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ internal HybInstance RunMethod(SSInterpretMethodInfo method, HybInstance[] args)
method.ReturnType.CompiledType == typeof(IEnumerator))
{
var enumerator = new SSEnumerator(this, node.Body, vf);
enumerator.Method = method;
Ret = HybInstance.Object(enumerator);
}
else
Expand Down
2 changes: 2 additions & 0 deletions Slowsharp/Runtime/SSEnumerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public bool MoveNext()
if (pc == -1)
return false;

runner.Ctx.PushMethod(Method);
pc = runner.RunBlock(block, vf, pc);
runner.Ctx.PopMethod();

// -1 means EndOfMethod
return pc == -1 ? false : true;
Expand Down

0 comments on commit 73e7422

Please sign in to comment.