Change 29861 by [EMAIL PROTECTED] on 2007/01/17 22:36:16
Integrate:
[ 26881]
The current OP that is tested in doeval() can be a require(), an
eval() or a do(). When we test whether OPf_SPECIAL is set on it, be
sure to take into account that it's the eval-related meaning of
OPf_SPECIAL we're testing for, not the require-related one.
[ 26883]
Regression test for change #26881
[ 26891]
New t/comp/require.t tests should go before the conditional exit.
Affected files ...
... //depot/maint-5.8/perl/pp_ctl.c#141 integrate
... //depot/maint-5.8/perl/t/comp/require.t#11 integrate
Differences ...
==== //depot/maint-5.8/perl/pp_ctl.c#141 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#140~29859~ 2007-01-17 14:07:40.000000000 -0800
+++ perl/pp_ctl.c 2007-01-17 14:36:16.000000000 -0800
@@ -2825,7 +2825,7 @@
PL_error_count = 0;
PL_curcop = &PL_compiling;
PL_curcop->cop_arybase = 0;
- if (saveop && saveop->op_flags & OPf_SPECIAL)
+ if (saveop && saveop->op_type != OP_REQUIRE && saveop->op_flags &
OPf_SPECIAL)
PL_in_eval |= EVAL_KEEPERR;
else
sv_setpvn(ERRSV,"",0);
==== //depot/maint-5.8/perl/t/comp/require.t#11 (xtext) ====
Index: perl/t/comp/require.t
--- perl/t/comp/require.t#10~26971~ 2006-01-27 12:12:42.000000000 -0800
+++ perl/t/comp/require.t 2007-01-17 14:36:16.000000000 -0800
@@ -11,7 +11,7 @@
my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0;
my $Is_UTF8 = (${^OPEN} || "") =~ /:utf8/;
-my $total_tests = 31;
+my $total_tests = 32;
if ($Is_EBCDIC || $Is_UTF8) { $total_tests -= 3; }
print "1..$total_tests\n";
@@ -157,6 +157,16 @@
print "not ok $i\n";
}
+
+write_file('bleah.pm', qq(die "This is an expected error";\n));
+delete $INC{"bleah.pm"}; ++$::i;
+eval { CORE::require bleah; };
+if ($@ =~ /^This is an expected error/) {
+ print "ok $i\n";
+} else {
+ print "not ok $i\n";
+}
+
##########################################
# What follows are UTF-8 specific tests. #
# Add generic tests before this point. #
End of Patch.