From: Rafael Garcia-Suarez Date: Fri, 9 Apr 2010 12:19:00 +0000 (+0200) Subject: [perl #74168] Assertion failure when emitting a stricture error message X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=10b53e54b35afb95d0539352073152024b143922;p=p5sagit%2Fp5-mst-13.2.git [perl #74168] Assertion failure when emitting a stricture error message --- diff --git a/pp.c b/pp.c index e4660b3..df8f048 100644 --- a/pp.c +++ b/pp.c @@ -207,7 +207,7 @@ PP(pp_rv2gv) } else { if (PL_op->op_private & HINT_STRICT_REFS) - DIE(aTHX_ S_no_symref_sv, sv, (SvCUR(sv)>32 ? "..." : ""), "a symbol"); + DIE(aTHX_ S_no_symref_sv, sv, (SvPOK(sv) && SvCUR(sv)>32 ? "..." : ""), "a symbol"); if ((PL_op->op_private & (OPpLVAL_INTRO|OPpDONT_INIT_GV)) == OPpDONT_INIT_GV) { /* We are the target of a coderef assignment. Return @@ -237,7 +237,7 @@ Perl_softref2xv(pTHX_ SV *const sv, const char *const what, if (PL_op->op_private & HINT_STRICT_REFS) { if (SvOK(sv)) - Perl_die(aTHX_ S_no_symref_sv, sv, (SvCUR(sv)>32 ? "..." : ""), what); + Perl_die(aTHX_ S_no_symref_sv, sv, (SvPOK(sv) && SvCUR(sv)>32 ? "..." : ""), what); else Perl_die(aTHX_ PL_no_usym, what); } diff --git a/t/lib/strict/refs b/t/lib/strict/refs index e8f7566..ada170e 100644 --- a/t/lib/strict/refs +++ b/t/lib/strict/refs @@ -332,3 +332,9 @@ EXPECT defined(%hash) is deprecated at - line 4. (Maybe you should just omit the defined()?) Can't use string ("foo") as a HASH ref while "strict refs" in use at - line 4. +######## +# [perl #37886] strict 'refs' doesn't apply inside definedlssertion failed: (SvTYPE(_svcur) >= SVt_PV), function Perl_softref2xv, file pp.c, line 240. +use strict 'refs'; +my $o = 1 ; $o->{1} ; +EXPECT +Can't use string ("1") as a HASH ref while "strict refs" in use at - line 3.