This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
It seems that the strange failure (core dump) of
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 21 Mar 2002 20:19:31 +0000 (20:19 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 21 Mar 2002 20:19:31 +0000 (20:19 +0000)
t/uni/fold.t on ithreads Solaris builds is a gcc bug:
(1) using Sun's cc helps
(2) rewriting the ithreads PM_SETRE() to do the
    setting in two steps helps
(3) no other platforms have the crash
(4) Tru64's Third Degree sees nothing evil
So we implement (2).

p4raw-id: //depot/perl@15400

op.h

diff --git a/op.h b/op.h
index 5c6a78f..69e7ddf 100644 (file)
--- a/op.h
+++ b/op.h
@@ -263,7 +263,7 @@ struct pmop {
 
 #ifdef USE_ITHREADS
 #define PM_GETRE(o)     (INT2PTR(REGEXP*,SvIVX(PL_regex_pad[(o)->op_pmoffset])))
-#define PM_SETRE(o,r)   (sv_setiv(PL_regex_pad[(o)->op_pmoffset], PTR2IV(r)))
+#define PM_SETRE(o,r)   STMT_START { SV* sv = PL_regex_pad[(o)->op_pmoffset]; sv_setiv(sv, PTR2IV(r)); } STMT_END
 #define PM_GETRE_SAFE(o) (PL_regex_pad ? PM_GETRE(o) : (REGEXP*)0)
 #define PM_SETRE_SAFE(o,r) if (PL_regex_pad) PM_SETRE(o,r)
 #else