diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2002-08-03 01:44:21 +0200 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-08-08 14:56:56 +0000 |
commit | 1ce0b88cbbc3b4ceae3caf23aae18979e81daba4 (patch) | |
tree | ed9fae815df99f1cda19fe9a4ca11442a69d1d1e /op.c | |
parent | 736accd3cd04ba6a7a2bd59103c2b280027984c6 (diff) | |
download | perl-1ce0b88cbbc3b4ceae3caf23aae18979e81daba4.tar.gz |
Re: [perl #15898] coredump with variable our
Message-id: <20020802234421.11c62fe6.rgarciasuarez@free.fr>
p4raw-id: //depot/perl@17699
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -2090,19 +2090,19 @@ S_my_kid(pTHX_ OP *o, OP *attrs, OP **imopsp) } else if (type == OP_RV2SV || /* "our" declaration */ type == OP_RV2AV || type == OP_RV2HV) { /* XXX does this let anything illegal in? */ - if (cUNOPo->op_first->op_type != OP_GV) { /* MJD 20011224 */ - yyerror(Perl_form(aTHX_ "Can't declare %s in my", OP_DESC(o))); - } - if (attrs) { - GV *gv = cGVOPx_gv(cUNOPo->op_first); - PL_in_my = FALSE; - PL_in_my_stash = Nullhv; - apply_attrs(GvSTASH(gv), - (type == OP_RV2SV ? GvSV(gv) : - type == OP_RV2AV ? (SV*)GvAV(gv) : - type == OP_RV2HV ? (SV*)GvHV(gv) : (SV*)gv), - attrs, FALSE); - } + if (cUNOPo->op_first->op_type != OP_GV) { /* MJD 20011224 */ + yyerror(Perl_form(aTHX_ "Can't declare %s in %s", + OP_DESC(o), PL_in_my == KEY_our ? "our" : "my")); + } else if (attrs) { + GV *gv = cGVOPx_gv(cUNOPo->op_first); + PL_in_my = FALSE; + PL_in_my_stash = Nullhv; + apply_attrs(GvSTASH(gv), + (type == OP_RV2SV ? GvSV(gv) : + type == OP_RV2AV ? (SV*)GvAV(gv) : + type == OP_RV2HV ? (SV*)GvHV(gv) : (SV*)gv), + attrs, FALSE); + } o->op_private |= OPpOUR_INTRO; return o; } |