diff options
author | Karl Williamson <public@khwilliamson.com> | 2010-09-15 10:39:34 -0600 |
---|---|---|
committer | Florian Ragwitz <rafl@debian.org> | 2010-09-15 19:29:38 +0200 |
commit | 595598ee1f247e72e06e4cfbe0f98406015df5cc (patch) | |
tree | 0a64c52ba10b45cc0d7e08bb63837ba99659d6d9 /regcomp.c | |
parent | ad4e703e577a4db278c9a482f9057a9c9109c720 (diff) | |
download | perl-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |