summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-07-08 18:47:35 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-07-08 18:47:35 +0000
commit51371543ca1a75ed152020ad0846b5b8cf11c32f (patch)
tree9bfd9a21697b0769e2681483631c742642dd8c45 /regexec.c
parent4d61ec052de5c3a91dc64c80c032c2cbec44d845 (diff)
downloadperl-51371543ca1a75ed152020ad0846b5b8cf11c32f.tar.gz
more PERL_OBJECT cleanups (changes still untested on Unix!)
p4raw-id: //depot/perl@3660
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c47
1 files changed, 28 insertions, 19 deletions
diff --git a/regexec.c b/regexec.c
index 58d6af9c85..286131ac95 100644
--- a/regexec.c
+++ b/regexec.c
@@ -110,6 +110,9 @@
#define HOPc(pos,off) ((char*)HOP(pos,off))
#define HOPMAYBEc(pos,off) ((char*)HOPMAYBE(pos,off))
+static void restore_pos(pTHXo_ void *arg);
+
+
STATIC CHECKPOINT
S_regcppush(pTHX_ I32 parenfloor)
{
@@ -243,22 +246,6 @@ S_cache_re(pTHX_ regexp *prog)
PL_reg_re = prog;
}
-STATIC void
-S_restore_pos(pTHX_ void *arg)
-{
- dTHR;
- if (PL_reg_eval_set) {
- if (PL_reg_oldsaved) {
- PL_reg_re->subbeg = PL_reg_oldsaved;
- PL_reg_re->sublen = PL_reg_oldsavedlen;
- RX_MATCH_COPIED_on(PL_reg_re);
- }
- PL_reg_magic->mg_len = PL_reg_oldpos;
- PL_reg_eval_set = 0;
- PL_curpm = PL_reg_oldcurpm;
- }
-}
-
/*
* Need to implement the following flags for reg_anch:
*
@@ -2022,7 +2009,7 @@ got_it:
sv_setsv(oreplsv, GvSV(PL_replgv));/* So that when GvSV(replgv) is
restored, the value remains
the same. */
- restore_pos(0);
+ restore_pos(aTHXo_ 0);
}
/* make sure $`, $&, $', and $digit will work later */
@@ -2049,7 +2036,7 @@ got_it:
phooey:
if (PL_reg_eval_set)
- restore_pos(0);
+ restore_pos(aTHXo_ 0);
return 0;
}
@@ -2098,7 +2085,7 @@ S_regtry(pTHX_ regexp *prog, char *startpos)
}
PL_reg_magic = mg;
PL_reg_oldpos = mg->mg_len;
- SAVEDESTRUCTOR(S_restore_pos, 0);
+ SAVEDESTRUCTOR(restore_pos, 0);
}
if (!PL_reg_curpm)
New(22,PL_reg_curpm, 1, PMOP);
@@ -4455,3 +4442,25 @@ S_reghopmaybe(pTHX_ U8* s, I32 off)
}
return s;
}
+
+#ifdef PERL_OBJECT
+#define NO_XSLOCKS
+#include "XSUB.h"
+#endif
+
+static void
+restore_pos(pTHXo_ void *arg)
+{
+ dTHR;
+ if (PL_reg_eval_set) {
+ if (PL_reg_oldsaved) {
+ PL_reg_re->subbeg = PL_reg_oldsaved;
+ PL_reg_re->sublen = PL_reg_oldsavedlen;
+ RX_MATCH_COPIED_on(PL_reg_re);
+ }
+ PL_reg_magic->mg_len = PL_reg_oldpos;
+ PL_reg_eval_set = 0;
+ PL_curpm = PL_reg_oldcurpm;
+ }
+}
+