diff options
author | Yves Orton <demerphq@gmail.com> | 2023-01-19 16:36:05 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-01-20 09:16:20 +0800 |
commit | e6f89d6bdb73975a869c4438cdd3501b8edd9a7e (patch) | |
tree | c1075829a0997b3cf0be397af491019e0750ecf8 /proto.h | |
parent | 82132a33be4e60debf3133ae86185f29f79dc092 (diff) | |
download | perl-e6f89d6bdb73975a869c4438cdd3501b8edd9a7e.tar.gz |
regexec.c - harden internals against missing logical_nparens
We can default a 0 rx->logical_nparens to rx->nparens. If rx->logical_nparens
is zero then either rx->nparens is also zero, or it can be defaulted. This
will fix most re::engine::XXX modules that do not know about the new field,
provided they zero the rx structure during construction. If they don't then
this patch won't hurt anything and we will have to patch them directly.
Also mark re_op_compile() as available to extensions. Marking it as hidden
means that re::engine::PCRE2 and others cannot build.
This patch should go a long way towards fixing issue #20710.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -3616,8 +3616,7 @@ Perl_re_intuit_string(pTHX_ REGEXP * const r); 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, bool *is_bare_re, const U32 rx_flags, const U32 pm_flags) - __attribute__visibility__("hidden"); +Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count, OP *expr, const regexp_engine *eng, REGEXP *old_re, bool *is_bare_re, const U32 rx_flags, const U32 pm_flags); #define PERL_ARGS_ASSERT_RE_OP_COMPILE \ assert(eng) |