This is a live mirror of the Perl 5 development currently hosted at
[perl #121983] #error with ro ops and no threads
authorFather Chrysostomos <>
Sat, 20 Sep 2014 07:43:28 +0000 (00:43 -0700)
committerFather Chrysostomos <>
Sat, 20 Sep 2014 14:43:24 +0000 (07:43 -0700)
PERL_DEBUG_READONLY_OPS is designed to catch modifications of op trees
at run time, to make sure that perl is doing things safely under
threads.  (Op trees are shared between threads.)

On non-threaded perls, ops are modified regularly, which is perfectly
safe, so PERL_DEBUG_READONLY_OPS does not make any sense, and is guar-
anteed to crash.

Forcing a compilation error with cpp directives makes it obvious that
it is not intended for this PERL_DEBUG_READONLY_OPS mode to work with-


diff --git a/perl.h b/perl.h
index d711b20..5615b96 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -2663,6 +2663,10 @@ typedef SV PADNAME;
+#if defined(PERL_DEBUG_READONLY_OPS) && !defined(USE_ITHREADS)
+# error PERL_DEBUG_READONLY_OPS only works with ithreads
 #include "handy.h"
 #if defined(USE_LARGE_FILES) && !defined(NO_64_BIT_RAWIO)