summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2006-06-14 16:33:24 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-06-14 14:58:14 +0000
commit8e9a8a487e942a090c791d91c152037724ef47f4 (patch)
tree04dc3aa9c2076b329005619b83ef14f6643a451f
parente68ec53fb89aea41859fe8c109fe9b03a3599284 (diff)
downloadperl-8e9a8a487e942a090c791d91c152037724ef47f4.tar.gz
Re: [PATCH] fix re debug segvs in global destruction, and a tweak to Benchmark to prevent infinite loops. (Re: ext/re/t/regop.pl SEGV)
Message-ID: <9b18b3110606140533k583fdd3bh6c4b292e7ff4cf13@mail.gmail.com> p4raw-id: //depot/perl@28394
-rw-r--r--regcomp.c26
-rw-r--r--regcomp.h6
2 files changed, 15 insertions, 17 deletions
diff --git a/regcomp.c b/regcomp.c
index c1b4dc70f6..4514c19d69 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -3660,6 +3660,18 @@ reStudy:
PerlIO_printf(Perl_debug_log,"Final program:\n");
regdump(r);
});
+ DEBUG_OFFSETS_r(if (r->offsets) {
+ const U32 len = r->offsets[0];
+ U32 i;
+ GET_RE_DEBUG_FLAGS_DECL;
+ PerlIO_printf(Perl_debug_log, "Offsets: [%"UVuf"]\n\t", (UV)r->offsets[0]);
+ for (i = 1; i <= len; i++) {
+ if (r->offsets[i*2-1] || r->offsets[i*2])
+ PerlIO_printf(Perl_debug_log, "%"UVuf":%"UVuf"[%"UVuf"] ",
+ i, (UV)r->offsets[i*2-1], (UV)r->offsets[i*2]);
+ }
+ PerlIO_printf(Perl_debug_log, "\n");
+ });
return(r);
}
@@ -6359,20 +6371,6 @@ Perl_regdump(pTHX_ const regexp *r)
if (r->reganch & ROPT_EVAL_SEEN)
PerlIO_printf(Perl_debug_log, "with eval ");
PerlIO_printf(Perl_debug_log, "\n");
- if (r->offsets) {
- const U32 len = r->offsets[0];
- GET_RE_DEBUG_FLAGS_DECL;
- DEBUG_OFFSETS_r({
- U32 i;
- PerlIO_printf(Perl_debug_log, "Offsets: [%"UVuf"]\n\t", (UV)r->offsets[0]);
- for (i = 1; i <= len; i++) {
- if (r->offsets[i*2-1] || r->offsets[i*2])
- PerlIO_printf(Perl_debug_log, "%"UVuf":%"UVuf"[%"UVuf"] ",
- i, (UV)r->offsets[i*2-1], (UV)r->offsets[i*2]);
- }
- PerlIO_printf(Perl_debug_log, "\n");
- });
- }
#else
PERL_UNUSED_CONTEXT;
PERL_UNUSED_ARG(r);
diff --git a/regcomp.h b/regcomp.h
index 84a0e5027f..c81c2864b6 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -616,14 +616,14 @@ re.pm, especially to the documentation.
SV * re_debug_flags_sv = NULL; \
re_debug_flags_sv = get_sv(RE_DEBUG_FLAGS, 1); \
if (re_debug_flags_sv) { \
- if (!SvUOK(re_debug_flags_sv)) \
+ if (!SvIOK(re_debug_flags_sv)) \
sv_setuv(re_debug_flags_sv, RE_DEBUG_COMPILE_DUMP | RE_DEBUG_EXECUTE_MASK ); \
- re_debug_flags=SvUV(re_debug_flags_sv); \
+ re_debug_flags=SvIV(re_debug_flags_sv); \
}\
})
#ifdef DEBUGGING
-#define GET_RE_DEBUG_FLAGS_DECL UV re_debug_flags = 0; GET_RE_DEBUG_FLAGS;
+#define GET_RE_DEBUG_FLAGS_DECL IV re_debug_flags = 0; GET_RE_DEBUG_FLAGS;
#else
#define GET_RE_DEBUG_FLAGS_DECL
#endif