From: Vincent Pit Date: Thu, 21 Aug 2008 10:48:32 +0000 (+0200) Subject: When exiting a try block, the die weight must go into the list part instead of return X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=56f190d50decd03a6c45dfb4f77b5a535460a174;p=perl%2Fmodules%2FSub-Nary.git When exiting a try block, the die weight must go into the list part instead of return --- diff --git a/lib/Sub/Nary.pm b/lib/Sub/Nary.pm index 159dd8e..ef72c7f 100644 --- a/lib/Sub/Nary.pm +++ b/lib/Sub/Nary.pm @@ -523,7 +523,14 @@ sub pp_leavetry { my ($r, $l) = $self->inspect_kids($op); if (defined $r) { my $d = delete $r->{die}; - $r->{0} += $d if defined $d; + return $r, $l if not defined $d; + if (defined $l) { + my $z = delete $l->{0}; + $l = { %$l, 0 => $z }; + $l->{0} += $d; + } else { + $l = { 0 => $d }; + } } return $r, $l;