summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
Diffstat (limited to 'op.h')
-rw-r--r--op.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/op.h b/op.h
index 95ecf87ecc..5231a4131c 100644
--- a/op.h
+++ b/op.h
@@ -305,25 +305,28 @@ struct loop {
#ifdef USE_ITHREADS
-# define cGVOPx(o) ((GV*)PAD_SV(cPADOPx(o)->op_padix))
-# define cGVOP ((GV*)PAD_SV(cPADOP->op_padix))
-# define cGVOPo ((GV*)PAD_SV(cPADOPo->op_padix))
-# define kGVOP ((GV*)PAD_SV(kPADOP->op_padix))
-# define cGVOP_set(v) (PL_curpad[cPADOP->op_padix] = (SV*)(v))
-# define cGVOPo_set(v) (PL_curpad[cPADOPo->op_padix] = (SV*)(v))
-# define kGVOP_set(v) (PL_curpad[kPADOP->op_padix] = (SV*)(v))
+# define cGVOPx_gv(o) ((GV*)PL_curpad[cPADOPx(o)->op_padix])
# define IS_PADGV(v) (v && SvTYPE(v) == SVt_PVGV && GvIN_PAD(v))
+# define IS_PADCONST(v) (v && SvREADONLY(v))
+# define cSVOPx_sv(v) (cSVOPx(v)->op_sv \
+ ? cSVOPx(v)->op_sv : PL_curpad[(v)->op_targ])
+# define cSVOPx_svp(v) (cSVOPx(v)->op_sv \
+ ? &cSVOPx(v)->op_sv : &PL_curpad[(v)->op_targ])
#else
-# define cGVOPx(o) ((GV*)cSVOPx(o)->op_sv)
-# define cGVOP ((GV*)cSVOP->op_sv)
-# define cGVOPo ((GV*)cSVOPo->op_sv)
-# define kGVOP ((GV*)kSVOP->op_sv)
-# define cGVOP_set(v) (cPADOP->op_sv = (SV*)(v))
-# define cGVOPo_set(v) (cPADOPo->op_sv = (SV*)(v))
-# define kGVOP_set(v) (kPADOP->op_sv = (SV*)(v))
+# define cGVOPx_gv(o) ((GV*)cSVOPx(o)->op_sv)
# define IS_PADGV(v) FALSE
+# define IS_PADCONST(v) FALSE
+# define cSVOPx_sv(v) (cSVOPx(v)->op_sv)
+# define cSVOPx_svp(v) (&cSVOPx(v)->op_sv)
#endif
+#define cGVOP_gv cGVOPx_gv(PL_op)
+#define cGVOPo_gv cGVOPx_gv(o)
+#define kGVOP_gv cGVOPx_gv(kid)
+#define cSVOP_sv cSVOPx_sv(PL_op)
+#define cSVOPo_sv cSVOPx_sv(o)
+#define kSVOP_sv cSVOPx_sv(kid)
+
#define Nullop Null(OP*)
/* Lowest byte of PL_opargs */