diff options
author | David Mitchell <davem@iabyn.com> | 2010-05-18 00:54:50 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2010-05-18 00:54:50 +0100 |
commit | c86ffc3299ed26fc3616b4d2bb0abdf2e70a0ad1 (patch) | |
tree | 20c0f5dfcddd3da2880abf14aadee17d6c4b0436 /t | |
parent | 7eb4f9b7b5bb8d1dc09764c85ca57bc61f5b6f92 (diff) | |
download | perl-c86ffc3299ed26fc3616b4d2bb0abdf2e70a0ad1.tar.gz |
further fix for RT #23810
The fix for #23810, 27e904532594b7fb, introduced a regression, spotted by
Nicholas as RT #75146.
Basically, in S_doeval() if the yyparse() fails due to dying (rather than
just bailing out with with a syntax error, say), then the topmost EVAL
context will have been popped. My improved error handling code mostly
understood the difference, but forgot that in the die case, PL_eval_root
will have been restored to its previous value by the CX pop, and thus
its value shouldn't be messed with.
Diffstat (limited to 't')
-rw-r--r-- | t/run/fresh_perl.t | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/t/run/fresh_perl.t b/t/run/fresh_perl.t index f22e170fc6..2019d9b520 100644 --- a/t/run/fresh_perl.t +++ b/t/run/fresh_perl.t @@ -857,3 +857,43 @@ $@ =~ s/ at .*/ at/; print $@ EXPECT Malformed UTF-8 character (unexpected end of string) in substitution (s///) at +######## "#75146: 27e904532594b7fb (fix for #23810) introduces a #regression" +use strict; + +unshift @INC, sub { + my ($self, $fn) = @_; + + (my $pkg = $fn) =~ s{/}{::}g; + $pkg =~ s{.pm$}{}; + + if ($pkg eq 'Credit') { + my $code = <<'EOC'; +package Credit; + +use NonsenseAndBalderdash; + +1; +EOC + eval $code; + die "\$@ is $@"; + } + + #print STDERR "Generator: not one of mine, ignoring\n"; + return undef; +}; + +# create load-on-demand new() constructors +{ + package Credit; + sub new { + eval "use Credit"; + } +}; + +eval { + my $credit = new Credit; +}; + +print "If you get here, you didn't crash\n"; +EXPECT +If you get here, you didn't crash |