Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix CATCH/CONTROL phaser and thread interaction.
We over-shared the blocks, meaning that once threads showed up we got
into weird problems. Possibly recursion could reproduce it too. In the
threads case, the CATCH in Lock.protect sometimes tried to unlock the
wrong mutex.
  • Loading branch information
jnthn committed Apr 21, 2014
1 parent a364a1f commit 3b6ab9e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Perl6/Actions.nqp
Expand Up @@ -6573,11 +6573,20 @@ class Perl6::Actions is HLL::Actions does STDActions {
QAST::Var.new( :name($exceptionreg), :scope('local') )));
}

# create code that calls our handler with the Parrot exception
# as argument and returns the result. The install the handler.
# Install the handler, taking care over scoping.
my $handler_lex_name := $handler.unique('__HANDLER_');
$*W.cur_lexpad()[0].push(QAST::Op.new(
:op('bind'),
QAST::Var.new( :name($handler_lex_name), :scope('lexical'), :decl('var') ),
block_closure($handler)
));
%*HANDLERS{$type} := QAST::Stmts.new(
:node($/),
QAST::Op.new( :op('p6invokehandler'), $handler, $ex ),
QAST::Op.new(
:op('p6invokehandler'),
QAST::Var.new( :name($handler_lex_name), :scope('lexical') ),
$ex
),
QAST::Var.new( :scope('lexical'), :name('Nil') )
);
}
Expand Down

0 comments on commit 3b6ab9e

Please sign in to comment.