Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[dotnet] Add a leave_block op. This is what we'll do when needing to …
…do some stack unwinding.
  • Loading branch information
jnthn committed Oct 21, 2010
1 parent 47c868a commit c788c81
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dotnet/runtime/Runtime/Ops.cs
Expand Up @@ -675,5 +675,18 @@ public static RakudoObject llmapping_elems(ThreadContext TC, RakudoObject LLMapp
throw new Exception("Cannot use llmapping_elems if representation is not P6mapping");
}
}

/// <summary>
/// Leaves the specified block, returning the specified value from it. This
/// unwinds the stack.
/// </summary>
/// <param name="TC"></param>
/// <param name="Block"></param>
/// <param name="ReturnValue"></param>
/// <returns></returns>
public static RakudoObject leave_block(ThreadContext TC, RakudoObject Block, RakudoObject ReturnValue)
{
throw new Exceptions.LeaveStackUnwinderException(Block as RakudoCodeRef.Instance, ReturnValue);
}
}
}

0 comments on commit c788c81

Please sign in to comment.