Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make p6return force exit of outer handler block.
This means a CATCH with a matching when or a default will now actually
act handled rather than always rethrowing.
  • Loading branch information
jnthn committed Jun 23, 2013
1 parent 39d29d8 commit b9869c2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vm/jvm/Perl6/Ops.nqp
Expand Up @@ -89,6 +89,10 @@ $ops.add_hll_op('perl6', 'p6return', -> $qastcomp, $op {
$il.append(JAST::Instruction.new( :op('invokestatic'), $TYPE_OPS,
'return_o', 'Void', $TYPE_SMO, $TYPE_CF ));
$il.append(JAST::Instruction.new( :op('aload'), 'cf' ));
$il.append(JAST::Instruction.new( :op('getfield'), $TYPE_CF, 'outer', $TYPE_CF ));
$il.append(JAST::Instruction.new( :op('iconst_1') ));
$il.append(JAST::Instruction.new( :op('putfield'), $TYPE_CF, 'exitAfterUnwind', "Z" ));
$il.append(JAST::Instruction.new( :op('aload'), 'cf' ));
$il.append(JAST::Instruction.new( :op('invokevirtual'),
$TYPE_CF, 'leave', 'Void' ));
$il.append(JAST::Instruction.new( :op('return') ));
Expand Down

0 comments on commit b9869c2

Please sign in to comment.