Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix a regression in reporting illegal C<return>.
The X::ControlFlow set of exceptions coming with the backtrace of the
place that did the wrong control flow is certainly a good thing, but
unfortunately the patch to make that happen meant we lost backtraces
for C<return>. This fixes the regression.
  • Loading branch information
jnthn committed Jul 24, 2015
1 parent 0d2fea2 commit c683fe9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/Exception.pm
Expand Up @@ -1581,6 +1581,10 @@ my class X::ControlFlow is Exception {
has $.enclosing; # .... outside a loop
has $.backtrace; # where the bougs control flow op was

method backtrace() {
$!backtrace || nextsame();
}

method message() { "$.illegal without $.enclosing" }
}
my class X::ControlFlow::Return is X::ControlFlow {
Expand Down

0 comments on commit c683fe9

Please sign in to comment.