Re: Named-capture regex syntax
[p5sagit/p5-mst-13.2.git] / op.h
diff --git a/op.h b/op.h
index e3596b5..d2369df 100644 (file)
--- a/op.h
+++ b/op.h
  *     op_static       Whether or not the op is statically defined.
  *                     This flag is used by the B::C compiler backend
  *                     and indicates that the op should not be freed.
- *     op_spare        Five spare bits!
+ *     op_latefree     tell op_free() to clear this op (and free any kids)
+ *                     but not yet deallocate the struct. This means that
+ *                     the op may be safely op_free()d multiple times
+ *     op_latefreed    an op_latefree op has been op_free()d
+ *     op_spare        three spare bits!
  *     op_flags        Flags common to all operations.  See OPf_* below.
  *     op_private      Flags peculiar to a particular operation (BUT,
  *                     by default, set to the number of children until
@@ -54,7 +58,9 @@
     unsigned   op_type:9;              \
     unsigned   op_opt:1;               \
     unsigned   op_static:1;            \
-    unsigned   op_spare:5;             \
+    unsigned   op_latefree:1;          \
+    unsigned   op_latefreed:1;         \
+    unsigned   op_spare:3;             \
     U8         op_flags;               \
     U8         op_private;
 #endif
@@ -454,7 +460,8 @@ struct loop {
 
 #ifdef USE_ITHREADS
 #  define      cGVOPx_gv(o)    ((GV*)PAD_SVl(cPADOPx(o)->op_padix))
-#  define      IS_PADGV(v)     (v && SvTYPE(v) == SVt_PVGV && GvIN_PAD(v))
+#  define      IS_PADGV(v)     (v && SvTYPE(v) == SVt_PVGV && isGV_with_GP(v) \
+                                && GvIN_PAD(v))
 #  define      IS_PADCONST(v)  (v && SvREADONLY(v))
 #  define      cSVOPx_sv(v)    (cSVOPx(v)->op_sv \
                                 ? cSVOPx(v)->op_sv : PAD_SVl((v)->op_targ))