Skip to content

Commit

Permalink
Don't run CallFrame.leave twice when phasers throw - on JVM
Browse files Browse the repository at this point in the history
Fixes RT #121935
  • Loading branch information
Donald Hunter committed Mar 4, 2015
1 parent 4602aa5 commit 54d3cf5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vm/jvm/QAST/Compiler.nqp
Expand Up @@ -3775,9 +3775,6 @@ class QAST::CompilerJAST {
# rethrown, after calling CallFrame.leave. Others are passed on to
# dieInternal. Finally, if there's no exception, we also need to
# call CallFrame.leave.
$il.append(JAST::Instruction.new( :op('aload'), 'cf' ));
$il.append(JAST::Instruction.new( :op('invokevirtual'),
$TYPE_CF, 'leave', 'Void' ));
my $posthan := JAST::InstructionList.new();
my $nclab := JAST::Label.new( :name('non_cont_ex') );
$posthan.append($DUP);
Expand All @@ -3795,6 +3792,9 @@ class QAST::CompilerJAST {
$posthan.append($ATHROW);
$*JMETH.append(JAST::TryCatch.new( :try($il), :catch($posthan),
:type($TYPE_THROWABLE) ));
$*JMETH.append(JAST::Instruction.new( :op('aload'), 'cf' ));
$*JMETH.append(JAST::Instruction.new( :op('invokevirtual'),
$TYPE_CF, 'leave', 'Void' ));
$*JMETH.append($RETURN);

if $save_sites {
Expand Down

0 comments on commit 54d3cf5

Please sign in to comment.