From: Ben Morrow Date: Tue, 16 Oct 2007 19:51:09 +0000 (+0100) Subject: Another ex-PVBM assert X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fdc5b0232cfd1c95eedd45a761da6b9eaac3a5eb;p=p5sagit%2Fp5-mst-13.2.git Another ex-PVBM assert Message-ID: p4raw-id: //depot/perl@32121 --- diff --git a/sv.c b/sv.c index 2f2cef9..bf2e8c8 100644 --- a/sv.c +++ b/sv.c @@ -3538,7 +3538,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags) } if (dtype >= SVt_PV) { - if (dtype == SVt_PVGV) { + if (dtype == SVt_PVGV && isGV_with_GP(dstr)) { glob_assign_ref(dstr, sstr); return; } diff --git a/t/op/lex_assign.t b/t/op/lex_assign.t index c6c424d..38f11cc 100755 --- a/t/op/lex_assign.t +++ b/t/op/lex_assign.t @@ -24,7 +24,7 @@ sub subb {"in s"} @INPUT = ; @simple_input = grep /^\s*\w+\s*\$\w+\s*[#\n]/, @INPUT; -print "1..", (10 + @INPUT + @simple_input), "\n"; +print "1..", (11 + @INPUT + @simple_input), "\n"; $ord = 0; sub wrn {"@_"} @@ -170,6 +170,25 @@ EOE } } } + +$ord++; +eval { + sub PVBM () { 'foo' } + index 'foo', PVBM; + my $x = PVBM; + + my $str = 'foo'; + my $pvlv = \substr $str, 0, 1; + $x = $pvlv; + + 1; +}; +if ($@) { + warn "# $@"; + print 'not '; +} +print "ok $ord\n"; + __END__ ref $xref # ref ref $cstr # ref nonref