From: Gurusamy Sarathy Date: Tue, 15 Feb 2000 20:57:12 +0000 (+0000) Subject: fix change#5104 under useithreads X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9615e7416438b376811c3ef177cc7b681939bbd1;p=p5sagit%2Fp5-mst-13.2.git fix change#5104 under useithreads p4raw-link: @5104 on //depot/perl: 345599ca7248bba771c8a9cadc2422a744a61ff2 p4raw-id: //depot/perl@5112 --- diff --git a/op.c b/op.c index ea58e6f..430b11c 100644 --- a/op.c +++ b/op.c @@ -6458,11 +6458,12 @@ Perl_peep(pTHX_ register OP *o) UNOP *rop; SV *lexname; GV **fields; - SV **svp, **indsvp; + SV **svp, **indsvp, *sv; I32 ind; char *key; STRLEN keylen; + o->op_seq = PL_op_seqmax++; if ((o->op_private & (OPpLVAL_INTRO)) || ((BINOP*)o)->op_last->op_type != OP_CONST) break; @@ -6489,8 +6490,13 @@ Perl_peep(pTHX_ register OP *o) rop->op_ppaddr = PL_ppaddr[OP_RV2AV]; o->op_type = OP_AELEM; o->op_ppaddr = PL_ppaddr[OP_AELEM]; + sv = newSViv(ind); + if (SvREADONLY(*svp)) + SvREADONLY_on(sv); + SvFLAGS(sv) |= (SvFLAGS(*svp) + & (SVs_PADBUSY|SVs_PADTMP|SVs_PADMY)); SvREFCNT_dec(*svp); - *svp = newSViv(ind); + *svp = sv; break; } @@ -6498,12 +6504,13 @@ Perl_peep(pTHX_ register OP *o) UNOP *rop; SV *lexname; GV **fields; - SV **svp, **indsvp; + SV **svp, **indsvp, *sv; I32 ind; char *key; STRLEN keylen; SVOP *first_key_op, *key_op; - + + o->op_seq = PL_op_seqmax++; if ((o->op_private & (OPpLVAL_INTRO)) /* I bet there's always a pushmark... */ || ((LISTOP*)o)->op_first->op_sibling->op_type != OP_LIST) @@ -6538,14 +6545,20 @@ Perl_peep(pTHX_ register OP *o) key = SvPV(*svp, keylen); indsvp = hv_fetch(GvHV(*fields), key, keylen, FALSE); if (!indsvp) { - Perl_croak(aTHX_ "No such pseudo-hash field \"%s\" in variable %s of type %s", + Perl_croak(aTHX_ "No such pseudo-hash field \"%s\" " + "in variable %s of type %s", key, SvPV(lexname, n_a), HvNAME(SvSTASH(lexname))); } ind = SvIV(*indsvp); if (ind < 1) Perl_croak(aTHX_ "Bad index while coercing array into hash"); + sv = newSViv(ind); + if (SvREADONLY(*svp)) + SvREADONLY_on(sv); + SvFLAGS(sv) |= (SvFLAGS(*svp) + & (SVs_PADBUSY|SVs_PADTMP|SVs_PADMY)); SvREFCNT_dec(*svp); - *svp = newSViv(ind); + *svp = sv; } break; }