summaryrefslogtreecommitdiff
path: root/embed.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-04-02 19:03:55 +0000
committerNicholas Clark <nick@ccl4.org>2007-04-02 19:03:55 +0000
commitf1fac472816f68ec1eac2f84892d78b65a4598fb (patch)
tree5cdd155ab3819ec7d264f9e5b5d12af70460adf4 /embed.h
parent73c71df6a9051c0d8926b8aae2d513c596501d60 (diff)
downloadperl-f1fac472816f68ec1eac2f84892d78b65a4598fb.tar.gz
Add a new compile option PERL_DEBUG_READONLY_OPS which marks the optree
as read only (or as much of it as it practical). This makes it trivial to detect buggy code that is modifying the optree at runtime. p4raw-id: //depot/perl@30829
Diffstat (limited to 'embed.h')
-rw-r--r--embed.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/embed.h b/embed.h
index 9228e7ba28..0c52f84063 100644
--- a/embed.h
+++ b/embed.h
@@ -1217,6 +1217,13 @@
#if defined(PL_OP_SLAB_ALLOC)
#define Slab_Alloc Perl_Slab_Alloc
#define Slab_Free Perl_Slab_Free
+# if defined(PERL_DEBUG_READONLY_OPS)
+# if defined(PERL_IN_OP_C)
+#ifdef PERL_CORE
+#define Slab_to_rw S_Slab_to_rw
+#endif
+# endif
+# endif
#endif
#if defined(PERL_IN_PERL_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
@@ -3446,6 +3453,15 @@
#if defined(PL_OP_SLAB_ALLOC)
#define Slab_Alloc(a,b) Perl_Slab_Alloc(aTHX_ a,b)
#define Slab_Free(a) Perl_Slab_Free(aTHX_ a)
+# if defined(PERL_DEBUG_READONLY_OPS)
+#ifdef PERL_CORE
+#endif
+# if defined(PERL_IN_OP_C)
+#ifdef PERL_CORE
+#define Slab_to_rw(a) S_Slab_to_rw(aTHX_ a)
+#endif
+# endif
+# endif
#endif
#if defined(PERL_IN_PERL_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE