From: Nicholas Clark Date: Fri, 2 Mar 2007 15:02:43 +0000 (+0000) Subject: Avoid an assertion failure when overloading readpipe. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d5e716f5db1b48a63e9e9ea3707ee638103b34a4;p=p5sagit%2Fp5-mst-13.2.git Avoid an assertion failure when overloading readpipe. p4raw-id: //depot/perl@30444 --- diff --git a/t/op/gv.t b/t/op/gv.t index d736138..b5f63be 100755 --- a/t/op/gv.t +++ b/t/op/gv.t @@ -12,7 +12,7 @@ BEGIN { use warnings; require './test.pl'; -plan( tests => 159 ); +plan( tests => 160 ); # type coersion on assignment $foo = 'foo'; @@ -480,6 +480,10 @@ foreach my $value ([1,2,3], {1=>2}, *STDOUT{IO}, \&ok, *STDOUT{FORMAT}) { $CORE::GLOBAL::{"readline"}=[]; eval "no warnings; "; is($@, '', "Can't trip up readline overloading"); + + $CORE::GLOBAL::{"readpipe"}=[]; + eval "`` if 0"; + is($@, '', "Can't trip up readpipe overloading"); } __END__ Perl diff --git a/toke.c b/toke.c index 2498de2..5c4e4e2 100644 --- a/toke.c +++ b/toke.c @@ -2922,7 +2922,7 @@ S_readpipe_override(pTHX) && GvCVu(gv_readpipe) && GvIMPORTED_CV(gv_readpipe)) || ((gvp = (GV**)hv_fetchs(PL_globalstash, "readpipe", FALSE)) - && (gv_readpipe = *gvp) != (GV*)&PL_sv_undef + && (gv_readpipe = *gvp) && isGV_with_GP(gv_readpipe) && GvCVu(gv_readpipe) && GvIMPORTED_CV(gv_readpipe))) { PL_lex_op = (OP*)newUNOP(OP_ENTERSUB, OPf_STACKED,