Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2899,7 +2899,7 @@ Perl_magic_setlvref(pTHX_ SV *sv, MAGIC *mg)
(void)hv_store_ent((HV *)mg->mg_obj, (SV *)mg->mg_ptr,
SvREFCNT_inc_simple_NN(SvRV(sv)), 0);
}
if (mg->mg_flags & MGf_PERSIST)
if (mg->mg_private & OPpLVREF_ITER)
NOOP; /* This sv is in use as an iterator var and will be reused,
so we must leave the magic. */
else
Expand Down
1 change: 0 additions & 1 deletion mg.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ struct magic {
#define MGf_DUP 0x10 /* has an svt_dup MGVTBL entry */
#define MGf_LOCAL 0x20 /* has an svt_local MGVTBL entry */
#define MGf_BYTES 0x40 /* PERL_MAGIC_regex_global only */
#define MGf_PERSIST 0x80 /* PERL_MAGIC_lvref only */

#define MgTAINTEDDIR(mg) (mg->mg_flags & MGf_TAINTEDDIR)
#define MgTAINTEDDIR_on(mg) (mg->mg_flags |= MGf_TAINTEDDIR)
Expand Down
2 changes: 0 additions & 2 deletions pp.c
Original file line number Diff line number Diff line change
Expand Up @@ -7598,8 +7598,6 @@ PP_wrapped(pp_lvref,
&PL_vtbl_lvref, (char *)elem,
elem ? HEf_SVKEY : (I32)ARGTARG);
mg->mg_private = PL_op->op_private;
if (PL_op->op_private & OPpLVREF_ITER)
mg->mg_flags |= MGf_PERSIST;
if (UNLIKELY(PL_op->op_private & OPpLVAL_INTRO)) {
if (elem) {
assert(arg);
Expand Down
Loading