summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-11-18 14:48:49 +0000
committerDavid Mitchell <davem@iabyn.com>2012-06-13 13:32:45 +0100
commit6ae44cd27f5f18bfa72c8d5ea352083cea44b3bc (patch)
tree54f7f19314f30c3483fb313cff81934902643ac3 /proto.h
parent2bd8e0da284e556e0ebae220a2fa52570cd96ca3 (diff)
downloadperl-6ae44cd27f5f18bfa72c8d5ea352083cea44b3bc.tar.gz
"don't recompile pattern" check: account for UTF8
When recompiling a pattern (e.g. for $x (x,y) { /$x/ }), it tests whether the new pattern string matches the old one, and if so skips recompiling it. However, it doesn't take account of the UTF8ness of the old and new patterns, so can falsely skip recompiling. Now fixed. Also, there is a feature in re_op_compile() that may abort a pattern compilation, upgrade the pattern to UTF8, then begin the compile again. I've added a second check for whether the pattern matches the old pattern, against the upgraded string. I can't see a way to test this, since its just an optimisation. Arguably I could add a BEGIN in an embedded code block to see if it gets compiled twice, but soon I'm going to make it so that embedded code blocks always get recompiled anyway.
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/proto.h b/proto.h
index ccab428804..3db372433d 100644
--- a/proto.h
+++ b/proto.h
@@ -3150,7 +3150,7 @@ PERL_CALLCONV SV* Perl_re_intuit_string(pTHX_ REGEXP *const r)
#define PERL_ARGS_ASSERT_RE_INTUIT_STRING \
assert(r)
-PERL_CALLCONV REGEXP* Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count, OP *expr, const regexp_engine* eng, REGEXP *old_re, int *is_bare_re, U32 flags);
+PERL_CALLCONV REGEXP* Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count, OP *expr, const regexp_engine* eng, REGEXP *VOL old_re, int *is_bare_re, U32 flags);
PERL_CALLCONV Malloc_t Perl_realloc(Malloc_t where, MEM_SIZE nbytes)
__attribute__malloc__
__attribute__warn_unused_result__;