From: Gurusamy Sarathy Date: Thu, 26 Nov 1998 06:51:16 +0000 (+0000) Subject: fix C misoptimization that fails X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7ad382f40c272949663b62a641674bd9771ee3b8;p=p5sagit%2Fp5-mst-13.2.git fix C misoptimization that fails to set the package for the block properly p4raw-id: //depot/perl@2299 --- diff --git a/op.c b/op.c index a64b435..cdc9332 100644 --- a/op.c +++ b/op.c @@ -2597,6 +2597,7 @@ package(OP *o) sv_setpv(PL_curstname,""); PL_curstash = Nullhv; } + PL_hints |= HINT_BLOCK_SCOPE; PL_copline = NOLINE; PL_expect = XSTATE; } diff --git a/t/comp/package.t b/t/comp/package.t index d7d19ae..4982256 100755 --- a/t/comp/package.t +++ b/t/comp/package.t @@ -1,6 +1,6 @@ #!./perl -print "1..7\n"; +print "1..8\n"; $blurfl = 123; $foo = 3; @@ -37,3 +37,17 @@ print $blurfl == 5 ? "ok 4\n" : "not ok 4\n"; eval 'print $blurfl == 5 ? "ok 5\n" : "not ok 5\n";'; eval 'package main; print $blurfl == 123 ? "ok 6\n" : "not ok 6\n";'; print $blurfl == 5 ? "ok 7\n" : "not ok 7\n"; + +package main; + +sub c { caller(0) } + +sub foo { + my $s = shift; + if ($s) { + package PQR; + main::c(); + } +} + +print((foo(1))[0] eq 'PQR' ? "ok 8\n" : "not ok 8\n"); diff --git a/t/lib/dumper.t b/t/lib/dumper.t index e3d339a..063df83 100755 --- a/t/lib/dumper.t +++ b/t/lib/dumper.t @@ -39,7 +39,7 @@ if (defined &Data::Dumper::Dumpxs) { } else { print "### XS extensions not loaded, will NOT run XS tests\n"; - $TMAX = 86; $XS = 0; + $TMAX = 81; $XS = 0; } print "1..$TMAX\n";