Perl_croak(aTHX_ "Can't upgrade that kind of scalar");
}
+ SvFLAGS(sv) &= ~SVTYPEMASK;
+ SvFLAGS(sv) |= mt;
+
switch (mt) {
case SVt_NULL:
Perl_croak(aTHX_ "Can't upgrade to undef");
IoPAGE_LEN(sv) = 60;
break;
}
- SvFLAGS(sv) &= ~SVTYPEMASK;
- SvFLAGS(sv) |= mt;
return TRUE;
}
#define SvLENx(sv) SvLEN(sv)
#define SvEND(sv)(((XPV*) SvANY(sv))->xpv_pv + ((XPV*)SvANY(sv))->xpv_cur)
#define SvENDx(sv) ((PL_Sv = (sv)), SvEND(PL_Sv))
+
+#ifdef DEBUGGING
+#define SvMAGIC(sv) ((assert(SvTYPE(sv) >= SVt_PVMG)), ((XPVMG*) SvANY(sv))->xmg_magic)
+#define SvSTASH(sv) ((XPVMG*) SvANY(sv))->xmg_stash
+#else
#define SvMAGIC(sv) ((XPVMG*) SvANY(sv))->xmg_magic
#define SvSTASH(sv) ((XPVMG*) SvANY(sv))->xmg_stash
+#endif
/* Ask a scalar nicely to try to become an IV, if possible.
Not guaranteed to stay returning void */