From: Nicholas Clark Date: Tue, 17 Nov 2009 10:17:11 +0000 (+0000) Subject: Restore strict refs on stashes, removed by ce10b5d1ec5b5f68b0811018a415bc37. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dd9035cd5bdeced1187df399d27d526f3b30194b;p=p5sagit%2Fp5-mst-13.2.git Restore strict refs on stashes, removed by ce10b5d1ec5b5f68b0811018a415bc37. Strictures on stashes were special-cased, because the lexer was special-cased to avoid autovivifying stashes (in adc51b978ed1b2e9d4512c9bfa80386ac917d05a, now reverted), to keep the behaviour of defined %stash:: consistent. defined %stash:: is deprecated. Keep the new regression tests from ce10b5d1ec5b5f68b0811018a415bc37bb6bfe5e. --- diff --git a/op.c b/op.c index 3edb122..47f8300 100644 --- a/op.c +++ b/op.c @@ -6747,17 +6747,6 @@ Perl_ck_rvconst(pTHX_ register OP *o) Perl_croak(aTHX_ "Constant is not %s reference", badtype); return o; } - else if ((o->op_type == OP_RV2HV || o->op_type == OP_RV2SV) && - (PL_hints & HINT_STRICT_REFS) && SvPOK(kidsv)) { - /* If this is an access to a stash, disable "strict refs", because - * stashes aren't auto-vivified at compile-time (unless we store - * symbols in them), and we don't want to produce a run-time - * stricture error when auto-vivifying the stash. */ - const char *s = SvPV_nolen(kidsv); - const STRLEN l = SvCUR(kidsv); - if (l > 1 && s[l-1] == ':' && s[l-2] == ':') - o->op_private &= ~HINT_STRICT_REFS; - } if ((o->op_private & HINT_STRICT_REFS) && (kid->op_private & OPpCONST_BARE)) { const char *badthing; switch (o->op_type) {