#define POPSUB(cx,sv) \
STMT_START { \
- RETURN_PROBE(GvENAME(CvGV((CV*)cx->blk_sub.cv)), \
- CopFILE((COP*)CvSTART((CV*)cx->blk_sub.cv)), \
- CopLINE((COP*)CvSTART((CV*)cx->blk_sub.cv))); \
+ RETURN_PROBE(GvENAME(CvGV((const CV*)cx->blk_sub.cv)), \
+ CopFILE((COP*)CvSTART((const CV*)cx->blk_sub.cv)), \
+ CopLINE((COP*)CvSTART((const CV*)cx->blk_sub.cv))); \
\
if (CxHASARGS(cx)) { \
POP_SAVEARRAY(); \
} \
} \
sv = MUTABLE_SV(cx->blk_sub.cv); \
- if (sv && (CvDEPTH((CV*)sv) = cx->blk_sub.olddepth)) \
+ if (sv && (CvDEPTH((const CV*)sv) = cx->blk_sub.olddepth)) \
sv = NULL; \
} STMT_END
# define Nullcv Null(CV*)
#endif
-#define CvSTASH(sv) ((XPVCV*)SvANY(sv))->xcv_stash
-#define CvSTART(sv) ((XPVCV*)SvANY(sv))->xcv_start_u.xcv_start
-#define CvROOT(sv) ((XPVCV*)SvANY(sv))->xcv_root_u.xcv_root
-#define CvXSUB(sv) ((XPVCV*)SvANY(sv))->xcv_root_u.xcv_xsub
-#define CvXSUBANY(sv) ((XPVCV*)SvANY(sv))->xcv_start_u.xcv_xsubany
-#define CvGV(sv) ((XPVCV*)SvANY(sv))->xcv_gv
-#define CvFILE(sv) ((XPVCV*)SvANY(sv))->xcv_file
+#define CvSTASH(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_stash
+#define CvSTART(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_start_u.xcv_start
+#define CvROOT(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_root_u.xcv_root
+#define CvXSUB(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_root_u.xcv_xsub
+#define CvXSUBANY(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_start_u.xcv_xsubany
+#define CvGV(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_gv
+#define CvFILE(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_file
#ifdef USE_ITHREADS
# define CvFILE_set_from_cop(sv, cop) (CvFILE(sv) = savepv(CopFILE(cop)))
#else
#endif
#define CvFILEGV(sv) (gv_fetchfile(CvFILE(sv)))
#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
-# define CvDEPTH(sv) (*({const CV *_cvdepth = (CV *)sv; \
+# define CvDEPTH(sv) (*({const CV *const _cvdepth = (const CV *)sv; \
assert(SvTYPE(_cvdepth) == SVt_PVCV); \
&((XPVCV*)SvANY(_cvdepth))->xiv_u.xivu_i32; \
}))
#else
-# define CvDEPTH(sv) ((XPVCV*)SvANY(sv))->xiv_u.xivu_i32
+# define CvDEPTH(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xiv_u.xivu_i32
#endif
-#define CvPADLIST(sv) ((XPVCV*)SvANY(sv))->xcv_padlist
-#define CvOUTSIDE(sv) ((XPVCV*)SvANY(sv))->xcv_outside
-#define CvFLAGS(sv) ((XPVCV*)SvANY(sv))->xcv_flags
-#define CvOUTSIDE_SEQ(sv) ((XPVCV*)SvANY(sv))->xcv_outside_seq
+#define CvPADLIST(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_padlist
+#define CvOUTSIDE(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_outside
+#define CvFLAGS(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_flags
+#define CvOUTSIDE_SEQ(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_outside_seq
#define CVf_METHOD 0x0001 /* CV is explicitly marked as a method */
#define CVf_LOCKED 0x0002 /* CV locks itself or first arg on entry */