p4raw-id: //depot/perl@22935
*/
if (cname) {
- /* Do not use sv_upgrade to preserve STASH */
- SvFLAGS(rv) &= ~SVTYPEMASK;
- SvFLAGS(rv) |= SVt_RV;
+ /* No need to do anything, as rv will already be PVMG. */
+ assert (SvTYPE(rv) >= SVt_RV);
} else {
sv_upgrade(rv, SVt_RV);
}
#ifdef DEBUGGING
#define SvMAGIC(sv) ((assert(SvTYPE(sv) >= SVt_PVMG)), ((XPVMG*) SvANY(sv))->xmg_magic)
-#define SvSTASH(sv) ((XPVMG*) SvANY(sv))->xmg_stash
+#define SvSTASH(sv) ((assert(SvTYPE(sv) >= SVt_PVMG)), (XPVMG*) SvANY(sv))->xmg_stash
#else
#define SvMAGIC(sv) ((XPVMG*) SvANY(sv))->xmg_magic
#define SvSTASH(sv) ((XPVMG*) SvANY(sv))->xmg_stash