STATIC void
save_magic(I32 mgs_ix, SV *sv)
{
+ dTHR;
MGS* mgs;
assert(SvMAGICAL(sv));
STATIC void
restore_magic(void *p)
{
+ dTHR;
MGS* mgs = SSPTR((I32)p, MGS*);
SV* sv = mgs->mgs_sv;
*/
if (PL_savestack_ix == mgs->mgs_ss_ix)
{
- assert(SSPOPINT == SAVEt_DESTRUCTOR);
+ I32 popval = SSPOPINT;
+ assert(popval == SAVEt_DESTRUCTOR);
PL_savestack_ix -= 2;
- assert(SSPOPINT == SAVEt_ALLOC);
- PL_savestack_ix -= SSPOPINT;
+ popval = SSPOPINT;
+ assert(popval == SAVEt_ALLOC);
+ popval = SSPOPINT;
+ PL_savestack_ix -= popval;
}
}
int
mg_get(SV *sv)
{
+ dTHR;
I32 mgs_ix;
MAGIC* mg;
MAGIC** mgp;
int
mg_set(SV *sv)
{
+ dTHR;
I32 mgs_ix;
MAGIC* mg;
MAGIC* nextmg;
break;
case '\002': /* ^B */
/* printf("magic_get $^B: ") ; */
- if (curcop->cop_warnings == WARN_NONE)
+ if (PL_curcop->cop_warnings == WARN_NONE)
/* printf("WARN_NONE\n"), */
sv_setpvn(sv, WARN_NONEstring, WARNsize) ;
- else if (curcop->cop_warnings == WARN_ALL)
+ else if (PL_curcop->cop_warnings == WARN_ALL)
/* printf("WARN_ALL\n"), */
sv_setpvn(sv, WARN_ALLstring, WARNsize) ;
else
- /* printf("some %s\n", printW(curcop->cop_warnings)), */
- sv_setsv(sv, curcop->cop_warnings);
+ /* printf("some %s\n", printW(PL_curcop->cop_warnings)), */
+ sv_setsv(sv, PL_curcop->cop_warnings);
break;
case '\004': /* ^D */
sv_setiv(sv, (IV)(PL_debug & 32767));
sv_setnv(sv, (double)errno);
sv_setpv(sv, errno ? Strerror(errno) : "");
} else {
- if (errno != errno_isOS2)
- Perl_rc = _syserrno();
+ if (errno != errno_isOS2) {
+ int tmp = _syserrno();
+ if (tmp) /* 2nd call to _syserrno() makes it 0 */
+ Perl_rc = tmp;
+ }
sv_setnv(sv, (double)Perl_rc);
sv_setpv(sv, os2error(Perl_rc));
}
case '\002': /* ^B */
if ( ! (PL_dowarn & G_WARN_ALL_MASK)) {
if (memEQ(SvPVX(sv), WARN_ALLstring, WARNsize))
- compiling.cop_warnings = WARN_ALL;
+ PL_compiling.cop_warnings = WARN_ALL;
else if (memEQ(SvPVX(sv), WARN_NONEstring, WARNsize))
- compiling.cop_warnings = WARN_NONE;
+ PL_compiling.cop_warnings = WARN_NONE;
else {
- if (compiling.cop_warnings != WARN_NONE &&
- compiling.cop_warnings != WARN_ALL)
- sv_setsv(compiling.cop_warnings, sv);
+ if (PL_compiling.cop_warnings != WARN_NONE &&
+ PL_compiling.cop_warnings != WARN_ALL)
+ sv_setsv(PL_compiling.cop_warnings, sv);
else
- compiling.cop_warnings = newSVsv(sv) ;
+ PL_compiling.cop_warnings = newSVsv(sv) ;
}
}
break;