develooper Front page | perl.perl5.porters | Postings from July 2001

[PATCH] fix for PMOP threadness failures

From:
Artur Bergman
Date:
July 12, 2001 00:48
Subject:
[PATCH] fix for PMOP threadness failures
Message ID:
B77322D6.22DD%artur@contiller.se
Here it is, I realy dislike this PL_reg_curpm thingy. Fixes all the known
segfaults. Only problem left is the apperent dislike of the PM_SETRE macro
by borland.

Lesson learnt for me, always do perl harness since make test does not
capture segfaults.

Leak fixes coming up later during the day.

--- perl-copy/regexec.c    Wed Jul 11 22:50:52 2001
+++ perl/regexec.c    Thu Jul 12 08:31:57 2001
@@ -1850,8 +1850,17 @@
             PL_reg_oldpos   = mg->mg_len;
             SAVEDESTRUCTOR_X(restore_pos, 0);
         }
-        if (!PL_reg_curpm)
+        if (!PL_reg_curpm) {
             Newz(22,PL_reg_curpm, 1, PMOP);
+#ifdef USE_ITHREADS
+            {
+                SV* repointer = newSViv(0);
+                av_push(PL_regex_padav,repointer);
+                PL_reg_curpm->op_pmoffset = av_len(PL_regex_padav);
+                PL_regex_pad = AvARRAY(PL_regex_padav);
+            }
+#endif      
+        }
         PM_SETRE(PL_reg_curpm, prog);
         PL_reg_oldcurpm = PL_curpm;
         PL_curpm = PL_reg_curpm;




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About