summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-19 23:11:12 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-19 23:11:12 +0000
commit0282be9287c81efde41d8df3c62f1c95bb459498 (patch)
tree2035bee321e1f2d0d35ddcdf2b71da025e4796ab /op.c
parent696814337d4eac8d0663d5307d6e01964d1b2897 (diff)
downloadperl-0282be9287c81efde41d8df3c62f1c95bb459498.tar.gz
Let %^H be modifiable in eval-strings (bug #41531),
by adding a meaning for OPf_SPECIAL on OP_CONST. Patch by Yves Orton. p4raw-id: //depot/perl@30644
Diffstat (limited to 'op.c')
-rw-r--r--op.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/op.c b/op.c
index e6aadae11a..c7b31ba908 100644
--- a/op.c
+++ b/op.c
@@ -6037,8 +6037,11 @@ Perl_ck_eval(pTHX_ OP *o)
}
o->op_targ = (PADOFFSET)PL_hints;
if ((PL_hints & HINT_LOCALIZE_HH) != 0 && GvHV(PL_hintgv)) {
- /* Store a copy of %^H that pp_entereval can pick up */
- OP *hhop = newSVOP(OP_CONST, 0,
+ /* Store a copy of %^H that pp_entereval can pick up.
+ OPf_SPECIAL flags the opcode as being for this purpose,
+ so that it in turn will return a copy at every
+ eval.*/
+ OP *hhop = newSVOP(OP_CONST, OPf_SPECIAL,
(SV*)Perl_hv_copy_hints_hv(aTHX_ GvHV(PL_hintgv)));
cUNOPo->op_first->op_sibling = hhop;
o->op_private |= OPpEVAL_HAS_HH;