summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2010-09-15 10:39:34 -0600
committerFlorian Ragwitz <rafl@debian.org>2010-09-15 19:29:38 +0200
commit595598ee1f247e72e06e4cfbe0f98406015df5cc (patch)
tree0a64c52ba10b45cc0d7e08bb63837ba99659d6d9 /regcomp.c
parentad4e703e577a4db278c9a482f9057a9c9109c720 (diff)
downloadperl-595598ee1f247e72e06e4cfbe0f98406015df5cc.tar.gz
PATCH: regex longjmp flaws
The netbsd - 5.0.2 compiler pointed out that the recent changes to add longjmps to speed up some regex compilations can result in clobbering a few values. These depend on the compiled code, and so didn't show up in other compiler's warnings. This patch reinitializes them after a longjmp.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index 2ad4df9e7a..13f82e2496 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -4317,6 +4317,8 @@ Perl_re_compile(pTHX_ SV * const pattern, U32 pm_flags)
JMPENV_JUMP(jump_ret);
}
+ GET_RE_DEBUG_FLAGS;
+
/* It's possible to write a regexp in ascii that represents Unicode
codepoints outside of the byte range, such as via \x{100}. If we
detect such a sequence we have to convert the entire pattern to utf8
@@ -4327,7 +4329,7 @@ Perl_re_compile(pTHX_ SV * const pattern, U32 pm_flags)
-- dmq */
DEBUG_PARSE_r(PerlIO_printf(Perl_debug_log,
"UTF8 mismatch! Converting to utf8 for resizing and compile\n"));
- exp = (char*)Perl_bytes_to_utf8(aTHX_ (U8*)exp, &len);
+ exp = (char*)Perl_bytes_to_utf8(aTHX_ (U8*)SvPV(pattern, plen), &len);
xend = exp + len;
RExC_orig_utf8 = RExC_utf8 = 1;
SAVEFREEPV(exp);