summaryrefslogtreecommitdiff
path: root/regcomp.h
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.h
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.h')
-rw-r--r--regcomp.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/regcomp.h b/regcomp.h
index 1ef9d2daee..362a8ed0bd 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -767,9 +767,11 @@ re.pm, especially to the documentation.
if (re_debug_flags & RE_DEBUG_EXTRA_GPOS) x )
/* initialization */
-/* get_sv() can return NULL during global destruction. */
+/* get_sv() can return NULL during global destruction. re_debug_flags can get
+ * clobbered by a longjmp, so must be initialized */
#define GET_RE_DEBUG_FLAGS DEBUG_r({ \
SV * re_debug_flags_sv = NULL; \
+ re_debug_flags = 0; \
re_debug_flags_sv = get_sv(RE_DEBUG_FLAGS, 1); \
if (re_debug_flags_sv) { \
if (!SvIOK(re_debug_flags_sv)) \