]> git.vpit.fr Git - perl/modules/Sub-Nary.git/commitdiff
When exiting a try block, the die weight must go into the list part instead of return
authorVincent Pit <vince@profvince.com>
Thu, 21 Aug 2008 10:48:32 +0000 (12:48 +0200)
committerVincent Pit <vince@profvince.com>
Thu, 21 Aug 2008 10:48:32 +0000 (12:48 +0200)
lib/Sub/Nary.pm

index 159dd8e6bc9a31fb753478eec7c573feb852bad1..ef72c7fa8428d4c44554e8ecab0aceececbf6eec 100644 (file)
@@ -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;