--- pcre2-10.34.orig/ChangeLog +++ pcre2-10.34/ChangeLog @@ -1,6 +1,12 @@ Change Log for PCRE2 -------------------- +23. Fixed a unicode properrty matching issue in JIT. The character was not +fully read in caseless matching. + +24. Fixed an issue affecting recursions in JIT caused by duplicated data +transfers. + Version 10.34 21-November-2019 ------------------------------ --- pcre2-10.34.orig/debian/README.Debian +++ pcre2-10.34/debian/README.Debian @@ -0,0 +1,12 @@ + PCRE2 for Debian + ---------------- + +This is PCRE2, the newer version of the PCRE (perl-compatible regular +expression) library. New projects should use this library in +preference the older PCRE library (which is, for historical reasons, +called pcre3 in Debian). + +The names of functions in libpcre2-posix are prefixed with PCRE2_, so +they don't clash with the names in libc. + + -- Matthew Vernon , Sun, 22 Nov 2015 16:07:27 +0000 --- pcre2-10.34.orig/debian/README.source +++ pcre2-10.34/debian/README.source @@ -0,0 +1,17 @@ +The Debian packaging of pcre2 is maintained in git, using the merging +workflow described in dgit-maint-merge(7). There isn't a patch +queue that can be represented as a quilt series. + +A detailed breakdown of the changes is available from their +canonical representation - git commits in the packaging repository. +For example, to see the changes made by the Debian maintainer in +the first upload of upstream version 1.2.3, you could use: + + % git clone https://git.dgit.debian.org/pcre2 + % cd pcre2 + % git log --oneline 1.2.3..debian/1.2.3-1 -- . ':!debian' + +(If you have dgit, use `dgit clone pcre2`, rather than plain `git +clone`.) + + -- Matthew Vernon , Thu, 30 Nov 2017 14:16:33 +0000 --- pcre2-10.34.orig/debian/changelog +++ pcre2-10.34/debian/changelog @@ -0,0 +1,184 @@ +pcre2 (10.34-7ubuntu0.1) focal-security; urgency=medium + + * SECURITY UPDATE: out-of-bounds read in pcre2_jit_compile + - Fix a unicode property matching issue and an incorrect + value reading in JIT in src/pcre2_jit_compile.c and + src/pcre2_jit_test.c. + - Fix a recursions issue in JIT caused by duplicated + data transfers in src/pcre2_jit_compile.c and + src/pcre2_jit_test.c. + - CVE-2022-1586 + - CVE-2022-1587 + + -- David Fernandez Gonzalez Tue, 20 Sep 2022 12:46:40 +0200 + +pcre2 (10.34-7) unstable; urgency=medium + + * Upstream patch to fix segfault in rspamd (Closes: #946221) + + -- Matthew Vernon Sat, 07 Dec 2019 17:06:59 +0000 + +pcre2 (10.34-6) unstable; urgency=high + + * Replace: and Conflict: the previous libpcre2-posix0 package (which + erroneously had the soname 2 library in) (Closes: #946279, #946290, #946311) + * Can now make a source-only upload now libpcre2-posix2 has made it + through NEW. We need that so we can migrate to testing (Closes: #946275) + + -- Matthew Vernon Sat, 07 Dec 2019 14:34:25 +0000 + +pcre2 (10.34-5) unstable; urgency=medium + + * Sacrifice an integer so I can do a binary upload for the new + libpcre2-posix package name :-( + + -- Matthew Vernon Tue, 03 Dec 2019 21:14:29 +0000 + +pcre2 (10.34-4) unstable; urgency=high + + * Add symbols files (Closes: #945973) + * Update libpcre2-posix name to match soname + + -- Matthew Vernon Tue, 03 Dec 2019 19:20:54 +0000 + +pcre2 (10.34-3) unstable; urgency=medium + + * Remove -dbg package from debian/control as well + + -- Matthew Vernon Mon, 02 Dec 2019 11:58:33 +0000 + +pcre2 (10.34-2) unstable; urgency=high + + * Try an upstream patch to fix an ARM bug (apropos 945972) + * Remove -dbg in favour of -dbgsyms, thanks to Michael Biebl + for the patch (Closes: #891624) + + -- Matthew Vernon Mon, 02 Dec 2019 11:22:32 +0000 + +pcre2 (10.34-1) unstable; urgency=medium + + * New upstream release + + -- Matthew Vernon Thu, 28 Nov 2019 16:28:31 +0000 + +pcre2 (10.32-5) unstable; urgency=high + + * Patch from Guillem Jover to only use SSE2 + instructions on those i386 CPUs that support them (Closes: #925360) + + -- Matthew Vernon Mon, 25 Mar 2019 19:56:19 +0000 + +pcre2 (10.32-4) unstable; urgency=medium + + * Take patch from Jeremy Bicha to build with + --disable-pcre2grep-callout: A grep tool should not be expected to + execute commands (Closes: #920273) (LP: #1636666) + + -- Matthew Vernon Thu, 24 Jan 2019 09:20:51 +0000 + +pcre2 (10.32-3) unstable; urgency=medium + + * Sacrifice an integer to dgit (previous upload didn't work) + + -- Matthew Vernon Sun, 28 Oct 2018 14:19:04 +0000 + +pcre2 (10.32-2) unstable; urgency=medium + + * Take Ondřej Nový's patch to remove redundant Priority field in -dbg + package + + -- Matthew Vernon Fri, 26 Oct 2018 20:01:53 +0100 + +pcre2 (10.32-1) unstable; urgency=medium + + * New upstream release + + -- Matthew Vernon Fri, 26 Oct 2018 19:27:13 +0100 + +pcre2 (10.31-3) unstable; urgency=medium + + * Disable JIT on mips* (apropos #892488) + + -- Matthew Vernon Sat, 10 Mar 2018 00:31:33 +0000 + +pcre2 (10.31-2) unstable; urgency=low + + * Point to salsa repo in vcs* fields + * priority extra -> optional + * Add homepage link in debian/control + * Update to newer standards-version + + -- Matthew Vernon Sat, 24 Feb 2018 14:57:26 +0000 + +pcre2 (10.31-1) unstable; urgency=medium + + * New upstream version (Closes: #883224) + + -- Matthew Vernon Sat, 24 Feb 2018 12:13:02 +0000 + +pcre2 (10.22-6) unstable; urgency=medium + + [ Cyril Brulebois ] + * Add a libpcre2-8-0-udeb, needed by vte2.91 (Closes: #887674) + * Enable parallel building. + + -- Matthew Vernon Sat, 03 Feb 2018 18:44:08 +0000 + +pcre2 (10.22-5) unstable; urgency=medium + + * Add Vcs-{Git,Browser} fields to debian/control + + -- Matthew Vernon Fri, 01 Dec 2017 17:35:06 +0000 + +pcre2 (10.22-4) unstable; urgency=low + + * Add README.source explaining packaging workflow (Closes: #862425) + + -- Matthew Vernon Thu, 30 Nov 2017 14:17:39 +0000 + +pcre2 (10.22-3) unstable; urgency=medium + + * CVE-2017-7186: invalid Unicode property lookup may cause denial of + service (Closes: #858233) + + -- Matthew Vernon Tue, 21 Mar 2017 22:33:58 +0000 + +pcre2 (10.22-2) unstable; urgency=low + + * re-upload with source :-( + + -- Matthew Vernon Tue, 02 Aug 2016 19:27:58 +0100 + +pcre2 (10.22-1) unstable; urgency=low + + * New upstream release + + -- Matthew Vernon Tue, 02 Aug 2016 18:59:19 +0100 + +pcre2 (10.21-1) unstable; urgency=low + + * New upstream version + * Upstream patch to fix workspace overflow for (*ACCEPT) with deeply + nested parentheses (Closes: #815920) + + -- Matthew Vernon Sat, 27 Feb 2016 15:21:34 +0000 + +pcre2 (10.20-3) unstable; urgency=low + + * Enable JIT on ppc64 & ppc64el (Closes: #806388) + + -- Matthew Vernon Fri, 27 Nov 2015 08:16:38 +0000 + +pcre2 (10.20-2) unstable; urgency=low + + * remove unnecessary -L settings (Closes: #805941) + * Improve makefile syntax, and add JIT on arm64 + + -- Matthew Vernon Tue, 24 Nov 2015 20:39:15 +0000 + +pcre2 (10.20-1) unstable; urgency=low + + * Initial debian version (Closes: #805728) + + -- Matthew Vernon Sun, 22 Nov 2015 15:58:38 +0000 + --- pcre2-10.34.orig/debian/compat +++ pcre2-10.34/debian/compat @@ -0,0 +1 @@ +9 --- pcre2-10.34.orig/debian/control +++ pcre2-10.34/debian/control @@ -0,0 +1,112 @@ +Source: pcre2 +Section: libs +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Matthew Vernon +Standards-Version: 4.1.3 +Build-Depends: debhelper (>=9), dpkg-dev (>= 1.16.1~) +Vcs-Git: https://salsa.debian.org/debian/pcre2.git +Vcs-Browser: https://salsa.debian.org/debian/pcre2 +Homepage: https://pcre.org/ + +Package: libpcre2-8-0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Description: New Perl Compatible Regular Expression Library- 8 bit runtime files + This is PCRE2, the new implementation of PCRE, a library of functions + to support regular expressions whose syntax and semantics are as + close as possible to those of the Perl 5 language. New projects + should use this library in preference to the older library, + confusingly called pcre3 in Debian. + . + This package contains the 8 bit runtime library. + +Package: libpcre2-8-0-udeb +Package-Type: udeb +Section: debian-installer +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: New Perl Compatible Regular Expression Library- 8 bit runtime files (udeb) + This package contains the 8 bit runtime library, for the Debian Installer. + +Package: libpcre2-16-0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Description: New Perl Compatible Regular Expression Library - 16 bit runtime files + This is PCRE2, the new implementation of PCRE, a library of functions + to support regular expressions whose syntax and semantics are as + close as possible to those of the Perl 5 language. New projects + should use this library in preference to the older library, + confusingly called pcre3 in Debian. + . + This package contains the 16 bit runtime library. + +Package: libpcre2-32-0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Description: New Perl Compatible Regular Expression Library - 32 bit runtime files + This is PCRE2, the new implementation of PCRE, a library of functions + to support regular expressions whose syntax and semantics are as + close as possible to those of the Perl 5 language. New projects + should use this library in preference to the older library, + confusingly called pcre3 in Debian. + . + This package contains the 32 bit runtime library. + +Package: libpcre2-posix2 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Replaces: libpcre2-posix0 +Conflicts: libpcre2-posix0 +Description: New Perl Compatible Regular Expression Library - posix-compatible runtime files + This is PCRE2, the new implementation of PCRE, a library of functions + to support regular expressions whose syntax and semantics are as + close as possible to those of the Perl 5 language. New projects + should use this library in preference to the older library, + confusingly called pcre3 in Debian. + . + This package contains the runtime library for the posix-compatible API. + +Package: libpcre2-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Conflicts: libpcre3-dev (<<2:8.35-8) +Depends: libc6-dev, libpcre2-8-0 (= ${binary:Version}), libpcre2-16-0 (= ${binary:Version}), libpcre2-32-0 (= ${binary:Version}), libpcre2-posix2 (= ${binary:Version}), ${misc:Depends} +Description: New Perl Compatible Regular Expression Library - development files + This is PCRE2, the new implementation of PCRE, a library of functions + to support regular expressions whose syntax and semantics are as + close as possible to those of the Perl 5 language. New projects + should use this library in preference to the older library, + confusingly called pcre3 in Debian. + . + This package contains the development files, including headers, + static libraries, and documentation. + +Package: pcre2-utils +Section: utils +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: New Perl Compatible Regular Expression Library - utilities + This is PCRE2, the new implementation of PCRE, a library of functions + to support regular expressions whose syntax and semantics are as + close as possible to those of the Perl 5 language. New projects + should use this library in preference to the older library, + confusingly called pcre3 in Debian. + . + This package contains the utilities pcre2grep (like grep with PCRE) + and pcre2test (a test program for the library, but also useful for + experimenting with regular expressions). Both programs are also + useful examples of programming with libpcre2. --- pcre2-10.34.orig/debian/copyright +++ pcre2-10.34/debian/copyright @@ -0,0 +1,87 @@ +This package was debianized by Matthew Vernon , +with sources downloaded from: +ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ + +PCRE2 LICENCE +------------- + +PCRE2 is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + +Release 10 of PCRE2 is distributed under the terms of the "BSD" licence, as +specified below. The documentation for PCRE2, supplied in the "doc" +directory, is distributed under the same terms as the software itself. The data +in the testdata directory is not copyrighted and is in the public domain. + +The basic library functions are written in C and are freestanding. Also +included in the distribution is a just-in-time compiler that can be used to +optimize pattern matching. This is an optional feature that can be omitted when +the library is built. + + +THE BASIC LIBRARY FUNCTIONS +--------------------------- + +Written by: Philip Hazel +Email local part: ph10 +Email domain: cam.ac.uk + +University of Cambridge Computing Service, +Cambridge, England. + +Copyright (c) 1997-2015 University of Cambridge +All rights reserved. + + +PCRE2 JUST-IN-TIME COMPILATION SUPPORT +-------------------------------------- + +Written by: Zoltan Herczeg +Email local part: hzmester +Emain domain: freemail.hu + +Copyright(c) 2010-2015 Zoltan Herczeg +All rights reserved. + + +STACK-LESS JUST-IN-TIME COMPILER +-------------------------------- + +Written by: Zoltan Herczeg +Email local part: hzmester +Emain domain: freemail.hu + +Copyright(c) 2009-2015 Zoltan Herczeg +All rights reserved. + + +THE "BSD" LICENCE +----------------- + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of any + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +End --- pcre2-10.34.orig/debian/gbp.conf +++ pcre2-10.34/debian/gbp.conf @@ -0,0 +1,8 @@ +[DEFAULT] +upstream-branch = upstream +debian-branch = master +upstream-tag = %(version)s + +sign-tags = False +pristine-tar = False +pristine-tar-commit = False --- pcre2-10.34.orig/debian/libpcre2-16-0.install +++ pcre2-10.34/debian/libpcre2-16-0.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/*/libpcre2-16.so.* --- pcre2-10.34.orig/debian/libpcre2-16-0.symbols +++ pcre2-10.34/debian/libpcre2-16-0.symbols @@ -0,0 +1,74 @@ +libpcre2-16.so.0 libpcre2-16-0 #MINVER# + pcre2_callout_enumerate_16@Base 10.22 + pcre2_code_copy_16@Base 10.22 + pcre2_code_copy_with_tables_16@Base 10.32 + pcre2_code_free_16@Base 10.22 + pcre2_compile_16@Base 10.22 + pcre2_compile_context_copy_16@Base 10.22 + pcre2_compile_context_create_16@Base 10.22 + pcre2_compile_context_free_16@Base 10.22 + pcre2_config_16@Base 10.22 + pcre2_convert_context_copy_16@Base 10.32 + pcre2_convert_context_create_16@Base 10.32 + pcre2_convert_context_free_16@Base 10.32 + pcre2_converted_pattern_free_16@Base 10.32 + pcre2_dfa_match_16@Base 10.22 + pcre2_general_context_copy_16@Base 10.22 + pcre2_general_context_create_16@Base 10.22 + pcre2_general_context_free_16@Base 10.22 + pcre2_get_error_message_16@Base 10.22 + pcre2_get_mark_16@Base 10.22 + pcre2_get_match_data_size_16@Base 10.34 + pcre2_get_ovector_count_16@Base 10.22 + pcre2_get_ovector_pointer_16@Base 10.22 + pcre2_get_startchar_16@Base 10.22 + pcre2_jit_compile_16@Base 10.22 + pcre2_jit_free_unused_memory_16@Base 10.22 + pcre2_jit_match_16@Base 10.22 + pcre2_jit_stack_assign_16@Base 10.22 + pcre2_jit_stack_create_16@Base 10.22 + pcre2_jit_stack_free_16@Base 10.22 + pcre2_maketables_16@Base 10.22 + pcre2_maketables_free_16@Base 10.34 + pcre2_match_16@Base 10.22 + pcre2_match_context_copy_16@Base 10.22 + pcre2_match_context_create_16@Base 10.22 + pcre2_match_context_free_16@Base 10.22 + pcre2_match_data_create_16@Base 10.22 + pcre2_match_data_create_from_pattern_16@Base 10.22 + pcre2_match_data_free_16@Base 10.22 + pcre2_pattern_convert_16@Base 10.32 + pcre2_pattern_info_16@Base 10.22 + pcre2_serialize_decode_16@Base 10.22 + pcre2_serialize_encode_16@Base 10.22 + pcre2_serialize_free_16@Base 10.22 + pcre2_serialize_get_number_of_codes_16@Base 10.22 + pcre2_set_bsr_16@Base 10.22 + pcre2_set_callout_16@Base 10.22 + pcre2_set_character_tables_16@Base 10.22 + pcre2_set_compile_extra_options_16@Base 10.32 + pcre2_set_compile_recursion_guard_16@Base 10.22 + pcre2_set_depth_limit_16@Base 10.32 + pcre2_set_glob_escape_16@Base 10.32 + pcre2_set_glob_separator_16@Base 10.32 + pcre2_set_heap_limit_16@Base 10.32 + pcre2_set_match_limit_16@Base 10.22 + pcre2_set_max_pattern_length_16@Base 10.22 + pcre2_set_newline_16@Base 10.22 + pcre2_set_offset_limit_16@Base 10.22 + pcre2_set_parens_nest_limit_16@Base 10.22 + pcre2_set_recursion_limit_16@Base 10.22 + pcre2_set_recursion_memory_management_16@Base 10.22 + pcre2_set_substitute_callout_16@Base 10.34 + pcre2_substitute_16@Base 10.22 + pcre2_substring_copy_byname_16@Base 10.22 + pcre2_substring_copy_bynumber_16@Base 10.22 + pcre2_substring_free_16@Base 10.22 + pcre2_substring_get_byname_16@Base 10.22 + pcre2_substring_get_bynumber_16@Base 10.22 + pcre2_substring_length_byname_16@Base 10.22 + pcre2_substring_length_bynumber_16@Base 10.22 + pcre2_substring_list_free_16@Base 10.22 + pcre2_substring_list_get_16@Base 10.22 + pcre2_substring_nametable_scan_16@Base 10.22 + pcre2_substring_number_from_name_16@Base 10.22 --- pcre2-10.34.orig/debian/libpcre2-32-0.install +++ pcre2-10.34/debian/libpcre2-32-0.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/*/libpcre2-32.so.* --- pcre2-10.34.orig/debian/libpcre2-32-0.symbols +++ pcre2-10.34/debian/libpcre2-32-0.symbols @@ -0,0 +1,74 @@ +libpcre2-32.so.0 libpcre2-32-0 #MINVER# + pcre2_callout_enumerate_32@Base 10.22 + pcre2_code_copy_32@Base 10.22 + pcre2_code_copy_with_tables_32@Base 10.32 + pcre2_code_free_32@Base 10.22 + pcre2_compile_32@Base 10.22 + pcre2_compile_context_copy_32@Base 10.22 + pcre2_compile_context_create_32@Base 10.22 + pcre2_compile_context_free_32@Base 10.22 + pcre2_config_32@Base 10.22 + pcre2_convert_context_copy_32@Base 10.32 + pcre2_convert_context_create_32@Base 10.32 + pcre2_convert_context_free_32@Base 10.32 + pcre2_converted_pattern_free_32@Base 10.32 + pcre2_dfa_match_32@Base 10.22 + pcre2_general_context_copy_32@Base 10.22 + pcre2_general_context_create_32@Base 10.22 + pcre2_general_context_free_32@Base 10.22 + pcre2_get_error_message_32@Base 10.22 + pcre2_get_mark_32@Base 10.22 + pcre2_get_match_data_size_32@Base 10.34 + pcre2_get_ovector_count_32@Base 10.22 + pcre2_get_ovector_pointer_32@Base 10.22 + pcre2_get_startchar_32@Base 10.22 + pcre2_jit_compile_32@Base 10.22 + pcre2_jit_free_unused_memory_32@Base 10.22 + pcre2_jit_match_32@Base 10.22 + pcre2_jit_stack_assign_32@Base 10.22 + pcre2_jit_stack_create_32@Base 10.22 + pcre2_jit_stack_free_32@Base 10.22 + pcre2_maketables_32@Base 10.22 + pcre2_maketables_free_32@Base 10.34 + pcre2_match_32@Base 10.22 + pcre2_match_context_copy_32@Base 10.22 + pcre2_match_context_create_32@Base 10.22 + pcre2_match_context_free_32@Base 10.22 + pcre2_match_data_create_32@Base 10.22 + pcre2_match_data_create_from_pattern_32@Base 10.22 + pcre2_match_data_free_32@Base 10.22 + pcre2_pattern_convert_32@Base 10.32 + pcre2_pattern_info_32@Base 10.22 + pcre2_serialize_decode_32@Base 10.22 + pcre2_serialize_encode_32@Base 10.22 + pcre2_serialize_free_32@Base 10.22 + pcre2_serialize_get_number_of_codes_32@Base 10.22 + pcre2_set_bsr_32@Base 10.22 + pcre2_set_callout_32@Base 10.22 + pcre2_set_character_tables_32@Base 10.22 + pcre2_set_compile_extra_options_32@Base 10.32 + pcre2_set_compile_recursion_guard_32@Base 10.22 + pcre2_set_depth_limit_32@Base 10.32 + pcre2_set_glob_escape_32@Base 10.32 + pcre2_set_glob_separator_32@Base 10.32 + pcre2_set_heap_limit_32@Base 10.32 + pcre2_set_match_limit_32@Base 10.22 + pcre2_set_max_pattern_length_32@Base 10.22 + pcre2_set_newline_32@Base 10.22 + pcre2_set_offset_limit_32@Base 10.22 + pcre2_set_parens_nest_limit_32@Base 10.22 + pcre2_set_recursion_limit_32@Base 10.22 + pcre2_set_recursion_memory_management_32@Base 10.22 + pcre2_set_substitute_callout_32@Base 10.34 + pcre2_substitute_32@Base 10.22 + pcre2_substring_copy_byname_32@Base 10.22 + pcre2_substring_copy_bynumber_32@Base 10.22 + pcre2_substring_free_32@Base 10.22 + pcre2_substring_get_byname_32@Base 10.22 + pcre2_substring_get_bynumber_32@Base 10.22 + pcre2_substring_length_byname_32@Base 10.22 + pcre2_substring_length_bynumber_32@Base 10.22 + pcre2_substring_list_free_32@Base 10.22 + pcre2_substring_list_get_32@Base 10.22 + pcre2_substring_nametable_scan_32@Base 10.22 + pcre2_substring_number_from_name_32@Base 10.22 --- pcre2-10.34.orig/debian/libpcre2-8-0-udeb.install +++ pcre2-10.34/debian/libpcre2-8-0-udeb.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/*/libpcre2-8.so.* --- pcre2-10.34.orig/debian/libpcre2-8-0.install +++ pcre2-10.34/debian/libpcre2-8-0.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/*/libpcre2-8.so.* --- pcre2-10.34.orig/debian/libpcre2-8-0.symbols +++ pcre2-10.34/debian/libpcre2-8-0.symbols @@ -0,0 +1,74 @@ +libpcre2-8.so.0 libpcre2-8-0 #MINVER# + pcre2_callout_enumerate_8@Base 10.22 + pcre2_code_copy_8@Base 10.22 + pcre2_code_copy_with_tables_8@Base 10.32 + pcre2_code_free_8@Base 10.22 + pcre2_compile_8@Base 10.22 + pcre2_compile_context_copy_8@Base 10.22 + pcre2_compile_context_create_8@Base 10.22 + pcre2_compile_context_free_8@Base 10.22 + pcre2_config_8@Base 10.22 + pcre2_convert_context_copy_8@Base 10.32 + pcre2_convert_context_create_8@Base 10.32 + pcre2_convert_context_free_8@Base 10.32 + pcre2_converted_pattern_free_8@Base 10.32 + pcre2_dfa_match_8@Base 10.22 + pcre2_general_context_copy_8@Base 10.22 + pcre2_general_context_create_8@Base 10.22 + pcre2_general_context_free_8@Base 10.22 + pcre2_get_error_message_8@Base 10.22 + pcre2_get_mark_8@Base 10.22 + pcre2_get_match_data_size_8@Base 10.34 + pcre2_get_ovector_count_8@Base 10.22 + pcre2_get_ovector_pointer_8@Base 10.22 + pcre2_get_startchar_8@Base 10.22 + pcre2_jit_compile_8@Base 10.22 + pcre2_jit_free_unused_memory_8@Base 10.22 + pcre2_jit_match_8@Base 10.22 + pcre2_jit_stack_assign_8@Base 10.22 + pcre2_jit_stack_create_8@Base 10.22 + pcre2_jit_stack_free_8@Base 10.22 + pcre2_maketables_8@Base 10.22 + pcre2_maketables_free_8@Base 10.34 + pcre2_match_8@Base 10.22 + pcre2_match_context_copy_8@Base 10.22 + pcre2_match_context_create_8@Base 10.22 + pcre2_match_context_free_8@Base 10.22 + pcre2_match_data_create_8@Base 10.22 + pcre2_match_data_create_from_pattern_8@Base 10.22 + pcre2_match_data_free_8@Base 10.22 + pcre2_pattern_convert_8@Base 10.32 + pcre2_pattern_info_8@Base 10.22 + pcre2_serialize_decode_8@Base 10.22 + pcre2_serialize_encode_8@Base 10.22 + pcre2_serialize_free_8@Base 10.22 + pcre2_serialize_get_number_of_codes_8@Base 10.22 + pcre2_set_bsr_8@Base 10.22 + pcre2_set_callout_8@Base 10.22 + pcre2_set_character_tables_8@Base 10.22 + pcre2_set_compile_extra_options_8@Base 10.32 + pcre2_set_compile_recursion_guard_8@Base 10.22 + pcre2_set_depth_limit_8@Base 10.32 + pcre2_set_glob_escape_8@Base 10.32 + pcre2_set_glob_separator_8@Base 10.32 + pcre2_set_heap_limit_8@Base 10.32 + pcre2_set_match_limit_8@Base 10.22 + pcre2_set_max_pattern_length_8@Base 10.22 + pcre2_set_newline_8@Base 10.22 + pcre2_set_offset_limit_8@Base 10.22 + pcre2_set_parens_nest_limit_8@Base 10.22 + pcre2_set_recursion_limit_8@Base 10.22 + pcre2_set_recursion_memory_management_8@Base 10.22 + pcre2_set_substitute_callout_8@Base 10.34 + pcre2_substitute_8@Base 10.22 + pcre2_substring_copy_byname_8@Base 10.22 + pcre2_substring_copy_bynumber_8@Base 10.22 + pcre2_substring_free_8@Base 10.22 + pcre2_substring_get_byname_8@Base 10.22 + pcre2_substring_get_bynumber_8@Base 10.22 + pcre2_substring_length_byname_8@Base 10.22 + pcre2_substring_length_bynumber_8@Base 10.22 + pcre2_substring_list_free_8@Base 10.22 + pcre2_substring_list_get_8@Base 10.22 + pcre2_substring_nametable_scan_8@Base 10.22 + pcre2_substring_number_from_name_8@Base 10.22 --- pcre2-10.34.orig/debian/libpcre2-dev.install +++ pcre2-10.34/debian/libpcre2-dev.install @@ -0,0 +1,6 @@ +debian/tmp/usr/include/* +debian/tmp/usr/lib/*/lib*.a +debian/tmp/usr/lib/*/lib*.so +debian/tmp/usr/lib/*/pkgconfig/* +debian/tmp/usr/bin/*-config +debian/tmp/usr/share/man/man3/* --- pcre2-10.34.orig/debian/libpcre2-dev.manpages +++ pcre2-10.34/debian/libpcre2-dev.manpages @@ -0,0 +1 @@ +debian/tmp/usr/share/man/man1/pcre2-config.1 --- pcre2-10.34.orig/debian/libpcre2-posix2.install +++ pcre2-10.34/debian/libpcre2-posix2.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/*/libpcre2-posix.so.* --- pcre2-10.34.orig/debian/libpcre2-posix2.symbols +++ pcre2-10.34/debian/libpcre2-posix2.symbols @@ -0,0 +1,9 @@ +libpcre2-posix.so.2 libpcre2-posix2 #MINVER# + pcre2_regcomp@Base 10.34 + pcre2_regerror@Base 10.34 + pcre2_regexec@Base 10.34 + pcre2_regfree@Base 10.34 + regcomp@Base 10.34 + regerror@Base 10.34 + regexec@Base 10.34 + regfree@Base 10.34 --- pcre2-10.34.orig/debian/pcre2-utils.install +++ pcre2-10.34/debian/pcre2-utils.install @@ -0,0 +1,4 @@ +debian/tmp/usr/bin/pcre2test +debian/tmp/usr/bin/pcre2grep +debian/tmp/usr/share/man/man1/pcre2test.1 +debian/tmp/usr/share/man/man1/pcre2grep.1 --- pcre2-10.34.orig/debian/rules +++ pcre2-10.34/debian/rules @@ -0,0 +1,32 @@ +#!/usr/bin/make -f +# See debhelper(7) +# output every command that modifies files on the build system. +#DH_VERBOSE = 1 + +# see dpkg-buildflags(1) +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk +# prefix names of functions in libpcreposix with PCRE2 to avoid clash with +# ones in libc. +export DEB_CFLAGS_MAINT_APPEND = -Dregcomp=PCRE2regcomp -Dregexec=PCRE2regexec -Dregerror=PCRE2regerror -Dregfree=PCRE2regfree + + +deb_maint_conf_args = --enable-pcre2-16 --enable-pcre2-32 --disable-pcre2grep-callout +#enable JIT only on architectures that support it (see pcre2jit.3) +ifneq ($(filter i386 amd64 armel armhf powerpc sparc arm64 ppc64 ppc64el, $(DEB_HOST_ARCH)),) +deb_maint_conf_args +=--enable-jit +else +deb_maint_conf_args +=--disable-jit +endif + +%: + dh $@ --parallel + +override_dh_auto_configure: + dh_auto_configure -- $(deb_maint_conf_args) + +override_dh_makeshlibs: + dh_makeshlibs -V --add-udeb=libpcre2-8-0-udeb + +override_dh_strip: + dh_strip --dbgsym-migration='libpcre2-dbg (<< 10.34-2~)' --- pcre2-10.34.orig/debian/watch +++ pcre2-10.34/debian/watch @@ -0,0 +1,2 @@ +version=3 +ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-([\d\.]+)\.zip --- pcre2-10.34.orig/pcre2-config.in +++ pcre2-10.34/pcre2-config.in @@ -28,19 +28,8 @@ fi libR= -case `uname -s` in - *SunOS*) - libR=" -R@libdir@" - ;; - *BSD*) - libR=" -Wl,-R@libdir@" - ;; -esac libS= -if test @libdir@ != /usr/lib ; then - libS=-L@libdir@ -fi while test $# -gt 0; do case "$1" in --- pcre2-10.34.orig/src/pcre2_jit_compile.c +++ pcre2-10.34/src/pcre2_jit_compile.c @@ -407,6 +407,9 @@ /* Locals used by fast fail optimization. */ sljit_s32 fast_fail_start_ptr; sljit_s32 fast_fail_end_ptr; + /* Variables used by recursive call generator. */ + sljit_s32 recurse_bitset_size; + uint8_t *recurse_bitset; /* Flipped and lower case tables. */ const sljit_u8 *fcc; @@ -2109,19 +2112,39 @@ #undef RECURSE_TMP_REG_COUNT +static BOOL recurse_check_bit(compiler_common *common, sljit_sw bit_index) +{ +uint8_t *byte; +uint8_t mask; + +SLJIT_ASSERT((bit_index & (sizeof(sljit_sw) - 1)) == 0); + +bit_index >>= SLJIT_WORD_SHIFT; + +mask = 1 << (bit_index & 0x7); +byte = common->recurse_bitset + (bit_index >> 3); + +if (*byte & mask) + return FALSE; + +*byte |= mask; +return TRUE; +} + static int get_recurse_data_length(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, BOOL *needs_control_head, BOOL *has_quit, BOOL *has_accept) { int length = 1; -int size; +int size, offset; PCRE2_SPTR alternative; BOOL quit_found = FALSE; BOOL accept_found = FALSE; BOOL setsom_found = FALSE; BOOL setmark_found = FALSE; -BOOL capture_last_found = FALSE; BOOL control_head_found = FALSE; +memset(common->recurse_bitset, 0, common->recurse_bitset_size); + #if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD SLJIT_ASSERT(common->control_head_ptr != 0); control_head_found = TRUE; @@ -2144,15 +2167,17 @@ setsom_found = TRUE; if (common->mark_ptr != 0) setmark_found = TRUE; - if (common->capture_last_ptr != 0) - capture_last_found = TRUE; + if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) + length++; cc += 1 + LINK_SIZE; break; case OP_KET: - if (PRIVATE_DATA(cc) != 0) + offset = PRIVATE_DATA(cc); + if (offset != 0) { - length++; + if (recurse_check_bit(common, offset)) + length++; SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0); cc += PRIVATE_DATA(cc + 1); } @@ -2169,39 +2194,55 @@ case OP_SBRA: case OP_SBRAPOS: case OP_SCOND: - length++; SLJIT_ASSERT(PRIVATE_DATA(cc) != 0); + if (recurse_check_bit(common, PRIVATE_DATA(cc))) + length++; cc += 1 + LINK_SIZE; break; case OP_CBRA: case OP_SCBRA: - length += 2; - if (common->capture_last_ptr != 0) - capture_last_found = TRUE; - if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) + offset = GET2(cc, 1 + LINK_SIZE); + if (recurse_check_bit(common, OVECTOR(offset << 1))) + { + SLJIT_ASSERT(recurse_check_bit(common, OVECTOR((offset << 1) + 1))); + length += 2; + } + if (common->optimized_cbracket[offset] == 0 && recurse_check_bit(common, OVECTOR_PRIV(offset))) + length++; + if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) length++; cc += 1 + LINK_SIZE + IMM2_SIZE; break; case OP_CBRAPOS: case OP_SCBRAPOS: - length += 2 + 2; - if (common->capture_last_ptr != 0) - capture_last_found = TRUE; + offset = GET2(cc, 1 + LINK_SIZE); + if (recurse_check_bit(common, OVECTOR(offset << 1))) + { + SLJIT_ASSERT(recurse_check_bit(common, OVECTOR((offset << 1) + 1))); + length += 2; + } + if (recurse_check_bit(common, OVECTOR_PRIV(offset))) + length++; + if (recurse_check_bit(common, PRIVATE_DATA(cc))) + length++; + if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) + length++; cc += 1 + LINK_SIZE + IMM2_SIZE; break; case OP_COND: /* Might be a hidden SCOND. */ alternative = cc + GET(cc, 1); - if (*alternative == OP_KETRMAX || *alternative == OP_KETRMIN) + if ((*alternative == OP_KETRMAX || *alternative == OP_KETRMIN) && recurse_check_bit(common, PRIVATE_DATA(cc))) length++; cc += 1 + LINK_SIZE; break; CASE_ITERATOR_PRIVATE_DATA_1 - if (PRIVATE_DATA(cc) != 0) + offset = PRIVATE_DATA(cc); + if (offset != 0 && recurse_check_bit(common, offset)) length++; cc += 2; #ifdef SUPPORT_UNICODE @@ -2210,8 +2251,12 @@ break; CASE_ITERATOR_PRIVATE_DATA_2A - if (PRIVATE_DATA(cc) != 0) + offset = PRIVATE_DATA(cc); + if (offset != 0 && recurse_check_bit(common, offset)) + { + SLJIT_ASSERT(recurse_check_bit(common, offset + sizeof(sljit_sw))); length += 2; + } cc += 2; #ifdef SUPPORT_UNICODE if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); @@ -2219,8 +2264,12 @@ break; CASE_ITERATOR_PRIVATE_DATA_2B - if (PRIVATE_DATA(cc) != 0) + offset = PRIVATE_DATA(cc); + if (offset != 0 && recurse_check_bit(common, offset)) + { + SLJIT_ASSERT(recurse_check_bit(common, offset + sizeof(sljit_sw))); length += 2; + } cc += 2 + IMM2_SIZE; #ifdef SUPPORT_UNICODE if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); @@ -2228,20 +2277,29 @@ break; CASE_ITERATOR_TYPE_PRIVATE_DATA_1 - if (PRIVATE_DATA(cc) != 0) + offset = PRIVATE_DATA(cc); + if (offset != 0 && recurse_check_bit(common, offset)) length++; cc += 1; break; CASE_ITERATOR_TYPE_PRIVATE_DATA_2A - if (PRIVATE_DATA(cc) != 0) + offset = PRIVATE_DATA(cc); + if (offset != 0 && recurse_check_bit(common, offset)) + { + SLJIT_ASSERT(recurse_check_bit(common, offset + sizeof(sljit_sw))); length += 2; + } cc += 1; break; CASE_ITERATOR_TYPE_PRIVATE_DATA_2B - if (PRIVATE_DATA(cc) != 0) + offset = PRIVATE_DATA(cc); + if (offset != 0 && recurse_check_bit(common, offset)) + { + SLJIT_ASSERT(recurse_check_bit(common, offset + sizeof(sljit_sw))); length += 2; + } cc += 1 + IMM2_SIZE; break; @@ -2253,7 +2311,9 @@ #else size = 1 + 32 / (int)sizeof(PCRE2_UCHAR); #endif - if (PRIVATE_DATA(cc) != 0) + + offset = PRIVATE_DATA(cc); + if (offset != 0 && recurse_check_bit(common, offset)) length += get_class_iterator_size(cc + size); cc += size; break; @@ -2288,8 +2348,7 @@ case OP_THEN: SLJIT_ASSERT(common->control_head_ptr != 0); quit_found = TRUE; - if (!control_head_found) - control_head_found = TRUE; + control_head_found = TRUE; cc++; break; @@ -2309,8 +2368,6 @@ if (control_head_found) length++; -if (capture_last_found) - length++; if (quit_found) { if (setsom_found) @@ -2343,14 +2400,12 @@ sljit_sw kept_shared_srcw[2]; int private_count, shared_count, kept_shared_count; int from_sp, base_reg, offset, i; -BOOL setsom_found = FALSE; -BOOL setmark_found = FALSE; -BOOL capture_last_found = FALSE; -BOOL control_head_found = FALSE; + +memset(common->recurse_bitset, 0, common->recurse_bitset_size); #if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD SLJIT_ASSERT(common->control_head_ptr != 0); -control_head_found = TRUE; +recurse_check_bit(common, common->control_head_ptr); #endif switch (type) @@ -2438,11 +2493,10 @@ { case OP_SET_SOM: SLJIT_ASSERT(common->has_set_som); - if (has_quit && !setsom_found) + if (has_quit && recurse_check_bit(common, OVECTOR(0))) { kept_shared_srcw[0] = OVECTOR(0); kept_shared_count = 1; - setsom_found = TRUE; } cc += 1; break; @@ -2450,33 +2504,31 @@ case OP_RECURSE: if (has_quit) { - if (common->has_set_som && !setsom_found) + if (common->has_set_som && recurse_check_bit(common, OVECTOR(0))) { kept_shared_srcw[0] = OVECTOR(0); kept_shared_count = 1; - setsom_found = TRUE; } - if (common->mark_ptr != 0 && !setmark_found) + if (common->mark_ptr != 0 && recurse_check_bit(common, common->mark_ptr)) { kept_shared_srcw[kept_shared_count] = common->mark_ptr; kept_shared_count++; - setmark_found = TRUE; } } - if (common->capture_last_ptr != 0 && !capture_last_found) + if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) { shared_srcw[0] = common->capture_last_ptr; shared_count = 1; - capture_last_found = TRUE; } cc += 1 + LINK_SIZE; break; case OP_KET: - if (PRIVATE_DATA(cc) != 0) + private_srcw[0] = PRIVATE_DATA(cc); + if (private_srcw[0] != 0) { - private_count = 1; - private_srcw[0] = PRIVATE_DATA(cc); + if (recurse_check_bit(common, private_srcw[0])) + private_count = 1; SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0); cc += PRIVATE_DATA(cc + 1); } @@ -2493,50 +2545,66 @@ case OP_SBRA: case OP_SBRAPOS: case OP_SCOND: - private_count = 1; private_srcw[0] = PRIVATE_DATA(cc); + if (recurse_check_bit(common, private_srcw[0])) + private_count = 1; cc += 1 + LINK_SIZE; break; case OP_CBRA: case OP_SCBRA: - offset = (GET2(cc, 1 + LINK_SIZE)) << 1; - shared_srcw[0] = OVECTOR(offset); - shared_srcw[1] = OVECTOR(offset + 1); - shared_count = 2; + offset = GET2(cc, 1 + LINK_SIZE); + shared_srcw[0] = OVECTOR(offset << 1); + if (recurse_check_bit(common, shared_srcw[0])) + { + shared_srcw[1] = shared_srcw[0] + sizeof(sljit_sw); + SLJIT_ASSERT(recurse_check_bit(common, shared_srcw[1])); + shared_count = 2; + } - if (common->capture_last_ptr != 0 && !capture_last_found) + if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) { - shared_srcw[2] = common->capture_last_ptr; - shared_count = 3; - capture_last_found = TRUE; + shared_srcw[shared_count] = common->capture_last_ptr; + shared_count++; } - if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) + if (common->optimized_cbracket[offset] == 0) { - private_count = 1; - private_srcw[0] = OVECTOR_PRIV(GET2(cc, 1 + LINK_SIZE)); + private_srcw[0] = OVECTOR_PRIV(offset); + if (recurse_check_bit(common, private_srcw[0])) + private_count = 1; } + cc += 1 + LINK_SIZE + IMM2_SIZE; break; case OP_CBRAPOS: case OP_SCBRAPOS: - offset = (GET2(cc, 1 + LINK_SIZE)) << 1; - shared_srcw[0] = OVECTOR(offset); - shared_srcw[1] = OVECTOR(offset + 1); - shared_count = 2; + offset = GET2(cc, 1 + LINK_SIZE); + shared_srcw[0] = OVECTOR(offset << 1); + if (recurse_check_bit(common, shared_srcw[0])) + { + shared_srcw[1] = shared_srcw[0] + sizeof(sljit_sw); + SLJIT_ASSERT(recurse_check_bit(common, shared_srcw[1])); + shared_count = 2; + } - if (common->capture_last_ptr != 0 && !capture_last_found) + if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) { - shared_srcw[2] = common->capture_last_ptr; - shared_count = 3; - capture_last_found = TRUE; + shared_srcw[shared_count] = common->capture_last_ptr; + shared_count++; } - private_count = 2; private_srcw[0] = PRIVATE_DATA(cc); - private_srcw[1] = OVECTOR_PRIV(GET2(cc, 1 + LINK_SIZE)); + if (recurse_check_bit(common, private_srcw[0])) + private_count = 1; + + offset = OVECTOR_PRIV(offset); + if (recurse_check_bit(common, offset)) + { + private_srcw[private_count] = offset; + private_count++; + } cc += 1 + LINK_SIZE + IMM2_SIZE; break; @@ -2545,18 +2613,17 @@ alternative = cc + GET(cc, 1); if (*alternative == OP_KETRMAX || *alternative == OP_KETRMIN) { - private_count = 1; private_srcw[0] = PRIVATE_DATA(cc); + if (recurse_check_bit(common, private_srcw[0])) + private_count = 1; } cc += 1 + LINK_SIZE; break; CASE_ITERATOR_PRIVATE_DATA_1 - if (PRIVATE_DATA(cc)) - { + private_srcw[0] = PRIVATE_DATA(cc); + if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) private_count = 1; - private_srcw[0] = PRIVATE_DATA(cc); - } cc += 2; #ifdef SUPPORT_UNICODE if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); @@ -2564,11 +2631,12 @@ break; CASE_ITERATOR_PRIVATE_DATA_2A - if (PRIVATE_DATA(cc)) + private_srcw[0] = PRIVATE_DATA(cc); + if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) { private_count = 2; - private_srcw[0] = PRIVATE_DATA(cc); - private_srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_sw); + private_srcw[1] = private_srcw[0] + sizeof(sljit_sw); + SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); } cc += 2; #ifdef SUPPORT_UNICODE @@ -2577,11 +2645,12 @@ break; CASE_ITERATOR_PRIVATE_DATA_2B - if (PRIVATE_DATA(cc)) + private_srcw[0] = PRIVATE_DATA(cc); + if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) { private_count = 2; - private_srcw[0] = PRIVATE_DATA(cc); - private_srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_sw); + private_srcw[1] = private_srcw[0] + sizeof(sljit_sw); + SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); } cc += 2 + IMM2_SIZE; #ifdef SUPPORT_UNICODE @@ -2590,30 +2659,30 @@ break; CASE_ITERATOR_TYPE_PRIVATE_DATA_1 - if (PRIVATE_DATA(cc)) - { + private_srcw[0] = PRIVATE_DATA(cc); + if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) private_count = 1; - private_srcw[0] = PRIVATE_DATA(cc); - } cc += 1; break; CASE_ITERATOR_TYPE_PRIVATE_DATA_2A - if (PRIVATE_DATA(cc)) + private_srcw[0] = PRIVATE_DATA(cc); + if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) { private_count = 2; - private_srcw[0] = PRIVATE_DATA(cc); private_srcw[1] = private_srcw[0] + sizeof(sljit_sw); + SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); } cc += 1; break; CASE_ITERATOR_TYPE_PRIVATE_DATA_2B - if (PRIVATE_DATA(cc)) + private_srcw[0] = PRIVATE_DATA(cc); + if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) { private_count = 2; - private_srcw[0] = PRIVATE_DATA(cc); private_srcw[1] = private_srcw[0] + sizeof(sljit_sw); + SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); } cc += 1 + IMM2_SIZE; break; @@ -2630,14 +2699,17 @@ switch(get_class_iterator_size(cc + i)) { case 1: - private_count = 1; private_srcw[0] = PRIVATE_DATA(cc); break; case 2: - private_count = 2; private_srcw[0] = PRIVATE_DATA(cc); - private_srcw[1] = private_srcw[0] + sizeof(sljit_sw); + if (recurse_check_bit(common, private_srcw[0])) + { + private_count = 2; + private_srcw[1] = private_srcw[0] + sizeof(sljit_sw); + SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); + } break; default: @@ -2652,28 +2724,25 @@ case OP_PRUNE_ARG: case OP_THEN_ARG: SLJIT_ASSERT(common->mark_ptr != 0); - if (has_quit && !setmark_found) + if (has_quit && recurse_check_bit(common, common->mark_ptr)) { kept_shared_srcw[0] = common->mark_ptr; kept_shared_count = 1; - setmark_found = TRUE; } - if (common->control_head_ptr != 0 && !control_head_found) + if (common->control_head_ptr != 0 && recurse_check_bit(common, common->control_head_ptr)) { shared_srcw[0] = common->control_head_ptr; shared_count = 1; - control_head_found = TRUE; } cc += 1 + 2 + cc[1]; break; case OP_THEN: SLJIT_ASSERT(common->control_head_ptr != 0); - if (!control_head_found) + if (recurse_check_bit(common, common->control_head_ptr)) { shared_srcw[0] = common->control_head_ptr; shared_count = 1; - control_head_found = TRUE; } cc++; break; @@ -2681,7 +2750,7 @@ default: cc = next_opcode(common, cc); SLJIT_ASSERT(cc != NULL); - break; + continue; } if (type != recurse_copy_shared_to_global && type != recurse_copy_kept_shared_to_global) @@ -7119,7 +7188,7 @@ { SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP); cc++; - if (*cc == PT_CLIST) + if (*cc == PT_CLIST && cc[-1] == XCL_PROP) { other_cases = PRIV(ucd_caseless_sets) + cc[1]; while (*other_cases != NOTACHAR) @@ -13262,7 +13331,7 @@ common->cbra_ptr = OVECTOR_START + (re->top_bracket + 1) * 2 * sizeof(sljit_sw); total_length = ccend - common->start; -common->private_data_ptrs = (sljit_s32 *)SLJIT_MALLOC(total_length * (sizeof(sljit_s32) + (common->has_then ? 1 : 0)), allocator_data); +common->private_data_ptrs = (sljit_s32*)SLJIT_MALLOC(total_length * (sizeof(sljit_s32) + (common->has_then ? 1 : 0)), allocator_data); if (!common->private_data_ptrs) { SLJIT_FREE(common->optimized_cbracket, allocator_data); @@ -13304,6 +13373,7 @@ common->compiler = compiler; /* Main pcre_jit_exec entry. */ +SLJIT_ASSERT((private_data_size & (sizeof(sljit_sw) - 1)) == 0); sljit_emit_enter(compiler, 0, SLJIT_ARG1(SW), 5, 5, 0, 0, private_data_size); /* Register init. */ @@ -13524,20 +13594,40 @@ common->currententry = common->entries; common->local_quit_available = TRUE; quit_label = common->quit_label; -while (common->currententry != NULL) +if (common->currententry != NULL) { - /* Might add new entries. */ - compile_recurse(common); - if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) + /* A free bit for each private data. */ + common->recurse_bitset_size = ((private_data_size / (int)sizeof(sljit_sw)) + 7) >> 3; + SLJIT_ASSERT(common->recurse_bitset_size > 0); + common->recurse_bitset = (sljit_u8*)SLJIT_MALLOC(common->recurse_bitset_size, allocator_data);; + + if (common->recurse_bitset != NULL) { + do + { + /* Might add new entries. */ + compile_recurse(common); + if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) + break; + flush_stubs(common); + common->currententry = common->currententry->next; + } + while (common->currententry != NULL); + + SLJIT_FREE(common->recurse_bitset, allocator_data); + } + + if (common->currententry != NULL) + { + /* The common->recurse_bitset has been freed. */ + SLJIT_ASSERT(sljit_get_compiler_error(compiler) || common->recurse_bitset == NULL); + sljit_free_compiler(compiler); SLJIT_FREE(common->optimized_cbracket, allocator_data); SLJIT_FREE(common->private_data_ptrs, allocator_data); PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); return PCRE2_ERROR_NOMEMORY; } - flush_stubs(common); - common->currententry = common->currententry->next; } common->local_quit_available = FALSE; common->quit_label = quit_label; @@ -13742,11 +13832,6 @@ { pcre2_real_code *re = (pcre2_real_code *)code; -#ifdef SUPPORT_JIT -executable_functions *functions = (executable_functions *)re->executable_jit; -static int executable_allocator_is_working = 0; -#endif - if (code == NULL) return PCRE2_ERROR_NULL; @@ -13779,6 +13864,11 @@ avoid compiler warnings. */ +#ifdef SUPPORT_JIT +executable_functions *functions = (executable_functions *)re->executable_jit; +static int executable_allocator_is_working = 0; +#endif + if ((options & PCRE2_JIT_INVALID_UTF) != 0) { if ((re->overall_options & PCRE2_MATCH_INVALID_UTF) == 0) --- pcre2-10.34.orig/src/pcre2_jit_test.c +++ pcre2-10.34/src/pcre2_jit_test.c @@ -408,6 +408,7 @@ { MUP, A, 0, 0 | F_PROPERTY, "[\xc3\xa2-\xc3\xa6\xc3\x81-\xc3\x84\xe2\x80\xa8-\xe2\x80\xa9\xe6\x92\xad\\p{Zs}]{2,}", "\xe2\x80\xa7\xe2\x80\xa9\xe6\x92\xad \xe6\x92\xae" }, { MUP, A, 0, 0 | F_PROPERTY, "[\\P{L&}]{2}[^\xc2\x85-\xc2\x89\\p{Ll}\\p{Lu}]{2}", "\xc3\xa9\xe6\x92\xad.a\xe6\x92\xad|\xc2\x8a#" }, { PCRE2_UCP, 0, 0, 0 | F_PROPERTY, "[a-b\\s]{2,5}[^a]", "AB baaa" }, + { CMUP, 0, 0, 0, "[^S]\\B", "\xe2\x80\x8a" }, /* Possible empty brackets. */ { MU, A, 0, 0, "(?:|ab||bc|a)+d", "abcxabcabd" }, @@ -742,6 +743,7 @@ { MU, A, 0, 0, "((?(R)a|(?1)){1,3}?)M", "aaaM" }, { MU, A, 0, 0, "((.)(?:.|\\2(?1))){0}#(?1)#", "#aabbccdde# #aabbccddee#" }, { MU, A, 0, 0, "((.)(?:\\2|\\2{4}b)){0}#(?:(?1))+#", "#aaaab# #aaaaab#" }, + { MU, A, 0, 0 | F_NOMATCH, "(?1)$((.|\\2xx){1,2})", "abc" }, /* 16 bit specific tests. */ { CM, A, 0, 0 | F_FORCECONV, "\xc3\xa1", "\xc3\x81\xc3\xa1" }, --- pcre2-10.34.orig/src/sljit/sljitNativeARM_32.c +++ pcre2-10.34/src/sljit/sljitNativeARM_32.c @@ -666,6 +666,8 @@ label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset); label->size = code_ptr - code; label = label->next; + + next_addr = compute_next_addr(label, jump, const_, put_label); } } }