pad_block_start(full);
SAVEHINTS();
PL_hints &= ~HINT_BLOCK_SCOPE;
- SAVECOPWARNINGS(&PL_compiling);
+ SAVECOMPILEWARNINGS();
PL_compiling.cop_warnings = DUP_WARNINGS(PL_compiling.cop_warnings);
SAVESPTR(PL_compiling.cop_io);
if (! specialCopIO(PL_compiling.cop_io)) {
PL_rsfp = tryrsfp;
SAVEHINTS();
PL_hints = 0;
- SAVECOPWARNINGS(&PL_compiling);
+ SAVECOMPILEWARNINGS();
if (PL_dowarn & G_WARN_ALL_ON)
PL_compiling.cop_warnings = pWARN_ALL ;
else if (PL_dowarn & G_WARN_ALL_OFF)
PL_hints = PL_op->op_targ;
if (saved_hh)
GvHV(PL_hintgv) = saved_hh;
- SAVECOPWARNINGS(&PL_compiling);
+ SAVECOMPILEWARNINGS();
PL_compiling.cop_warnings = DUP_WARNINGS(PL_curcop->cop_warnings);
SAVESPTR(PL_compiling.cop_io);
if (specialCopIO(PL_curcop->cop_io))
i = SSPOPINT;
CopARYBASE_set((COP *)ptr, i);
break;
- case SAVEt_COP_WARNINGS:
- {
- COP *const cop = SSPOPPTR;
- ptr = SSPOPPTR;
+ case SAVEt_COMPILE_WARNINGS:
+ ptr = SSPOPPTR;
- if (!specialWARN(cop->cop_warnings))
- PerlMemShared_free(cop->cop_warnings);
+ if (!specialWARN(PL_compiling.cop_warnings))
+ PerlMemShared_free(PL_compiling.cop_warnings);
- cop->cop_warnings = ptr;
- }
+ PL_compiling.cop_warnings = ptr;
break;
case SAVEt_RE_STATE:
{
#define SAVEt_SAVESWITCHSTACK 40
#define SAVEt_COP_ARYBASE 41
#define SAVEt_RE_STATE 42
-#define SAVEt_COP_WARNINGS 43
+#define SAVEt_COMPILE_WARNINGS 43
#ifndef SCOPE_SAVES_SIGNAL_MASK
#define SCOPE_SAVES_SIGNAL_MASK 0
could have done savefreesharedpvREF, but this way actually seems cleaner,
as it simplifies the code that does the saves, and reduces the load on the
save stack. */
-#define SAVECOPWARNINGS(c) \
+#define SAVECOMPILEWARNINGS() \
STMT_START { \
- SSCHECK(3); \
- SSPUSHPTR((c)->cop_warnings); \
- SSPUSHPTR(c); \
- SSPUSHINT(SAVEt_COP_WARNINGS); \
+ SSCHECK(2); \
+ SSPUSHPTR(PL_compiling.cop_warnings); \
+ SSPUSHINT(SAVEt_COMPILE_WARNINGS); \
} STMT_END
#ifdef USE_ITHREADS
#endif
break;
}
- case SAVEt_COP_WARNINGS:
- {
- void *optr = POPPTR(ss,ix);
- TOPPTR(nss,ix) = ptr = any_dup(optr, proto_perl);
- if (ptr != optr) {
- /* We duped something in the interpreter structure. */
- ptr = POPPTR(ss,ix);
- TOPPTR(nss,ix) = DUP_WARNINGS((STRLEN*)ptr);
- } else {
- /* I don't think that this happens, but it would mean that
- we (didn't) dup something shared. */
- ptr = POPPTR(ss,ix);
- TOPPTR(nss,ix) = ptr;
- }
- }
+ case SAVEt_COMPILE_WARNINGS:
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = DUP_WARNINGS((STRLEN*)ptr);
break;
default:
Perl_croak(aTHX_ "panic: ss_dup inconsistency (%"IVdf")", (IV) i);