#if defined(DEBUGGING)
p |int |get_debug_opts |char **s
#endif
+Ap |void |save_set_svflags|SV* sv|U32 mask|U32 val
#define get_debug_opts Perl_get_debug_opts
#endif
#endif
+#define save_set_svflags Perl_save_set_svflags
#define ck_anoncode Perl_ck_anoncode
#define ck_bitop Perl_ck_bitop
#define ck_concat Perl_ck_concat
#define get_debug_opts(a) Perl_get_debug_opts(aTHX_ a)
#endif
#endif
+#define save_set_svflags(a,b,c) Perl_save_set_svflags(aTHX_ a,b,c)
#define ck_anoncode(a) Perl_ck_anoncode(aTHX_ a)
#define ck_bitop(a) Perl_ck_bitop(aTHX_ a)
#define ck_concat(a) Perl_ck_concat(aTHX_ a)
Perl_PerlIO_stdin
Perl_PerlIO_stdout
Perl_PerlIO_stderr
+Perl_save_set_svflags
append_elem(OP_LIST, expr, scalar(sv))));
assert(!loop->op_next);
/* for my $x () sets OPpLVAL_INTRO;
- * for our $x () sets OPpOUR_INTRO; both only used by Deparse.pm */
+ * for our $x () sets OPpOUR_INTRO */
loop->op_private = (U8)iterpflags;
#ifdef PL_OP_SLAB_ALLOC
{
SAVETMPS;
if (PL_op->op_targ) {
+ if (PL_op->op_private & OPpLVAL_INTRO) { /* for my $x (...) */
+ SvPADSTALE_off(PAD_SVl(PL_op->op_targ));
+ SAVESETSVFLAGS(PAD_SVl(PL_op->op_targ),
+ SVs_PADSTALE, SVs_PADSTALE);
+ }
#ifndef USE_ITHREADS
svp = &PAD_SVl(PL_op->op_targ); /* "my" variable */
SAVESPTR(*svp);
#if defined(DEBUGGING)
PERL_CALLCONV int Perl_get_debug_opts(pTHX_ char **s);
#endif
+PERL_CALLCONV void Perl_save_set_svflags(pTHX_ SV* sv, U32 mask, U32 val);
SSPUSHINT(SAVEt_SHARED_PVREF);
}
+/* set the SvFLAGS specified by mask to the values in val */
+
+void
+Perl_save_set_svflags(pTHX_ SV* sv, U32 mask, U32 val)
+{
+ SSCHECK(4);
+ SSPUSHPTR(sv);
+ SSPUSHINT(mask);
+ SSPUSHINT(val);
+ SSPUSHINT(SAVEt_SET_SVFLAGS);
+}
+
void
Perl_save_gp(pTHX_ GV *gv, I32 empty)
{
AvARRAY((PAD*)ptr)[off] = (SV*)SSPOPPTR;
}
break;
+ case SAVEt_SET_SVFLAGS:
+ {
+ U32 val = (U32)SSPOPINT;
+ U32 mask = (U32)SSPOPINT;
+ sv = (SV*)SSPOPPTR;
+ SvFLAGS(sv) &= ~mask;
+ SvFLAGS(sv) |= val;
+ }
+ break;
default:
Perl_croak(aTHX_ "panic: leave_scope inconsistency");
}
#define SAVEt_MORTALIZESV 36
#define SAVEt_SHARED_PVREF 37
#define SAVEt_BOOL 38
+#define SAVEt_SET_SVFLAGS 39
#ifndef SCOPE_SAVES_SIGNAL_MASK
#define SCOPE_SAVES_SIGNAL_MASK 0
#define SAVEGENERICSV(s) save_generic_svref((SV**)&(s))
#define SAVEGENERICPV(s) save_generic_pvref((char**)&(s))
#define SAVESHAREDPV(s) save_shared_pvref((char**)&(s))
+#define SAVESETSVFLAGS(sv,mask,val) save_set_svflags(sv,mask,val)
#define SAVEDELETE(h,k,l) \
save_delete(SOFT_CAST(HV*)(h), SOFT_CAST(char*)(k), (I32)(l))
#define SAVEDESTRUCTOR(f,p) \
EXPECT
Variable "$x" is not available at (eval 1) line 2.
########
+use warnings 'closure' ;
+for my $x (1,2,3) {
+ sub f { eval '$x' }
+ f();
+}
+f();
+EXPECT
+Variable "$x" is not available at (eval 4) line 2.
+########
# pad.c
no warnings 'closure' ;
sub x {