diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md index f4c236d5c..a265898e5 100644 --- a/THIRD_PARTY_LICENSES.md +++ b/THIRD_PARTY_LICENSES.md @@ -98,7 +98,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` -## PCRE2 — BSD-3-Clause (with binary-redistribution exemption) +## PCRE2 — BSD-3-Clause WITH PCRE2-exception (binary-redistribution exemption) Used by `std.regex` (issue [#1389](https://github.com/aether-lang-dev/aether/issues/1389)). The directory @@ -108,11 +108,14 @@ Used by `std.regex` (issue `scripts/vendor-pcre2.sh`. It carries no local patches; three files keep the alternate names upstream itself designates for non-autotools embedding (`pcre2.h`, `config.h`, `pcre2_chartables.c`). The upstream licence text, -also present as `std/regex/pcre2/LICENCE`: +also present as `std/regex/pcre2/LICENCE.md`: ``` -PCRE2 LICENCE -------------- +PCRE2 Licence +============= + +| SPDX-License-Identifier: | BSD-3-Clause WITH PCRE2-exception | +|---------|-------| 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. @@ -126,43 +129,52 @@ 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 library is built. The just-in-time compiler is separately licensed under the +"2-clause BSD" licence. + +COPYRIGHT +--------- -THE BASIC LIBRARY FUNCTIONS ---------------------------- +### The basic library functions -Written by: Philip Hazel -Email local part: Philip.Hazel -Email domain: gmail.com + Written by: Philip Hazel + Email local part: Philip.Hazel + Email domain: gmail.com -Retired from University of Cambridge Computing Service, -Cambridge, England. + Retired from University of Cambridge Computing Service, + Cambridge, England. -Copyright (c) 1997-2024 University of Cambridge -All rights reserved. + Copyright (c) 1997-2007 University of Cambridge + Copyright (c) 2007-2024 Philip Hazel + All rights reserved. +### PCRE2 Just-In-Time compilation support -PCRE2 JUST-IN-TIME COMPILATION SUPPORT --------------------------------------- + Written by: Zoltan Herczeg + Email local part: hzmester + Email domain: freemail.hu -Written by: Zoltan Herczeg -Email local part: hzmester -Email domain: freemail.hu + Copyright (c) 2010-2024 Zoltan Herczeg + All rights reserved. -Copyright(c) 2010-2024 Zoltan Herczeg -All rights reserved. +### Stack-less Just-In-Time compiler + Written by: Zoltan Herczeg + Email local part: hzmester + Email domain: freemail.hu -STACK-LESS JUST-IN-TIME COMPILER --------------------------------- + Copyright (c) 2009-2024 Zoltan Herczeg + All rights reserved. -Written by: Zoltan Herczeg -Email local part: hzmester -Email domain: freemail.hu +The code in the `deps/sljit` directory has its own LICENSE file. -Copyright(c) 2009-2024 Zoltan Herczeg -All rights reserved. +### All other contributions + +Many other contributors have participated in the authorship of PCRE2. As PCRE2 +has never required a Contributor Licensing Agreement, or other copyright +assignment agreement, all contributions have copyright retained by each +original contributor or their employer. THE "BSD" LICENCE @@ -171,16 +183,16 @@ 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 notices, - this list of conditions and the following disclaimer. +* Redistributions of source code must retain the above copyright notices, + this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notices, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +* Redistributions in binary form must reproduce the above copyright + notices, 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. +* 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 @@ -203,8 +215,6 @@ not apply all the way down a chain of software. If binary package A includes PCRE2, it must respect the condition, but if package B is software that includes package A, the condition is not imposed on package B unless it uses PCRE2 independently. - -End ``` ## Project Wycheproof — Apache License 2.0 diff --git a/new_changelogs/20261024T190000Z-security-pcre2-10.49.md b/new_changelogs/20261024T190000Z-security-pcre2-10.49.md new file mode 100644 index 000000000..4d60f2ed5 --- /dev/null +++ b/new_changelogs/20261024T190000Z-security-pcre2-10.49.md @@ -0,0 +1,13 @@ +- **The vendored PCRE2 is 10.49, up from 10.44.** It is what `std.regex` runs + on a box without a system libpcre2-8, and in every `ae build --target` cross + build. Of the fixes since 10.44, the one std.regex can reach is + GHSA-fmgr-6ggq-9859: integer overflows while compiling a pattern on 32-bit + CPUs, leading to out-of-bounds writes. The rest (GHSA-r9hj-j2rw-4q3m, + -2p8c-ff85-vh9x, -3r4p-g7gg-ppmf, -9qww-pwc4-77qq, -q8g2-wprr-34m9, + -q7rw-r7qq-2hx6) are in JIT, DFA, invalid-UTF, convert and serialize paths + std.regex does not call. Patterns see PCRE2's own changes since 10.44: + Unicode 17, `\p{Ll}` / `\p{Lu}` / `[:lower:]` under caseless matching now + match both cases as Perl does, and `\x` not followed by `{` or a hex digit is + no longer a NUL escape (write `\x00`). The release tarball's GPG signature + checks against the key upstream's SECURITY.md names. Builds that use a + system libpcre2-8 are unchanged. diff --git a/scripts/vendor-pcre2.sh b/scripts/vendor-pcre2.sh index 044258f57..b144c3efc 100755 --- a/scripts/vendor-pcre2.sh +++ b/scripts/vendor-pcre2.sh @@ -6,6 +6,14 @@ # Run from the repo root. To bump the version: update VERSION and SHA256 # below (sha from the pcre2 GitHub release page), run the script, review # the diff, and update THIRD_PARTY_LICENSES.md if the licence text changed. +# The release is also GPG-signed (pcre2-.tar.gz.sig); upstream's +# SECURITY.md names the signing key. Check it by hand when bumping: +# gpg --recv-keys A95536204A3BB489715231282A98E77EB6F24CA8 +# gpg --verify pcre2-.tar.gz.sig pcre2-.tar.gz +# When the source list in NON-AUTOTOOLS-BUILD changes, update the lists +# below and the #includes in aether_pcre2_vendored.c together; +# `gcc -MM std/regex/aether_pcre2_vendored.c -DAETHER_VENDOR_PCRE2` lists +# every file the unity build reads. # # The vendored tree is VERBATIM upstream — no local patches, ever. The three # files whose committed name differs from their upstream name are the ones @@ -19,8 +27,8 @@ # by editing config.h, so the whole tree stays checkable against upstream. set -eu -VERSION=10.44 -SHA256=86b9cb0aa3bcb7994faa88018292bc704cdbb708e785f7c74352ff6ea7d3175b +VERSION=10.49 +SHA256=929f0b20e62879252a15886b06c89f1edef61a363cbd5826fb041080a5e557ae URL="https://github.com/PCRE2Project/pcre2/releases/download/pcre2-${VERSION}/pcre2-${VERSION}.tar.gz" DEST=std/regex/pcre2 @@ -39,23 +47,25 @@ SRC="$TMP/pcre2-${VERSION}/src" rm -rf "$DEST" mkdir -p "$DEST" -# The 28 sources aether_pcre2_vendored.c #includes, plus the 3 that those -# sources themselves #include (jit_match/jit_misc/ucptables are textual -# inclusions upstream, never compiled standalone). +# The 31 sources NON-AUTOTOOLS-BUILD lists, which aether_pcre2_vendored.c +# #includes. for f in \ - pcre2_auto_possess pcre2_chkdint pcre2_compile pcre2_config \ - pcre2_context pcre2_convert pcre2_dfa_match pcre2_error pcre2_extuni \ - pcre2_find_bracket pcre2_jit_compile pcre2_maketables pcre2_match \ - pcre2_match_data pcre2_newline pcre2_ord2utf pcre2_pattern_info \ + pcre2_auto_possess pcre2_chkdint pcre2_compile pcre2_compile_cgroup \ + pcre2_compile_class pcre2_config pcre2_context pcre2_convert \ + pcre2_dfa_match pcre2_error pcre2_extuni pcre2_find_bracket \ + pcre2_jit_compile pcre2_maketables pcre2_match pcre2_match_data \ + pcre2_match_next pcre2_newline pcre2_ord2utf pcre2_pattern_info \ pcre2_script_run pcre2_serialize pcre2_string_utils pcre2_study \ pcre2_substitute pcre2_substring pcre2_tables pcre2_ucd \ - pcre2_valid_utf pcre2_xclass \ - pcre2_jit_match pcre2_jit_misc pcre2_ucptables; do + pcre2_valid_utf pcre2_xclass; do cp "$SRC/$f.c" "$DEST/" done -# Internal headers the sources include. -for h in pcre2_internal.h pcre2_intmodedep.h pcre2_ucp.h; do +# Internal headers the sources include, and the *_inc.h files they include +# textually (never compiled standalone). +for h in pcre2_internal.h pcre2_intmodedep.h pcre2_ucp.h pcre2_compile.h \ + pcre2_util.h pcre2_jit_match_inc.h pcre2_jit_misc_inc.h \ + pcre2_ucptables_inc.h; do cp "$SRC/$h" "$DEST/" done @@ -66,14 +76,14 @@ cp "$SRC/pcre2_chartables.c.dist" "$DEST/pcre2_chartables.c" # Upstream licence, kept beside the code it covers (also reproduced in # THIRD_PARTY_LICENSES.md). -cp "$TMP/pcre2-${VERSION}/LICENCE" "$DEST/LICENCE" +cp "$TMP/pcre2-${VERSION}/LICENCE.md" "$DEST/LICENCE.md" cat > "$DEST/VENDOR.md" <), BSD-3-Clause — full licence in -\`LICENCE\` here and in \`THIRD_PARTY_LICENSES.md\`. Vendored for #1389 so +\`LICENCE.md\` here and in \`THIRD_PARTY_LICENSES.md\`. Vendored for #1389 so \`std.regex\` works without a system libpcre2-8: native builds on boxes without the library, and \`ae build --target ...\` cross builds with no CROSSBUILD_SYSROOT. diff --git a/std/regex/aether_pcre2_vendored.c b/std/regex/aether_pcre2_vendored.c index c5ba95725..8e8a7f410 100644 --- a/std/regex/aether_pcre2_vendored.c +++ b/std/regex/aether_pcre2_vendored.c @@ -45,6 +45,8 @@ #include "pcre2/pcre2_chartables.c" #include "pcre2/pcre2_chkdint.c" #include "pcre2/pcre2_compile.c" +#include "pcre2/pcre2_compile_cgroup.c" +#include "pcre2/pcre2_compile_class.c" #include "pcre2/pcre2_config.c" #include "pcre2/pcre2_context.c" #include "pcre2/pcre2_convert.c" @@ -56,6 +58,7 @@ #include "pcre2/pcre2_maketables.c" #include "pcre2/pcre2_match.c" #include "pcre2/pcre2_match_data.c" +#include "pcre2/pcre2_match_next.c" #include "pcre2/pcre2_newline.c" #include "pcre2/pcre2_ord2utf.c" #include "pcre2/pcre2_pattern_info.c" diff --git a/std/regex/pcre2/LICENCE b/std/regex/pcre2/LICENCE.md similarity index 52% rename from std/regex/pcre2/LICENCE rename to std/regex/pcre2/LICENCE.md index 3c1ef032d..f6fba35db 100644 --- a/std/regex/pcre2/LICENCE +++ b/std/regex/pcre2/LICENCE.md @@ -1,5 +1,8 @@ -PCRE2 LICENCE -------------- +PCRE2 Licence +============= + +| SPDX-License-Identifier: | BSD-3-Clause WITH PCRE2-exception | +|---------|-------| 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. @@ -13,43 +16,52 @@ 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 library is built. The just-in-time compiler is separately licensed under the +"2-clause BSD" licence. + +COPYRIGHT +--------- -THE BASIC LIBRARY FUNCTIONS ---------------------------- +### The basic library functions -Written by: Philip Hazel -Email local part: Philip.Hazel -Email domain: gmail.com + Written by: Philip Hazel + Email local part: Philip.Hazel + Email domain: gmail.com -Retired from University of Cambridge Computing Service, -Cambridge, England. + Retired from University of Cambridge Computing Service, + Cambridge, England. -Copyright (c) 1997-2024 University of Cambridge -All rights reserved. + Copyright (c) 1997-2007 University of Cambridge + Copyright (c) 2007-2024 Philip Hazel + All rights reserved. +### PCRE2 Just-In-Time compilation support -PCRE2 JUST-IN-TIME COMPILATION SUPPORT --------------------------------------- + Written by: Zoltan Herczeg + Email local part: hzmester + Email domain: freemail.hu -Written by: Zoltan Herczeg -Email local part: hzmester -Email domain: freemail.hu + Copyright (c) 2010-2024 Zoltan Herczeg + All rights reserved. -Copyright(c) 2010-2024 Zoltan Herczeg -All rights reserved. +### Stack-less Just-In-Time compiler + Written by: Zoltan Herczeg + Email local part: hzmester + Email domain: freemail.hu -STACK-LESS JUST-IN-TIME COMPILER --------------------------------- + Copyright (c) 2009-2024 Zoltan Herczeg + All rights reserved. -Written by: Zoltan Herczeg -Email local part: hzmester -Email domain: freemail.hu +The code in the `deps/sljit` directory has its own LICENSE file. -Copyright(c) 2009-2024 Zoltan Herczeg -All rights reserved. +### All other contributions + +Many other contributors have participated in the authorship of PCRE2. As PCRE2 +has never required a Contributor Licensing Agreement, or other copyright +assignment agreement, all contributions have copyright retained by each +original contributor or their employer. THE "BSD" LICENCE @@ -58,16 +70,16 @@ 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 notices, - this list of conditions and the following disclaimer. +* Redistributions of source code must retain the above copyright notices, + this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notices, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +* Redistributions in binary form must reproduce the above copyright + notices, 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. +* 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 @@ -90,5 +102,3 @@ not apply all the way down a chain of software. If binary package A includes PCRE2, it must respect the condition, but if package B is software that includes package A, the condition is not imposed on package B unless it uses PCRE2 independently. - -End diff --git a/std/regex/pcre2/VENDOR.md b/std/regex/pcre2/VENDOR.md index ed2b30243..4ffc94d64 100644 --- a/std/regex/pcre2/VENDOR.md +++ b/std/regex/pcre2/VENDOR.md @@ -1,14 +1,14 @@ -# Vendored PCRE2 10.44 +# Vendored PCRE2 10.49 -Byte-identical subset of upstream PCRE2 10.44 +Byte-identical subset of upstream PCRE2 10.49 (), BSD-3-Clause — full licence in -`LICENCE` here and in `THIRD_PARTY_LICENSES.md`. Vendored for #1389 so +`LICENCE.md` here and in `THIRD_PARTY_LICENSES.md`. Vendored for #1389 so `std.regex` works without a system libpcre2-8: native builds on boxes without the library, and `ae build --target ...` cross builds with no CROSSBUILD_SYSROOT. -- Upstream tarball: pcre2-10.44.tar.gz -- SHA-256: `86b9cb0aa3bcb7994faa88018292bc704cdbb708e785f7c74352ff6ea7d3175b` +- Upstream tarball: pcre2-10.49.tar.gz +- SHA-256: `929f0b20e62879252a15886b06c89f1edef61a363cbd5826fb041080a5e557ae` - Regenerate with: `scripts/vendor-pcre2.sh` (edit VERSION/SHA256 there to bump) Three files are upstream files under the name upstream designates for diff --git a/std/regex/pcre2/config.h b/std/regex/pcre2/config.h index 009294813..9d7971f68 100644 --- a/std/regex/pcre2/config.h +++ b/std/regex/pcre2/config.h @@ -22,11 +22,7 @@ Boolean macros such as HAVE_STDLIB_H and SUPPORT_PCRE2_8 should either be defined (conventionally to 1) for TRUE, and not defined at all for FALSE. All such macros are listed as a commented #undef in config.h.generic. Macros such as MATCH_LIMIT, whose actual value is relevant, have defaults defined, but are -surrounded by #ifndef/#endif lines so that the value can be overridden by -D. - -PCRE2 uses memmove() if HAVE_MEMMOVE is defined; otherwise it uses bcopy() if -HAVE_BCOPY is defined. If your system has neither bcopy() nor memmove(), make -sure both macros are undefined; an emulation function will then be used. */ +surrounded by #ifndef/#endif lines so that the value can be overridden by -D. */ /* By default, the \R escape sequence matches any Unicode line ending character or sequence of characters. If BSR_ANYCRLF is defined (to any @@ -44,23 +40,34 @@ sure both macros are undefined; an emulation function will then be used. */ assumes that all input strings are in EBCDIC. If you do not define this macro, PCRE2 will assume input strings are ASCII or UTF-8/16/32 Unicode. It is not possible to build a version of PCRE2 that supports both EBCDIC and - UTF-8/16/32. */ + ASCII or UTF-8/16/32. */ /* #undef EBCDIC */ +/* To force an EBCDIC environment, define this macro to make the core PCRE2 + library functions use EBCDIC codepage 1047, regardless of whether the + compiler supports it using C character literals. */ +/* #undef EBCDIC_IGNORING_COMPILER */ + /* In an EBCDIC environment, define this macro to any value to arrange for the NL character to be 0x25 instead of the default 0x15. NL plays the role that LF does in an ASCII/Unicode environment. */ /* #undef EBCDIC_NL25 */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ASSERT_H */ + /* Define this if your compiler supports __attribute__((uninitialized)) */ /* #undef HAVE_ATTRIBUTE_UNINITIALIZED */ -/* Define to 1 if you have the 'bcopy' function. */ -/* #undef HAVE_BCOPY */ +/* Define this if your compiler provides __assume() */ +/* #undef HAVE_BUILTIN_ASSUME */ /* Define this if your compiler provides __builtin_mul_overflow() */ /* #undef HAVE_BUILTIN_MUL_OVERFLOW */ +/* Define this if your compiler provides __builtin_unreachable() */ +/* #undef HAVE_BUILTIN_UNREACHABLE */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_BZLIB_H */ @@ -82,16 +89,13 @@ sure both macros are undefined; an emulation function will then be used. */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIMITS_H */ -/* Define to 1 if you have the 'memfd_create' function. */ +/* Define to 1 if you have the `memfd_create' function. */ /* #undef HAVE_MEMFD_CREATE */ -/* Define to 1 if you have the 'memmove' function. */ -/* #undef HAVE_MEMMOVE */ - /* Define to 1 if you have the header file. */ /* #undef HAVE_MINIX_CONFIG_H */ -/* Define to 1 if you have the 'mkostemp' function. */ +/* Define to 1 if you have the `mkostemp' function. */ /* #undef HAVE_MKOSTEMP */ /* Define if you have POSIX threads libraries and header files. */ @@ -112,9 +116,12 @@ sure both macros are undefined; an emulation function will then be used. */ /* Define to 1 if you have the `realpath' function. */ /* #undef HAVE_REALPATH */ -/* Define to 1 if you have the 'secure_getenv' function. */ +/* Define to 1 if you have the `secure_getenv' function. */ /* #undef HAVE_SECURE_GETENV */ +/* Define to 1 if you have the `setrlimit' function. */ +/* #undef HAVE_SETRLIMIT */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_STDINT_H */ @@ -124,9 +131,6 @@ sure both macros are undefined; an emulation function will then be used. */ /* Define to 1 if you have the header file. */ /* #undef HAVE_STDLIB_H */ -/* Define to 1 if you have the 'strerror' function. */ -/* #undef HAVE_STRERROR */ - /* Define to 1 if you have the header file. */ /* #undef HAVE_STRINGS_H */ @@ -145,7 +149,8 @@ sure both macros are undefined; an emulation function will then be used. */ /* Define to 1 if you have the header file. */ /* #undef HAVE_UNISTD_H */ -/* Define to 1 if the compiler supports simple visibility declarations. */ +/* Define to 1 if the compiler supports GCC compatible visibility + declarations. */ /* #undef HAVE_VISIBILITY */ /* Define to 1 if you have the header file. */ @@ -245,7 +250,7 @@ sure both macros are undefined; an emulation function will then be used. */ #define PACKAGE_NAME "PCRE2" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "PCRE2 10.44" +#define PACKAGE_STRING "PCRE2 10.49" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "pcre2" @@ -254,7 +259,7 @@ sure both macros are undefined; an emulation function will then be used. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "10.44" +#define PACKAGE_VERSION "10.49" /* The value of PARENS_NEST_LIMIT specifies the maximum depth of nested parentheses (of any kind) in a pattern. This limits the amount of system @@ -281,10 +286,24 @@ sure both macros are undefined; an emulation function will then be used. */ #define PCRE2GREP_MAX_BUFSIZE 1048576 #endif +/* See PCRE2_EXP_DEFN; but this is applied to functions in the libpcre2-posix + library. */ +/* #undef PCRE2POSIX_EXP_DEFN */ + +/* Define to any value if linking libpcre2-posix dynamically. Ideally, if both + static and shared libraries are being built, then PCRE2POSIX_SHARED would + be defined only for the shared build. Indeed, this is a requirement on + Windows. However, when building with Autoconf and libtool, we compile the + sources once only to create both the static and shared library, so in this + case, PCRE2POSIX_SHARED should only be defined if the shared library is + being built, regardless of whether or not the static library is also being + built. */ +/* #undef PCRE2POSIX_SHARED */ + /* Define to any value to include debugging code. */ /* #undef PCRE2_DEBUG */ -/* to make a symbol visible */ +/* Define to the annotation for making a symbol visible. */ #define PCRE2_EXPORT /* If you are compiling for a system other than a Unix-like system or @@ -299,7 +318,12 @@ sure both macros are undefined; an emulation function will then be used. */ in the C sense, but which are internal to the library. */ /* #undef PCRE2_EXP_DEFN */ -/* Define to any value if linking statically (TODO: make nice with Libtool) */ +/* Define to any value if linking statically. Ideally, if both static and + shared libraries are being built, then PCRE2_STATIC would be defined only + for the static build. Indeed, this is a requirement on Windows. With + Autoconf and libtool however, it is idiomatic to compile the sources once + to create both the static and shared library, so in this case, PCRE2_STATIC + should only be defined if no shared library is being built. */ /* #undef PCRE2_STATIC */ /* Define to necessary symbol if this constant uses a non-standard name on @@ -311,7 +335,7 @@ sure both macros are undefined; an emulation function will then be used. */ unless SUPPORT_JIT is also defined. */ /* #undef SLJIT_PROT_EXECUTABLE_ALLOCATOR */ -/* Define to 1 if all of the C89 standard headers exist (not just the ones +/* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ /* #undef STDC_HEADERS */ @@ -366,7 +390,7 @@ sure both macros are undefined; an emulation function will then be used. */ /* Define to any value for valgrind support to find invalid memory reads. */ /* #undef SUPPORT_VALGRIND */ -/* Enable extensions on AIX, Interix, z/OS. */ +/* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 #endif @@ -427,15 +451,11 @@ sure both macros are undefined; an emulation function will then be used. */ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # define __STDC_WANT_IEC_60559_DFP_EXT__ 1 #endif -/* Enable extensions specified by C23 Annex F. */ -#ifndef __STDC_WANT_IEC_60559_EXT__ -# define __STDC_WANT_IEC_60559_EXT__ 1 -#endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1 #endif -/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # define __STDC_WANT_IEC_60559_TYPES_EXT__ 1 #endif @@ -458,26 +478,20 @@ sure both macros are undefined; an emulation function will then be used. */ #endif /* Version number of package */ -#define VERSION "10.44" +#define VERSION "10.49" /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ -/* Define to 1 on platforms where this makes off_t a 64-bit type. */ +/* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ -/* Number of bits in time_t, on hosts where this is settable. */ -/* #undef _TIME_BITS */ - -/* Define to 1 on platforms where this makes time_t a 64-bit type. */ -/* #undef __MINGW_USE_VC2005_COMPAT */ - -/* Define to empty if 'const' does not conform to ANSI C. */ +/* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to the type of a signed integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ /* #undef int64_t */ -/* Define as 'unsigned int' if doesn't define. */ +/* Define to `unsigned int' if does not define. */ /* #undef size_t */ diff --git a/std/regex/pcre2/pcre2.h b/std/regex/pcre2/pcre2.h index a322d9f2d..6adecbfd8 100644 --- a/std/regex/pcre2/pcre2.h +++ b/std/regex/pcre2/pcre2.h @@ -42,25 +42,21 @@ POSSIBILITY OF SUCH DAMAGE. /* The current PCRE version information. */ #define PCRE2_MAJOR 10 -#define PCRE2_MINOR 44 +#define PCRE2_MINOR 49 #define PCRE2_PRERELEASE -#define PCRE2_DATE 2024-06-07 +#define PCRE2_DATE 2026-09-28 -/* When an application links to a PCRE DLL in Windows, the symbols that are +/* When an application links to a PCRE2 DLL in Windows, the symbols that are imported have to be identified as such. When building PCRE2, the appropriate -export setting is defined in pcre2_internal.h, which includes this file. So we -don't change existing definitions of PCRE2_EXP_DECL. */ +export setting is defined in pcre2_internal.h, which includes this file. So, we +don't change existing definitions of PCRE2_EXP_DECL. -#if defined(_WIN32) && !defined(PCRE2_STATIC) -# ifndef PCRE2_EXP_DECL -# define PCRE2_EXP_DECL extern __declspec(dllimport) -# endif -#endif - -/* By default, we use the standard "extern" declarations. */ +By default, we use the standard "extern" declarations. */ #ifndef PCRE2_EXP_DECL -# ifdef __cplusplus +# if defined(_WIN32) && !defined(PCRE2_STATIC) +# define PCRE2_EXP_DECL extern __declspec(dllimport) +# elif defined __cplusplus # define PCRE2_EXP_DECL extern "C" # else # define PCRE2_EXP_DECL extern @@ -68,14 +64,15 @@ don't change existing definitions of PCRE2_EXP_DECL. */ #endif /* When compiling with the MSVC compiler, it is sometimes necessary to include -a "calling convention" before exported function names. (This is secondhand -information; I know nothing about MSVC myself). For example, something like +a "calling convention" before exported function names. For example: void __cdecl function(....) -might be needed. In order so make this easy, all the exported functions have -PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not -set, we ensure here that it has no effect. */ +might be needed. In order to make this easy, all the exported functions have +PCRE2_CALL_CONVENTION just before their names. + +PCRE2 normally uses the platform's standard calling convention, so this should +not be set unless you know you need it. */ #ifndef PCRE2_CALL_CONVENTION #define PCRE2_CALL_CONVENTION @@ -143,6 +140,7 @@ D is inspected during pcre2_dfa_match() execution #define PCRE2_EXTENDED_MORE 0x01000000u /* C */ #define PCRE2_LITERAL 0x02000000u /* C */ #define PCRE2_MATCH_INVALID_UTF 0x04000000u /* J M D */ +#define PCRE2_ALT_EXTENDED_CLASS 0x08000000u /* C */ /* An additional compile options word is available in the compile context. */ @@ -159,6 +157,10 @@ D is inspected during pcre2_dfa_match() execution #define PCRE2_EXTRA_ASCII_BSW 0x00000400u /* C */ #define PCRE2_EXTRA_ASCII_POSIX 0x00000800u /* C */ #define PCRE2_EXTRA_ASCII_DIGIT 0x00001000u /* C */ +#define PCRE2_EXTRA_PYTHON_OCTAL 0x00002000u /* C */ +#define PCRE2_EXTRA_NO_BS0 0x00004000u /* C */ +#define PCRE2_EXTRA_NEVER_CALLOUT 0x00008000u /* C */ +#define PCRE2_EXTRA_TURKISH_CASING 0x00010000u /* C */ /* These are for pcre2_jit_compile(). */ @@ -166,6 +168,7 @@ D is inspected during pcre2_dfa_match() execution #define PCRE2_JIT_PARTIAL_SOFT 0x00000002u #define PCRE2_JIT_PARTIAL_HARD 0x00000004u #define PCRE2_JIT_INVALID_UTF 0x00000100u +#define PCRE2_JIT_TEST_ALLOC 0x00000200u /* These are for pcre2_match(), pcre2_dfa_match(), pcre2_jit_match(), and pcre2_substitute(). Some are allowed only for one of the functions, and in @@ -318,9 +321,29 @@ pcre2_pattern_convert(). */ #define PCRE2_ERROR_ALPHA_ASSERTION_UNKNOWN 195 #define PCRE2_ERROR_SCRIPT_RUN_NOT_AVAILABLE 196 #define PCRE2_ERROR_TOO_MANY_CAPTURES 197 -#define PCRE2_ERROR_CONDITION_ATOMIC_ASSERTION_EXPECTED 198 +#define PCRE2_ERROR_MISSING_OCTAL_DIGIT 198 #define PCRE2_ERROR_BACKSLASH_K_IN_LOOKAROUND 199 - +#define PCRE2_ERROR_MAX_VAR_LOOKBEHIND_EXCEEDED 200 +#define PCRE2_ERROR_PATTERN_COMPILED_SIZE_TOO_BIG 201 +#define PCRE2_ERROR_OVERSIZE_PYTHON_OCTAL 202 +#define PCRE2_ERROR_CALLOUT_CALLER_DISABLED 203 +#define PCRE2_ERROR_EXTRA_CASING_REQUIRES_UNICODE 204 +#define PCRE2_ERROR_TURKISH_CASING_REQUIRES_UTF 205 +#define PCRE2_ERROR_EXTRA_CASING_INCOMPATIBLE 206 +#define PCRE2_ERROR_ECLASS_NEST_TOO_DEEP 207 +#define PCRE2_ERROR_ECLASS_INVALID_OPERATOR 208 +#define PCRE2_ERROR_ECLASS_UNEXPECTED_OPERATOR 209 +#define PCRE2_ERROR_ECLASS_EXPECTED_OPERAND 210 +#define PCRE2_ERROR_ECLASS_MIXED_OPERATORS 211 +#define PCRE2_ERROR_ECLASS_HINT_SQUARE_BRACKET 212 +#define PCRE2_ERROR_PERL_ECLASS_UNEXPECTED_EXPR 213 +#define PCRE2_ERROR_PERL_ECLASS_EMPTY_EXPR 214 +#define PCRE2_ERROR_PERL_ECLASS_MISSING_CLOSE 215 +#define PCRE2_ERROR_PERL_ECLASS_UNEXPECTED_CHAR 216 +#define PCRE2_ERROR_EXPECTED_CAPTURE_GROUP 217 +#define PCRE2_ERROR_MISSING_OPENING_PARENTHESIS 218 +#define PCRE2_ERROR_MISSING_NUMBER_TERMINATOR 219 +#define PCRE2_ERROR_NULL_ERROROFFSET 220 /* "Expected" matching error codes: no match and partial match. */ @@ -407,6 +430,15 @@ released, the numbers must not be changed. */ #define PCRE2_ERROR_INTERNAL_DUPMATCH (-65) #define PCRE2_ERROR_DFA_UINVALID_UTF (-66) #define PCRE2_ERROR_INVALIDOFFSET (-67) +#define PCRE2_ERROR_JIT_UNSUPPORTED (-68) +#define PCRE2_ERROR_REPLACECASE (-69) +#define PCRE2_ERROR_TOOLARGEREPLACE (-70) +#define PCRE2_ERROR_DIFFSUBSPATTERN (-71) +#define PCRE2_ERROR_DIFFSUBSSUBJECT (-72) +#define PCRE2_ERROR_DIFFSUBSOFFSET (-73) +#define PCRE2_ERROR_DIFFSUBSOPTIONS (-74) +#define PCRE2_ERROR_BAD_BACKSLASH_K (-75) +#define PCRE2_ERROR_PARTIALSUBS (-76) /* Request types for pcre2_pattern_info() */ @@ -459,7 +491,32 @@ released, the numbers must not be changed. */ #define PCRE2_CONFIG_NEVER_BACKSLASH_C 13 #define PCRE2_CONFIG_COMPILED_WIDTHS 14 #define PCRE2_CONFIG_TABLES_LENGTH 15 +#define PCRE2_CONFIG_EFFECTIVE_LINKSIZE 16 + +/* Optimization directives for pcre2_set_optimize(). +For binary compatibility, only add to this list; do not renumber. */ + +#define PCRE2_OPTIMIZATION_NONE 0 +#define PCRE2_OPTIMIZATION_FULL 1 + +#define PCRE2_AUTO_POSSESS 64 +#define PCRE2_AUTO_POSSESS_OFF 65 +#define PCRE2_DOTSTAR_ANCHOR 66 +#define PCRE2_DOTSTAR_ANCHOR_OFF 67 +#define PCRE2_START_OPTIMIZE 68 +#define PCRE2_START_OPTIMIZE_OFF 69 +/* Types used in pcre2_set_substitute_case_callout(). + +PCRE2_SUBSTITUTE_CASE_LOWER and PCRE2_SUBSTITUTE_CASE_UPPER are passed to the +callout to indicate that the case of the entire callout input should be +case-transformed. PCRE2_SUBSTITUTE_CASE_TITLE_FIRST is passed to indicate that +only the first character or glyph should be transformed to Unicode titlecase, +and the rest to lowercase. */ + +#define PCRE2_SUBSTITUTE_CASE_LOWER 1 +#define PCRE2_SUBSTITUTE_CASE_UPPER 2 +#define PCRE2_SUBSTITUTE_CASE_TITLE_FIRST 3 /* Types for code units in patterns and subject strings. */ @@ -613,7 +670,9 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_parens_nest_limit(pcre2_compile_context *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_compile_recursion_guard(pcre2_compile_context *, \ - int (*)(uint32_t, void *), void *); + int (*)(uint32_t, void *), void *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_optimize(pcre2_compile_context *, uint32_t); #define PCRE2_MATCH_CONTEXT_FUNCTIONS \ PCRE2_EXP_DECL pcre2_match_context *PCRE2_CALL_CONVENTION \ @@ -628,6 +687,11 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_substitute_callout(pcre2_match_context *, \ int (*)(pcre2_substitute_callout_block *, void *), void *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_set_substitute_case_callout(pcre2_match_context *, \ + PCRE2_SIZE (*)(PCRE2_SPTR, PCRE2_SIZE, PCRE2_UCHAR *, PCRE2_SIZE, int, \ + void *), \ + void *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_depth_limit(pcre2_match_context *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ @@ -687,14 +751,14 @@ PCRE2_EXP_DECL pcre2_match_data *PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL pcre2_match_data *PCRE2_CALL_CONVENTION \ pcre2_match_data_create_from_pattern(const pcre2_code *, \ pcre2_general_context *); \ +PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ + pcre2_match_data_free(pcre2_match_data *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_dfa_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \ uint32_t, pcre2_match_data *, pcre2_match_context *, int *, PCRE2_SIZE); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \ uint32_t, pcre2_match_data *, pcre2_match_context *); \ -PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ - pcre2_match_data_free(pcre2_match_data *); \ PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \ pcre2_get_mark(pcre2_match_data *); \ PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \ @@ -706,7 +770,9 @@ PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL PCRE2_SIZE *PCRE2_CALL_CONVENTION \ pcre2_get_ovector_pointer(pcre2_match_data *); \ PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \ - pcre2_get_startchar(pcre2_match_data *); + pcre2_get_startchar(pcre2_match_data *); \ +PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ + pcre2_next_match(pcre2_match_data *, PCRE2_SIZE *, uint32_t *); /* Convenience functions for handling matched substrings. */ @@ -740,6 +806,7 @@ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **); + /* Functions for serializing / deserializing compiled patterns. */ #define PCRE2_SERIALIZE_FUNCTIONS \ @@ -885,6 +952,7 @@ pcre2_compile are called by application code. */ #define pcre2_match_data_create PCRE2_SUFFIX(pcre2_match_data_create_) #define pcre2_match_data_create_from_pattern PCRE2_SUFFIX(pcre2_match_data_create_from_pattern_) #define pcre2_match_data_free PCRE2_SUFFIX(pcre2_match_data_free_) +#define pcre2_next_match PCRE2_SUFFIX(pcre2_next_match_) #define pcre2_pattern_convert PCRE2_SUFFIX(pcre2_pattern_convert_) #define pcre2_pattern_info PCRE2_SUFFIX(pcre2_pattern_info_) #define pcre2_serialize_decode PCRE2_SUFFIX(pcre2_serialize_decode_) @@ -907,7 +975,9 @@ pcre2_compile are called by application code. */ #define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_) #define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_) #define pcre2_set_offset_limit PCRE2_SUFFIX(pcre2_set_offset_limit_) +#define pcre2_set_optimize PCRE2_SUFFIX(pcre2_set_optimize_) #define pcre2_set_substitute_callout PCRE2_SUFFIX(pcre2_set_substitute_callout_) +#define pcre2_set_substitute_case_callout PCRE2_SUFFIX(pcre2_set_substitute_case_callout_) #define pcre2_substitute PCRE2_SUFFIX(pcre2_substitute_) #define pcre2_substring_copy_byname PCRE2_SUFFIX(pcre2_substring_copy_byname_) #define pcre2_substring_copy_bynumber PCRE2_SUFFIX(pcre2_substring_copy_bynumber_) diff --git a/std/regex/pcre2/pcre2_auto_possess.c b/std/regex/pcre2/pcre2_auto_possess.c index 210d13d37..408803246 100644 --- a/std/regex/pcre2/pcre2_auto_possess.c +++ b/std/regex/pcre2/pcre2_auto_possess.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2022 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -38,17 +38,19 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ + /* This module contains functions that scan a compiled pattern and change repeats into possessive repeats where possible. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "pcre2_internal.h" -#include "pcre2_internal.h" +/* This macro represents the max size of list[] and that is used to keep +track of UCD info in several places, it should be kept on sync with the +value used by GenerateUcd.py */ +#define MAX_LIST 8 /************************************************* * Tables for auto-possessification * @@ -64,7 +66,7 @@ The Unicode property types (\P and \p) have to be present to fill out the table because of what their opcode values are, but the table values should always be zero because property types are handled separately in the code. The last four columns apply to items that cannot be repeated, so there is no need to have -rows for them. Note that OP_DIGIT etc. are generated only when PCRE_UCP is +rows for them. Note that OP_DIGIT etc. are generated only when PCRE2_UCP is *not* set. When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */ #define APTROWS (LAST_AUTOTAB_LEFT_OP - FIRST_AUTOTAB_OP + 1) @@ -123,21 +125,21 @@ opcode is used to select the column. The values are as follows: */ static const uint8_t propposstab[PT_TABSIZE][PT_TABSIZE] = { -/* ANY LAMP GC PC SC SCX ALNUM SPACE PXSPACE WORD CLIST UCNC BIDICL BOOL */ - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_ANY */ - { 0, 3, 0, 0, 0, 0, 3, 1, 1, 0, 0, 0, 0, 0 }, /* PT_LAMP */ - { 0, 0, 2, 4, 0, 0, 9, 10, 10, 11, 0, 0, 0, 0 }, /* PT_GC */ - { 0, 0, 5, 2, 0, 0, 15, 16, 16, 17, 0, 0, 0, 0 }, /* PT_PC */ - { 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_SC */ - { 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_SCX */ - { 0, 3, 6, 12, 0, 0, 3, 1, 1, 0, 0, 0, 0, 0 }, /* PT_ALNUM */ - { 0, 1, 7, 13, 0, 0, 1, 3, 3, 1, 0, 0, 0, 0 }, /* PT_SPACE */ - { 0, 1, 7, 13, 0, 0, 1, 3, 3, 1, 0, 0, 0, 0 }, /* PT_PXSPACE */ - { 0, 0, 8, 14, 0, 0, 0, 1, 1, 3, 0, 0, 0, 0 }, /* PT_WORD */ - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_CLIST */ - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0 }, /* PT_UCNC */ - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_BIDICL */ - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } /* PT_BOOL */ +/* LAMP GC PC SC SCX ALNUM SPACE PXSPACE WORD CLIST UCNC BIDICL BOOL */ + { 3, 0, 0, 0, 0, 3, 1, 1, 0, 0, 0, 0, 0 }, /* PT_LAMP */ + { 0, 2, 4, 0, 0, 9, 10, 10, 11, 0, 0, 0, 0 }, /* PT_GC */ + { 0, 5, 2, 0, 0, 15, 16, 16, 17, 0, 0, 0, 0 }, /* PT_PC */ + { 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_SC */ + { 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_SCX */ + { 3, 6, 12, 0, 0, 3, 1, 1, 0, 0, 0, 0, 0 }, /* PT_ALNUM */ + { 1, 7, 13, 0, 0, 1, 3, 3, 1, 0, 0, 0, 0 }, /* PT_SPACE */ + { 1, 7, 13, 0, 0, 1, 3, 3, 1, 0, 0, 0, 0 }, /* PT_PXSPACE */ + { 0, 8, 14, 0, 0, 0, 1, 1, 3, 0, 0, 0, 0 }, /* PT_WORD */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_CLIST */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0 }, /* PT_UCNC */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_BIDICL */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } /* PT_BOOL */ + /* PT_ANY does not need a record. */ }; /* This table is used to check whether auto-possessification is possible @@ -199,7 +201,7 @@ static BOOL check_char_prop(uint32_t c, unsigned int ptype, unsigned int pdata, BOOL negated) { -BOOL ok; +BOOL ok, rc; const uint32_t *p; const ucd_record *prop = GET_UCD(c); @@ -240,12 +242,13 @@ switch(ptype) { HSPACE_CASES: VSPACE_CASES: - return negated; + rc = negated; + break; default: - return (PRIV(ucp_gentype)[prop->chartype] == ucp_Z) == negated; + rc = (PRIV(ucp_gentype)[prop->chartype] == ucp_Z) == negated; } - break; /* Control never reaches here */ + return rc; case PT_WORD: return (PRIV(ucp_gentype)[prop->chartype] == ucp_L || @@ -259,7 +262,10 @@ switch(ptype) if (c < *p) return !negated; if (c == *p++) return negated; } - break; /* Control never reaches here */ + /* LCOV_EXCL_START */ + PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */ + break; + /* LCOV_EXCL_STOP */ /* Haven't yet thought these through. */ @@ -328,6 +334,7 @@ get_chr_property_list(PCRE2_SPTR code, BOOL utf, BOOL ucp, const uint8_t *fcc, PCRE2_UCHAR c = *code; PCRE2_UCHAR base; PCRE2_SPTR end; +PCRE2_SPTR class_end; uint32_t chr; #ifdef SUPPORT_UNICODE @@ -450,10 +457,12 @@ switch(c) code += 2; do { - if (clist_dest >= list + 8) + if (clist_dest >= list + MAX_LIST) { - /* Early return if there is not enough space. This should never - happen, since all clists are shorter than 5 character now. */ + /* Early return if there is not enough space. GenerateUcd.py + generated a list with more than 5 characters and something + must be done about that going forward. */ + PCRE2_DEBUG_UNREACHABLE(); /* Remove if it ever triggers */ list[2] = code[0]; list[3] = code[1]; return code; @@ -473,11 +482,13 @@ switch(c) case OP_CLASS: #ifdef SUPPORT_WIDE_CHARS case OP_XCLASS: - if (c == OP_XCLASS) + case OP_ECLASS: + if (c == OP_XCLASS || c == OP_ECLASS) end = code + GET(code, 0) - 1; else #endif end = code + 32 / sizeof(PCRE2_UCHAR); + class_end = end; switch(*end) { @@ -505,6 +516,7 @@ switch(c) break; } list[2] = (uint32_t)(end - code); + list[3] = (uint32_t)(end - class_end); return end; } @@ -537,7 +549,7 @@ compare_opcodes(PCRE2_SPTR code, BOOL utf, BOOL ucp, const compile_block *cb, const uint32_t *base_list, PCRE2_SPTR base_end, int *rec_limit) { PCRE2_UCHAR c; -uint32_t list[8]; +uint32_t list[MAX_LIST]; const uint32_t *chr_ptr; const uint32_t *ochr_ptr; const uint32_t *list_ptr; @@ -581,7 +593,7 @@ for(;;) continue; } - /* At the end of a branch, skip to the end of the group. */ + /* At the end of a branch, skip to the end of the group and process it. */ if (c == OP_ALT) { @@ -638,19 +650,29 @@ for(;;) return FALSE; break; - /* Atomic sub-patterns and assertions can always auto-possessify their - last iterator except for variable length lookbehinds. However, if the - group was entered as a result of checking a previous iterator, this is - not possible. */ + /* Atomic sub-patterns and forward assertions can always auto-possessify + their last iterator. However, if the group was entered as a result of + checking a previous iterator, this is not possible. */ case OP_ASSERT: case OP_ASSERT_NOT: case OP_ONCE: return !entered_a_group; + /* Fixed-length lookbehinds can be treated the same way, but variable + length lookbehinds must not auto-possessify their last iterator. Note + that in order to identify a variable length lookbehind we must check + through all branches, because some may be of fixed length. */ + case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: - return (bracode[1+LINK_SIZE] == OP_VREVERSE)? FALSE : !entered_a_group; + do + { + if (bracode[1+LINK_SIZE] == OP_VREVERSE) return FALSE; /* Variable */ + bracode += GET(bracode, 1); + } + while (*bracode == OP_ALT); + return !entered_a_group; /* Not variable length */ /* Non-atomic assertions - don't possessify last iterator. This needs more thought. */ @@ -748,12 +770,12 @@ for(;;) if (base_list[0] == OP_CLASS) #endif { - set1 = (uint8_t *)(base_end - base_list[2]); + set1 = (const uint8_t *)(base_end - base_list[2]); list_ptr = list; } else { - set1 = (uint8_t *)(code - list[2]); + set1 = (const uint8_t *)(code - list[2]); list_ptr = base_list; } @@ -762,13 +784,14 @@ for(;;) { case OP_CLASS: case OP_NCLASS: - set2 = (uint8_t *) + set2 = (const uint8_t *) ((list_ptr == list ? code : base_end) - list_ptr[2]); break; #ifdef SUPPORT_WIDE_CHARS case OP_XCLASS: - xclass_flags = (list_ptr == list ? code : base_end) - list_ptr[2] + LINK_SIZE; + xclass_flags = (list_ptr == list ? code : base_end) - + list_ptr[2] + LINK_SIZE; if ((*xclass_flags & XCL_HASPROP) != 0) return FALSE; if ((*xclass_flags & XCL_MAP) == 0) { @@ -777,29 +800,29 @@ for(;;) /* Might be an empty repeat. */ continue; } - set2 = (uint8_t *)(xclass_flags + 1); + set2 = (const uint8_t *)(xclass_flags + 1); break; #endif case OP_NOT_DIGIT: invert_bits = TRUE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_DIGIT: - set2 = (uint8_t *)(cb->cbits + cbit_digit); + set2 = (const uint8_t *)(cb->cbits + cbit_digit); break; case OP_NOT_WHITESPACE: invert_bits = TRUE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_WHITESPACE: - set2 = (uint8_t *)(cb->cbits + cbit_space); + set2 = (const uint8_t *)(cb->cbits + cbit_space); break; case OP_NOT_WORDCHAR: invert_bits = TRUE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_WORDCHAR: - set2 = (uint8_t *)(cb->cbits + cbit_word); + set2 = (const uint8_t *)(cb->cbits + cbit_word); break; default: @@ -1080,11 +1103,11 @@ for(;;) case OP_NCLASS: if (chr > 255) return FALSE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_CLASS: if (chr > 255) break; - class_bitset = (uint8_t *) + class_bitset = (const uint8_t *) ((list_ptr == list ? code : base_end) - list_ptr[2]); if ((class_bitset[chr >> 3] & (1u << (chr & 7))) != 0) return FALSE; break; @@ -1092,9 +1115,18 @@ for(;;) #ifdef SUPPORT_WIDE_CHARS case OP_XCLASS: if (PRIV(xclass)(chr, (list_ptr == list ? code : base_end) - - list_ptr[2] + LINK_SIZE, utf)) return FALSE; + list_ptr[2] + LINK_SIZE, (const uint8_t*)cb->start_code, utf)) + return FALSE; break; -#endif + + case OP_ECLASS: + if (PRIV(eclass)(chr, + (list_ptr == list ? code : base_end) - list_ptr[2] + LINK_SIZE, + (list_ptr == list ? code : base_end) - list_ptr[3], + (const uint8_t*)cb->start_code, utf)) + return FALSE; + break; +#endif /* SUPPORT_WIDE_CHARS */ default: return FALSE; @@ -1109,8 +1141,10 @@ for(;;) if (list[1] == 0) return TRUE; } -/* Control never reaches here. There used to be a fail-save return FALSE; here, -but some compilers complain about an unreachable statement. */ +/* LCOV_EXCL_START */ +PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */ +return FALSE; /* Avoid compiler warnings */ +/* LCOV_EXCL_STOP */ } @@ -1140,7 +1174,7 @@ PRIV(auto_possessify)(PCRE2_UCHAR *code, const compile_block *cb) PCRE2_UCHAR c; PCRE2_SPTR end; PCRE2_UCHAR *repeat_opcode; -uint32_t list[8]; +uint32_t list[MAX_LIST]; int rec_limit = 1000; /* Was 10,000 but clang+ASAN uses a lot of stack. */ BOOL utf = (cb->external_options & PCRE2_UTF) != 0; BOOL ucp = (cb->external_options & PCRE2_UCP) != 0; @@ -1149,7 +1183,13 @@ for (;;) { c = *code; - if (c >= OP_TABLE_LENGTH) return -1; /* Something gone wrong */ + /* LCOV_EXCL_START */ + if (c >= OP_TABLE_LENGTH) + { + PCRE2_DEBUG_UNREACHABLE(); + return -1; /* Something gone wrong */ + } + /* LCOV_EXCL_STOP */ if (c >= OP_STAR && c <= OP_TYPEPOSUPTO) { @@ -1198,10 +1238,14 @@ for (;;) } c = *code; } - else if (c == OP_CLASS || c == OP_NCLASS || c == OP_XCLASS) + else if (c == OP_CLASS || c == OP_NCLASS +#ifdef SUPPORT_WIDE_CHARS + || c == OP_XCLASS || c == OP_ECLASS +#endif + ) { #ifdef SUPPORT_WIDE_CHARS - if (c == OP_XCLASS) + if (c == OP_XCLASS || c == OP_ECLASS) repeat_opcode = code + GET(code, 1); else #endif @@ -1211,7 +1255,7 @@ for (;;) if (c >= OP_CRSTAR && c <= OP_CRMINRANGE) { /* The return from get_chr_property_list() will never be NULL when - *code (aka c) is one of the three class opcodes. However, gcc with + *code (aka c) is one of the four class opcodes. However, gcc with -fanalyzer notes that a NULL return is possible, and grumbles. Hence we put in a check. */ @@ -1279,6 +1323,7 @@ for (;;) #ifdef SUPPORT_WIDE_CHARS case OP_XCLASS: + case OP_ECLASS: code += GET(code, 1); break; #endif diff --git a/std/regex/pcre2/pcre2_chartables.c b/std/regex/pcre2/pcre2_chartables.c index 7362c3f23..29f920001 100644 --- a/std/regex/pcre2/pcre2_chartables.c +++ b/std/regex/pcre2/pcre2_chartables.c @@ -19,10 +19,6 @@ PCRE2 is configured with --enable-rebuild-chartables. However, you can run pcre2_dftables manually with the -L option to build tables using the LC_ALL locale. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" const uint8_t PRIV(default_tables)[] = { diff --git a/std/regex/pcre2/pcre2_chkdint.c b/std/regex/pcre2/pcre2_chkdint.c index d04f6f8cf..7aeb64057 100644 --- a/std/regex/pcre2/pcre2_chkdint.c +++ b/std/regex/pcre2/pcre2_chkdint.c @@ -37,16 +37,16 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ + /* This file contains functions to implement checked integer operation */ -#ifndef PCRE2_PCRE2TEST -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#ifndef PCRE2_PCRE2TEST #include "pcre2_internal.h" #endif + + /************************************************* * Checked Integer Multiplication * *************************************************/ @@ -74,9 +74,7 @@ if (__builtin_mul_overflow(a, b, &m)) return TRUE; #else INT64_OR_DOUBLE m; -#ifdef PCRE2_DEBUG -if (a < 0 || b < 0) abort(); -#endif +PCRE2_ASSERT(a >= 0 && b >= 0); m = (INT64_OR_DOUBLE)a * (INT64_OR_DOUBLE)b; @@ -93,4 +91,4 @@ if (m > PCRE2_SIZE_MAX) return TRUE; return FALSE; } -/* End of pcre_chkdint.c */ +/* End of pcre2_chkdint.c */ diff --git a/std/regex/pcre2/pcre2_compile.c b/std/regex/pcre2/pcre2_compile.c index 8e6787aba..32cb32f65 100644 --- a/std/regex/pcre2/pcre2_compile.c +++ b/std/regex/pcre2/pcre2_compile.c @@ -39,16 +39,14 @@ POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "pcre2_compile.h" + + #define NLBLOCK cb /* Block containing newline information */ #define PSSTART start_pattern /* Field containing processed string start */ #define PSEND end_pattern /* Field containing processed string end */ -#include "pcre2_internal.h" - /* In rare error cases debugging might require calling pcre2_printint(). */ #if 0 @@ -57,7 +55,15 @@ POSSIBILITY OF SUCH DAMAGE. #else #define PRINTABLE(c) ((c) >= 32 && (c) < 127) #endif -#include "pcre2_printint.c" +#define CHAR_OUTPUT(c) (c) +#define CHAR_OUTPUT_HEX(c) (c) +#define CHAR_INPUT(c) (c) +#define CHAR_INPUT_HEX(c) (c) +#include "pcre2_printint_inc.h" +#undef PRINTABLE +#undef CHAR_OUTPUT +#undef CHAR_OUTPUT_HEX +#undef CHAR_INPUT #define DEBUG_CALL_PRINTINT #endif @@ -84,44 +90,8 @@ by defining macros in order to minimize #if usage. */ #endif #endif -/* Macros to store and retrieve a PCRE2_SIZE value in the parsed pattern, which -consists of uint32_t elements. Assume that if uint32_t can't hold it, two of -them will be able to (i.e. assume a 64-bit world). */ - -#if PCRE2_SIZE_MAX <= UINT32_MAX -#define PUTOFFSET(s,p) *p++ = s -#define GETOFFSET(s,p) s = *p++ -#define GETPLUSOFFSET(s,p) s = *(++p) -#define READPLUSOFFSET(s,p) s = p[1] -#define SKIPOFFSET(p) p++ -#define SIZEOFFSET 1 -#else -#define PUTOFFSET(s,p) \ - { *p++ = (uint32_t)(s >> 32); *p++ = (uint32_t)(s & 0xffffffff); } -#define GETOFFSET(s,p) \ - { s = ((PCRE2_SIZE)p[0] << 32) | (PCRE2_SIZE)p[1]; p += 2; } -#define GETPLUSOFFSET(s,p) \ - { s = ((PCRE2_SIZE)p[1] << 32) | (PCRE2_SIZE)p[2]; p += 2; } -#define READPLUSOFFSET(s,p) \ - { s = ((PCRE2_SIZE)p[1] << 32) | (PCRE2_SIZE)p[2]; } -#define SKIPOFFSET(p) p += 2 -#define SIZEOFFSET 2 -#endif - -/* Macros for manipulating elements of the parsed pattern vector. */ - -#define META_CODE(x) (x & 0xffff0000u) -#define META_DATA(x) (x & 0x0000ffffu) -#define META_DIFF(x,y) ((x-y)>>16) - /* Function definitions to allow mutual recursion */ -#ifdef SUPPORT_UNICODE -static unsigned int - add_list_to_class_internal(uint8_t *, PCRE2_UCHAR **, uint32_t, uint32_t, - compile_block *, const uint32_t *, unsigned int); -#endif - static int compile_regex(uint32_t, uint32_t, PCRE2_UCHAR **, uint32_t **, int *, uint32_t, uint32_t *, uint32_t *, uint32_t *, uint32_t *, branch_chain *, @@ -199,106 +169,6 @@ don't have to check them every time. */ #define OFLOW_MAX (INT_MAX - 20) -/* Code values for parsed patterns, which are stored in a vector of 32-bit -unsigned ints. Values less than META_END are literal data values. The coding -for identifying the item is in the top 16-bits, leaving 16 bits for the -additional data that some of them need. The META_CODE, META_DATA, and META_DIFF -macros are used to manipulate parsed pattern elements. - -NOTE: When these definitions are changed, the table of extra lengths for each -code (meta_extra_lengths, just below) must be updated to remain in step. */ - -#define META_END 0x80000000u /* End of pattern */ - -#define META_ALT 0x80010000u /* alternation */ -#define META_ATOMIC 0x80020000u /* atomic group */ -#define META_BACKREF 0x80030000u /* Back ref */ -#define META_BACKREF_BYNAME 0x80040000u /* \k'name' */ -#define META_BIGVALUE 0x80050000u /* Next is a literal > META_END */ -#define META_CALLOUT_NUMBER 0x80060000u /* (?C with numerical argument */ -#define META_CALLOUT_STRING 0x80070000u /* (?C with string argument */ -#define META_CAPTURE 0x80080000u /* Capturing parenthesis */ -#define META_CIRCUMFLEX 0x80090000u /* ^ metacharacter */ -#define META_CLASS 0x800a0000u /* start non-empty class */ -#define META_CLASS_EMPTY 0x800b0000u /* empty class */ -#define META_CLASS_EMPTY_NOT 0x800c0000u /* negative empty class */ -#define META_CLASS_END 0x800d0000u /* end of non-empty class */ -#define META_CLASS_NOT 0x800e0000u /* start non-empty negative class */ -#define META_COND_ASSERT 0x800f0000u /* (?(?assertion)... */ -#define META_COND_DEFINE 0x80100000u /* (?(DEFINE)... */ -#define META_COND_NAME 0x80110000u /* (?()... */ -#define META_COND_NUMBER 0x80120000u /* (?(digits)... */ -#define META_COND_RNAME 0x80130000u /* (?(R&name)... */ -#define META_COND_RNUMBER 0x80140000u /* (?(Rdigits)... */ -#define META_COND_VERSION 0x80150000u /* (?(VERSIONx.y)... */ -#define META_DOLLAR 0x80160000u /* $ metacharacter */ -#define META_DOT 0x80170000u /* . metacharacter */ -#define META_ESCAPE 0x80180000u /* \d and friends */ -#define META_KET 0x80190000u /* closing parenthesis */ -#define META_NOCAPTURE 0x801a0000u /* no capture parens */ -#define META_OPTIONS 0x801b0000u /* (?i) and friends */ -#define META_POSIX 0x801c0000u /* POSIX class item */ -#define META_POSIX_NEG 0x801d0000u /* negative POSIX class item */ -#define META_RANGE_ESCAPED 0x801e0000u /* range with at least one escape */ -#define META_RANGE_LITERAL 0x801f0000u /* range defined literally */ -#define META_RECURSE 0x80200000u /* Recursion */ -#define META_RECURSE_BYNAME 0x80210000u /* (?&name) */ -#define META_SCRIPT_RUN 0x80220000u /* (*script_run:...) */ - -/* These must be kept together to make it easy to check that an assertion -is present where expected in a conditional group. */ - -#define META_LOOKAHEAD 0x80230000u /* (?= */ -#define META_LOOKAHEADNOT 0x80240000u /* (?! */ -#define META_LOOKBEHIND 0x80250000u /* (?<= */ -#define META_LOOKBEHINDNOT 0x80260000u /* (? */ ESCAPES_FIRST+0x0e, /* ? */ ESCAPES_FIRST+0x0f, + /* @ */ ESCAPES_FIRST+0x10, /* A */ -ESC_A, + /* B */ -ESC_B, /* C */ -ESC_C, + /* D */ -ESC_D, /* E */ -ESC_E, + /* F */ 0, /* G */ -ESC_G, + /* H */ -ESC_H, /* I */ 0, + /* J */ 0, /* K */ -ESC_K, + /* L */ 0, /* M */ 0, + /* N */ -ESC_N, /* O */ 0, + /* P */ -ESC_P, /* Q */ -ESC_Q, + /* R */ -ESC_R, /* S */ -ESC_S, + /* T */ 0, /* U */ 0, + /* V */ -ESC_V, /* W */ -ESC_W, + /* X */ -ESC_X, /* Y */ 0, + /* Z */ -ESC_Z, /* [ */ ESCAPES_FIRST+0x2b, + /* \ */ ESCAPES_FIRST+0x2c, /* ] */ ESCAPES_FIRST+0x2d, + /* ^ */ ESCAPES_FIRST+0x2e, /* _ */ ESCAPES_FIRST+0x2f, + /* ` */ ESCAPES_FIRST+0x30, /* a */ CHAR_BEL, + /* b */ -ESC_b, /* c */ 0, + /* d */ -ESC_d, /* e */ CHAR_ESC, + /* f */ CHAR_FF, /* g */ 0, + /* h */ -ESC_h, /* i */ 0, + /* j */ 0, /* k */ -ESC_k, + /* l */ 0, /* m */ 0, + /* n */ CHAR_LF, /* o */ 0, + /* p */ -ESC_p, /* q */ 0, + /* r */ CHAR_CR, /* s */ -ESC_s, + /* t */ CHAR_HT, /* u */ 0, + /* v */ -ESC_v, /* w */ -ESC_w, + /* x */ 0, /* y */ 0, + /* z */ -ESC_z }; #else /* This is the "abnormal" table for EBCDIC systems without UTF-8 support. -It runs from 'a' to '9'. For some minimal testing of EBCDIC features, the code -is sometimes compiled on an ASCII system. In this case, we must not use CHAR_a -because it is defined as 'a', which of course picks up the ASCII value. */ +It runs from 'a' to '9'. Our EBCDIC support can be provided via the compiler, +which can interpret character literals like 'a' or '[' in an EBCDIC codepage; +in this case, there is wide variance between codepages on the interpretation of +characters between the letters ('[' and '{' and so on are placed in all sorts of +different positions in the table). Thankfully however, all EBCDIC codepages +place the letters and digits in the same location, so we hardcode that here. +Our EBCDIC support can also be provided via numeric literals instead of +character literals, so either way, 'CHAR_a' will be 0x81 when PCRE2 is compiled +in EBCDIC mode. */ -#if 'a' == 0x81 /* Check for a real EBCDIC environment */ #define ESCAPES_FIRST CHAR_a #define ESCAPES_LAST CHAR_9 #define UPPER_CASE(c) (c+64) -#else /* Testing in an ASCII environment */ -#define ESCAPES_FIRST ((unsigned char)'\x81') /* EBCDIC 'a' */ -#define ESCAPES_LAST ((unsigned char)'\xf9') /* EBCDIC '9' */ -#define UPPER_CASE(c) (c-32) -#endif static const short int escapes[] = { -/* 80 */ CHAR_BEL, -ESC_b, 0, -ESC_d, CHAR_ESC, CHAR_FF, 0, -/* 88 */ -ESC_h, 0, 0, '{', 0, 0, 0, 0, -/* 90 */ 0, 0, -ESC_k, 0, 0, CHAR_LF, 0, -ESC_p, -/* 98 */ 0, CHAR_CR, 0, '}', 0, 0, 0, 0, -/* A0 */ 0, '~', -ESC_s, CHAR_HT, 0, -ESC_v, -ESC_w, 0, -/* A8 */ 0, -ESC_z, 0, 0, 0, '[', 0, 0, -/* B0 */ 0, 0, 0, 0, 0, 0, 0, 0, -/* B8 */ 0, 0, 0, 0, 0, ']', '=', '-', -/* C0 */ '{', -ESC_A, -ESC_B, -ESC_C, -ESC_D, -ESC_E, 0, -ESC_G, -/* C8 */ -ESC_H, 0, 0, 0, 0, 0, 0, 0, -/* D0 */ '}', 0, -ESC_K, 0, 0, -ESC_N, 0, -ESC_P, -/* D8 */ -ESC_Q, -ESC_R, 0, 0, 0, 0, 0, 0, -/* E0 */ '\\', 0, -ESC_S, 0, 0, -ESC_V, -ESC_W, -ESC_X, -/* E8 */ 0, -ESC_Z, 0, 0, 0, 0, 0, 0, -/* F0 */ 0, 0, 0, 0, 0, 0, 0, 0, -/* F8 */ 0, 0 + /* 0x81 a */ CHAR_BEL, /* 0x82 b */ -ESC_b, + /* 0x83 c */ 0, /* 0x84 d */ -ESC_d, + /* 0x85 e */ CHAR_ESC, /* 0x86 f */ CHAR_FF, + /* 0x87 g */ 0, /* 0x88 h */ -ESC_h, + /* 0x89 i */ 0, /* 0x8a */ ESCAPES_FIRST+0x09, + /* 0x8b */ ESCAPES_FIRST+0x0a, /* 0x8c */ ESCAPES_FIRST+0x0b, + /* 0x8d */ ESCAPES_FIRST+0x0c, /* 0x8e */ ESCAPES_FIRST+0x0d, + /* 0x8f */ ESCAPES_FIRST+0x0e, /* 0x90 */ ESCAPES_FIRST+0x0f, + /* 0x91 j */ 0, /* 0x92 k */ -ESC_k, + /* 0x93 l */ 0, /* 0x94 m */ 0, + /* 0x95 n */ CHAR_LF, /* 0x96 o */ 0, + /* 0x97 p */ -ESC_p, /* 0x98 q */ 0, + /* 0x99 r */ CHAR_CR, /* 0x9a */ ESCAPES_FIRST+0x19, + /* 0x9b */ ESCAPES_FIRST+0x1a, /* 0x9c */ ESCAPES_FIRST+0x1b, + /* 0x9d */ ESCAPES_FIRST+0x1c, /* 0x9e */ ESCAPES_FIRST+0x1d, + /* 0x9f */ ESCAPES_FIRST+0x1e, /* 0xa0 */ ESCAPES_FIRST+0x1f, + /* 0xa1 */ ESCAPES_FIRST+0x20, /* 0xa2 s */ -ESC_s, + /* 0xa3 t */ CHAR_HT, /* 0xa4 u */ 0, + /* 0xa5 v */ -ESC_v, /* 0xa6 w */ -ESC_w, + /* 0xa7 x */ 0, /* 0xa8 y */ 0, + /* 0xa9 z */ -ESC_z, /* 0xaa */ ESCAPES_FIRST+0x29, + /* 0xab */ ESCAPES_FIRST+0x2a, /* 0xac */ ESCAPES_FIRST+0x2b, + /* 0xad */ ESCAPES_FIRST+0x2c, /* 0xae */ ESCAPES_FIRST+0x2d, + /* 0xaf */ ESCAPES_FIRST+0x2e, /* 0xb0 */ ESCAPES_FIRST+0x2f, + /* 0xb1 */ ESCAPES_FIRST+0x30, /* 0xb2 */ ESCAPES_FIRST+0x31, + /* 0xb3 */ ESCAPES_FIRST+0x32, /* 0xb4 */ ESCAPES_FIRST+0x33, + /* 0xb5 */ ESCAPES_FIRST+0x34, /* 0xb6 */ ESCAPES_FIRST+0x35, + /* 0xb7 */ ESCAPES_FIRST+0x36, /* 0xb8 */ ESCAPES_FIRST+0x37, + /* 0xb9 */ ESCAPES_FIRST+0x38, /* 0xba */ ESCAPES_FIRST+0x39, + /* 0xbb */ ESCAPES_FIRST+0x3a, /* 0xbc */ ESCAPES_FIRST+0x3b, + /* 0xbd */ ESCAPES_FIRST+0x3c, /* 0xbe */ ESCAPES_FIRST+0x3d, + /* 0xbf */ ESCAPES_FIRST+0x3e, /* 0xc0 */ ESCAPES_FIRST+0x3f, + /* 0xc1 A */ -ESC_A, /* 0xc2 B */ -ESC_B, + /* 0xc3 C */ -ESC_C, /* 0xc4 D */ -ESC_D, + /* 0xc5 E */ -ESC_E, /* 0xc6 F */ 0, + /* 0xc7 G */ -ESC_G, /* 0xc8 H */ -ESC_H, + /* 0xc9 I */ 0, /* 0xca */ ESCAPES_FIRST+0x49, + /* 0xcb */ ESCAPES_FIRST+0x4a, /* 0xcc */ ESCAPES_FIRST+0x4b, + /* 0xcd */ ESCAPES_FIRST+0x4c, /* 0xce */ ESCAPES_FIRST+0x4d, + /* 0xcf */ ESCAPES_FIRST+0x4e, /* 0xd0 */ ESCAPES_FIRST+0x4f, + /* 0xd1 J */ 0, /* 0xd2 K */ -ESC_K, + /* 0xd3 L */ 0, /* 0xd4 M */ 0, + /* 0xd5 N */ -ESC_N, /* 0xd6 O */ 0, + /* 0xd7 P */ -ESC_P, /* 0xd8 Q */ -ESC_Q, + /* 0xd9 R */ -ESC_R, /* 0xda */ ESCAPES_FIRST+0x59, + /* 0xdb */ ESCAPES_FIRST+0x5a, /* 0xdc */ ESCAPES_FIRST+0x5b, + /* 0xdd */ ESCAPES_FIRST+0x5c, /* 0xde */ ESCAPES_FIRST+0x5d, + /* 0xdf */ ESCAPES_FIRST+0x5e, /* 0xe0 */ ESCAPES_FIRST+0x5f, + /* 0xe1 */ ESCAPES_FIRST+0x60, /* 0xe2 S */ -ESC_S, + /* 0xe3 T */ 0, /* 0xe4 U */ 0, + /* 0xe5 V */ -ESC_V, /* 0xe6 W */ -ESC_W, + /* 0xe7 X */ -ESC_X, /* 0xe8 Y */ 0, + /* 0xe9 Z */ -ESC_Z, /* 0xea */ ESCAPES_FIRST+0x69, + /* 0xeb */ ESCAPES_FIRST+0x6a, /* 0xec */ ESCAPES_FIRST+0x6b, + /* 0xed */ ESCAPES_FIRST+0x6c, /* 0xee */ ESCAPES_FIRST+0x6d, + /* 0xef */ ESCAPES_FIRST+0x6e, /* 0xf0 0 */ 0, + /* 0xf1 1 */ 0, /* 0xf2 2 */ 0, + /* 0xf3 3 */ 0, /* 0xf4 4 */ 0, + /* 0xf5 5 */ 0, /* 0xf6 6 */ 0, + /* 0xf7 7 */ 0, /* 0xf8 8 */ 0, + /* 0xf9 9 */ 0, }; /* We also need a table of characters that may follow \c in an EBCDIC environment for characters 0-31. */ -static unsigned char ebcdic_escape_c[] = "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"; +static unsigned char ebcdic_escape_c[] = { + CHAR_COMMERCIAL_AT, CHAR_A, CHAR_B, CHAR_C, CHAR_D, CHAR_E, CHAR_F, CHAR_G, + CHAR_H, CHAR_I, CHAR_J, CHAR_K, CHAR_L, CHAR_M, CHAR_N, CHAR_O, CHAR_P, + CHAR_Q, CHAR_R, CHAR_S, CHAR_T, CHAR_U, CHAR_V, CHAR_W, CHAR_X, CHAR_Y, + CHAR_Z, CHAR_LEFT_SQUARE_BRACKET, CHAR_BACKSLASH, CHAR_RIGHT_SQUARE_BRACKET, + CHAR_CIRCUMFLEX_ACCENT, CHAR_UNDERSCORE +}; #endif /* EBCDIC */ @@ -656,6 +575,8 @@ static const char alasnames[] = STRING_non_atomic_positive_lookbehind0 STRING_negative_lookahead0 STRING_negative_lookbehind0 + STRING_scs0 + STRING_scan_substring0 STRING_atomic0 STRING_sr0 STRING_asr0 @@ -675,6 +596,8 @@ static const alasitem alasmeta[] = { { 30, META_LOOKBEHIND_NA }, { 18, META_LOOKAHEADNOT }, { 19, META_LOOKBEHINDNOT }, + { 3, META_SCS }, + { 14, META_SCS }, { 6, META_ATOMIC }, { 2, META_SCRIPT_RUN }, /* sr = script run */ { 3, META_ATOMIC_SCRIPT_RUN }, /* asr = atomic script run */ @@ -694,8 +617,11 @@ static uint32_t chartypeoffset[] = { now all in a single string, to reduce the number of relocations when a shared library is dynamically loaded. The list of lengths is terminated by a zero length entry. The first three must be alpha, lower, upper, as this is assumed -for handling case independence. The indices for several classes are needed, so -identify them. */ +for handling case independence. + +The indices for several classes are stored in pcre2_compile.h - these must +be kept in sync with posix_names, posix_name_lengths, posix_class_maps, +and posix_substitutes. */ static const char posix_names[] = STRING_alpha0 STRING_lower0 STRING_upper0 STRING_alnum0 @@ -706,12 +632,6 @@ static const char posix_names[] = static const uint8_t posix_name_lengths[] = { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 6, 0 }; -#define PC_DIGIT 7 -#define PC_GRAPH 8 -#define PC_PRINT 9 -#define PC_PUNCT 10 -#define PC_XDIGIT 13 - /* Table of class bit maps for each POSIX class. Each class is formed from a base map, with an optional addition or removal of another map. Then, for some classes, there is some additional tweaking: for [:blank:] the vertical space @@ -722,7 +642,7 @@ addition or a negative value for map subtraction (if there are two maps). The absolute value of the third field has these meanings: 0 => no tweaking, 1 => remove vertical space characters, 2 => remove underscore. */ -static const int posix_class_maps[] = { +const int PRIV(posix_class_maps)[] = { cbit_word, cbit_digit, -2, /* alpha */ cbit_lower, -1, 0, /* lower */ cbit_upper, -1, 0, /* upper */ @@ -760,7 +680,6 @@ static int posix_substitutes[] = { PT_WORD, 0, /* word */ /* Perl and POSIX space are the same */ PT_PXXDIGIT, 0 /* xdigit */ /* Perl has additional hex digits */ }; -#define POSIX_SUBSIZE (sizeof(posix_substitutes) / (2*sizeof(uint32_t))) #endif /* SUPPORT_UNICODE */ /* Masks for checking option settings. When PCRE2_LITERAL is set, only a subset @@ -778,10 +697,11 @@ are allowed. */ PCRE2_EXTENDED|PCRE2_EXTENDED_MORE|PCRE2_MATCH_UNSET_BACKREF| \ PCRE2_MULTILINE|PCRE2_NEVER_BACKSLASH_C|PCRE2_NEVER_UCP| \ PCRE2_NEVER_UTF|PCRE2_NO_AUTO_CAPTURE|PCRE2_NO_AUTO_POSSESS| \ - PCRE2_NO_DOTSTAR_ANCHOR|PCRE2_UCP|PCRE2_UNGREEDY) + PCRE2_NO_DOTSTAR_ANCHOR|PCRE2_UCP|PCRE2_UNGREEDY|PCRE2_ALT_EXTENDED_CLASS) #define PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS \ - (PCRE2_EXTRA_MATCH_LINE|PCRE2_EXTRA_MATCH_WORD|PCRE2_EXTRA_CASELESS_RESTRICT) + (PCRE2_EXTRA_MATCH_LINE|PCRE2_EXTRA_MATCH_WORD| \ + PCRE2_EXTRA_CASELESS_RESTRICT|PCRE2_EXTRA_TURKISH_CASING) #define PUBLIC_COMPILE_EXTRA_OPTIONS \ (PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS| \ @@ -789,27 +709,8 @@ are allowed. */ PCRE2_EXTRA_ESCAPED_CR_IS_LF|PCRE2_EXTRA_ALT_BSUX| \ PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK|PCRE2_EXTRA_ASCII_BSD| \ PCRE2_EXTRA_ASCII_BSS|PCRE2_EXTRA_ASCII_BSW|PCRE2_EXTRA_ASCII_POSIX| \ - PCRE2_EXTRA_ASCII_DIGIT) - -/* Compile time error code numbers. They are given names so that they can more -easily be tracked. When a new number is added, the tables called eint1 and -eint2 in pcre2posix.c may need to be updated, and a new error text must be -added to compile_error_texts in pcre2_error.c. Also, the error codes in -pcre2.h.in must be updated - their values are exactly 100 greater than these -values. */ - -enum { ERR0 = COMPILE_ERROR_BASE, - ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9, ERR10, - ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19, ERR20, - ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR28, ERR29, ERR30, - ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39, ERR40, - ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49, ERR50, - ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59, ERR60, - ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69, ERR70, - ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79, ERR80, - ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERR88, ERR89, ERR90, - ERR91, ERR92, ERR93, ERR94, ERR95, ERR96, ERR97, ERR98, ERR99, ERR100, - ERR101 }; + PCRE2_EXTRA_ASCII_DIGIT|PCRE2_EXTRA_PYTHON_OCTAL|PCRE2_EXTRA_NO_BS0| \ + PCRE2_EXTRA_NEVER_CALLOUT) /* This is a table of start-of-pattern options such as (*UTF) and settings such as (*LIMIT_MATCH=nnnn) and (*CRLF). For completeness and backward @@ -817,16 +718,18 @@ compatibility, (*UTFn) is supported in the relevant libraries, but (*UTF) is generic and always supported. */ enum { PSO_OPT, /* Value is an option bit */ + PSO_XOPT, /* Value is an xoption bit */ PSO_FLG, /* Value is a flag bit */ PSO_NL, /* Value is a newline type */ PSO_BSR, /* Value is a \R type */ PSO_LIMH, /* Read integer value for heap limit */ PSO_LIMM, /* Read integer value for match limit */ - PSO_LIMD /* Read integer value for depth limit */ + PSO_LIMD, /* Read integer value for depth limit */ + PSO_OPTMZ /* Value is an optimization bit */ }; typedef struct pso { - const uint8_t *name; + const char *name; uint16_t length; uint16_t type; uint32_t value; @@ -835,27 +738,29 @@ typedef struct pso { /* NB: STRING_UTFn_RIGHTPAR contains the length as well */ static const pso pso_list[] = { - { (uint8_t *)STRING_UTFn_RIGHTPAR, PSO_OPT, PCRE2_UTF }, - { (uint8_t *)STRING_UTF_RIGHTPAR, 4, PSO_OPT, PCRE2_UTF }, - { (uint8_t *)STRING_UCP_RIGHTPAR, 4, PSO_OPT, PCRE2_UCP }, - { (uint8_t *)STRING_NOTEMPTY_RIGHTPAR, 9, PSO_FLG, PCRE2_NOTEMPTY_SET }, - { (uint8_t *)STRING_NOTEMPTY_ATSTART_RIGHTPAR, 17, PSO_FLG, PCRE2_NE_ATST_SET }, - { (uint8_t *)STRING_NO_AUTO_POSSESS_RIGHTPAR, 16, PSO_OPT, PCRE2_NO_AUTO_POSSESS }, - { (uint8_t *)STRING_NO_DOTSTAR_ANCHOR_RIGHTPAR, 18, PSO_OPT, PCRE2_NO_DOTSTAR_ANCHOR }, - { (uint8_t *)STRING_NO_JIT_RIGHTPAR, 7, PSO_FLG, PCRE2_NOJIT }, - { (uint8_t *)STRING_NO_START_OPT_RIGHTPAR, 13, PSO_OPT, PCRE2_NO_START_OPTIMIZE }, - { (uint8_t *)STRING_LIMIT_HEAP_EQ, 11, PSO_LIMH, 0 }, - { (uint8_t *)STRING_LIMIT_MATCH_EQ, 12, PSO_LIMM, 0 }, - { (uint8_t *)STRING_LIMIT_DEPTH_EQ, 12, PSO_LIMD, 0 }, - { (uint8_t *)STRING_LIMIT_RECURSION_EQ, 16, PSO_LIMD, 0 }, - { (uint8_t *)STRING_CR_RIGHTPAR, 3, PSO_NL, PCRE2_NEWLINE_CR }, - { (uint8_t *)STRING_LF_RIGHTPAR, 3, PSO_NL, PCRE2_NEWLINE_LF }, - { (uint8_t *)STRING_CRLF_RIGHTPAR, 5, PSO_NL, PCRE2_NEWLINE_CRLF }, - { (uint8_t *)STRING_ANY_RIGHTPAR, 4, PSO_NL, PCRE2_NEWLINE_ANY }, - { (uint8_t *)STRING_NUL_RIGHTPAR, 4, PSO_NL, PCRE2_NEWLINE_NUL }, - { (uint8_t *)STRING_ANYCRLF_RIGHTPAR, 8, PSO_NL, PCRE2_NEWLINE_ANYCRLF }, - { (uint8_t *)STRING_BSR_ANYCRLF_RIGHTPAR, 12, PSO_BSR, PCRE2_BSR_ANYCRLF }, - { (uint8_t *)STRING_BSR_UNICODE_RIGHTPAR, 12, PSO_BSR, PCRE2_BSR_UNICODE } + { STRING_UTFn_RIGHTPAR, PSO_OPT, PCRE2_UTF }, + { STRING_UTF_RIGHTPAR, 4, PSO_OPT, PCRE2_UTF }, + { STRING_UCP_RIGHTPAR, 4, PSO_OPT, PCRE2_UCP }, + { STRING_NOTEMPTY_RIGHTPAR, 9, PSO_FLG, PCRE2_NOTEMPTY_SET }, + { STRING_NOTEMPTY_ATSTART_RIGHTPAR, 17, PSO_FLG, PCRE2_NE_ATST_SET }, + { STRING_NO_AUTO_POSSESS_RIGHTPAR, 16, PSO_OPTMZ, PCRE2_OPTIM_AUTO_POSSESS }, + { STRING_NO_DOTSTAR_ANCHOR_RIGHTPAR, 18, PSO_OPTMZ, PCRE2_OPTIM_DOTSTAR_ANCHOR }, + { STRING_NO_JIT_RIGHTPAR, 7, PSO_FLG, PCRE2_NOJIT }, + { STRING_NO_START_OPT_RIGHTPAR, 13, PSO_OPTMZ, PCRE2_OPTIM_START_OPTIMIZE }, + { STRING_CASELESS_RESTRICT_RIGHTPAR, 18, PSO_XOPT, PCRE2_EXTRA_CASELESS_RESTRICT }, + { STRING_TURKISH_CASING_RIGHTPAR, 15, PSO_XOPT, PCRE2_EXTRA_TURKISH_CASING }, + { STRING_LIMIT_HEAP_EQ, 11, PSO_LIMH, 0 }, + { STRING_LIMIT_MATCH_EQ, 12, PSO_LIMM, 0 }, + { STRING_LIMIT_DEPTH_EQ, 12, PSO_LIMD, 0 }, + { STRING_LIMIT_RECURSION_EQ, 16, PSO_LIMD, 0 }, + { STRING_CR_RIGHTPAR, 3, PSO_NL, PCRE2_NEWLINE_CR }, + { STRING_LF_RIGHTPAR, 3, PSO_NL, PCRE2_NEWLINE_LF }, + { STRING_CRLF_RIGHTPAR, 5, PSO_NL, PCRE2_NEWLINE_CRLF }, + { STRING_ANY_RIGHTPAR, 4, PSO_NL, PCRE2_NEWLINE_ANY }, + { STRING_NUL_RIGHTPAR, 4, PSO_NL, PCRE2_NEWLINE_NUL }, + { STRING_ANYCRLF_RIGHTPAR, 8, PSO_NL, PCRE2_NEWLINE_ANYCRLF }, + { STRING_BSR_ANYCRLF_RIGHTPAR, 12, PSO_BSR, PCRE2_BSR_ANYCRLF }, + { STRING_BSR_UNICODE_RIGHTPAR, 12, PSO_BSR, PCRE2_BSR_UNICODE } }; /* This table is used when converting repeating opcodes into possessified @@ -910,12 +815,15 @@ static const uint8_t opcode_possessify[] = { OP_CRPOSRANGE, 0, /* CRRANGE, CRMINRANGE */ 0, 0, 0, 0, /* CRPOS{STAR,PLUS,QUERY,RANGE} */ - 0, 0, 0, /* CLASS, NCLASS, XCLASS */ + 0, 0, 0, 0, /* CLASS, NCLASS, XCLASS, ECLASS */ 0, 0, /* REF, REFI */ 0, 0, /* DNREF, DNREFI */ - 0, 0 /* RECURSE, CALLOUT */ + 0, 0, /* RECURSE, CALLOUT */ }; +/* Compile-time check that the table has the correct size. */ +STATIC_ASSERT(sizeof(opcode_possessify) == OP_CALLOUT+1, opcode_possessify); + #ifdef DEBUG_SHOW_PARSED /************************************************* @@ -977,7 +885,7 @@ for (;;) { uint32_t ptype = *pptr >> 16; uint32_t pvalue = *pptr++ & 0xffff; - fprintf(stderr, "META \\%c %d %d", (meta_arg == ESC_P)? 'P':'p', + fprintf(stderr, "META \\%c %d %d", (meta_arg == ESC_P)? CHAR_P:CHAR_p, ptype, pvalue); } else @@ -1152,6 +1060,24 @@ for (;;) fprintf(stderr, "%zd", offset); break; + case META_OFFSET: + fprintf(stderr, "META_OFFSET offset="); + GETOFFSET(offset, pptr); + fprintf(stderr, "%zd", offset); + break; + + case META_SCS: + fprintf(stderr, "META (*scan_substring:"); + break; + + case META_CAPTURE_NAME: + fprintf(stderr, "META_CAPTURE_NAME length=%d relative_offset=%d", *pptr++, (int)meta_arg); + break; + + case META_CAPTURE_NUMBER: + fprintf(stderr, "META_CAPTURE_NUMBER %d relative_offset=%d", *pptr++, (int)meta_arg); + break; + case META_MARK: fprintf(stderr, "META (*MARK:"); goto SHOWARG; @@ -1180,6 +1106,12 @@ for (;;) } fprintf(stderr, ") length=%u", length); break; + + case META_ECLASS_AND: fprintf(stderr, "META_ECLASS_AND"); break; + case META_ECLASS_OR: fprintf(stderr, "META_ECLASS_OR"); break; + case META_ECLASS_SUB: fprintf(stderr, "META_ECLASS_SUB"); break; + case META_ECLASS_XOR: fprintf(stderr, "META_ECLASS_XOR"); break; + case META_ECLASS_NOT: fprintf(stderr, "META_ECLASS_NOT"); break; } fprintf(stderr, "\n"); } @@ -1199,7 +1131,7 @@ associated JIT data. */ PCRE2_EXP_DEFN pcre2_code * PCRE2_CALL_CONVENTION pcre2_code_copy(const pcre2_code *code) { -PCRE2_SIZE* ref_count; +PCRE2_SIZE *ref_count; pcre2_code *newcode; if (code == NULL) return NULL; @@ -1311,7 +1243,10 @@ result must be greater than zero. ptrptr points to the character pointer variable ptrend points to the end of the input string allow_sign if < 0, sign not allowed; if >= 0, sign is relative to this - max_value the largest number allowed + max_value the largest number allowed; + you must not pass a value for max_value larger than + INT_MAX/10 - 1 because this function relies on max_value to + avoid integer overflow max_error the error to give for an over-large number intptr where to put the result errcodeptr where to put an error code @@ -1330,6 +1265,8 @@ uint32_t n = 0; PCRE2_SPTR ptr = *ptrptr; BOOL yield = FALSE; +PCRE2_ASSERT(max_value <= INT_MAX/10 - 1); + *errorcodeptr = 0; if (allow_sign >= 0 && ptr < ptrend) @@ -1350,10 +1287,11 @@ if (allow_sign >= 0 && ptr < ptrend) if (ptr >= ptrend || !IS_DIGIT(*ptr)) return FALSE; while (ptr < ptrend && IS_DIGIT(*ptr)) { - n = n * 10 + *ptr++ - CHAR_0; + n = n * 10 + (*ptr++ - CHAR_0); if (n > max_value) { *errorcodeptr = max_error; + while (ptr < ptrend && IS_DIGIT(*ptr)) ptr++; goto EXIT; } } @@ -1367,7 +1305,7 @@ if (allow_sign >= 0 && sign != 0) } if (sign > 0) n += allow_sign; - else if ((int)n > allow_sign) + else if (n > (uint32_t)allow_sign) { *errorcodeptr = ERR15; /* Non-existent subpattern */ goto EXIT; @@ -1454,7 +1392,7 @@ else if (pp >= ptrend || *pp != CHAR_RIGHT_CURLY_BRACKET) return FALSE; } -/* Now process the quantifier for real. We know it must be {n} or (n,} or {,m} +/* Now process the quantifier for real. We know it must be {n} or {n,} or {,m} or {n,m}. The only error that read_number() can return is for a number that is too big. If *errorcodeptr is returned as zero it means no number was found. */ @@ -1521,15 +1459,15 @@ return yield; /* This function is called when a \ has been encountered. It either returns a positive value for a simple escape such as \d, or 0 for a data character, which -is placed in chptr. A backreference to group n is returned as negative n. On +is placed in chptr. A backreference to group n is returned as -(n+1). On entry, ptr is pointing at the character after \. On exit, it points after the final code unit of the escape sequence. This function is also called from pcre2_substitute() to handle escape sequences in replacement strings. In this case, the cb argument is NULL, and in the case of escapes that have further processing, only sequences that define a data -character are recognised. The isclass argument is not relevant; the options -argument is the final value of the compiled pattern's options. +character are recognised. The options argument is the final value of the +compiled pattern's options. Arguments: ptrptr points to the input position pointer @@ -1538,7 +1476,8 @@ argument is the final value of the compiled pattern's options. errorcodeptr points to the errorcode variable (containing zero) options the current options bits xoptions the current extra options bits - isclass TRUE if inside a character class + bracount the number of capturing parentheses encountered so far + isclass TRUE if in a character class cb compile data block or NULL when called from pcre2_substitute() Returns: zero => a data character @@ -1549,8 +1488,8 @@ Returns: zero => a data character int PRIV(check_escape)(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, uint32_t *chptr, - int *errorcodeptr, uint32_t options, uint32_t xoptions, BOOL isclass, - compile_block *cb) + int *errorcodeptr, uint32_t options, uint32_t xoptions, uint32_t bracount, + BOOL isclass, compile_block *cb) { BOOL utf = (options & PCRE2_UTF) != 0; BOOL alt_bsux = @@ -1619,17 +1558,31 @@ else if ((i = escapes[c - ESCAPES_FIRST]) != 0) if (ptrend - p > 1 && *p == CHAR_U && p[1] == CHAR_PLUS) { -#ifdef EBCDIC - *errorcodeptr = ERR93; -#else +#ifndef EBCDIC if (utf) { ptr = p + 2; escape = 0; /* Not a fancy escape after all */ goto COME_FROM_NU; } - else *errorcodeptr = ERR93; #endif + + /* Improve error offset. */ + ptr = p + 2; + while (ptr < ptrend && XDIGIT(*ptr) != 0xff) ptr++; + while (ptr < ptrend && (*ptr == CHAR_SPACE || *ptr == CHAR_HT)) ptr++; + if (ptr < ptrend && *ptr == CHAR_RIGHT_CURLY_BRACKET) ptr++; + + *errorcodeptr = ERR93; + } + + /* Give an error in contexts where quantifiers are not allowed + (character classes; substitution strings). */ + + else if (isclass || cb == NULL) + { + ptr++; /* Skip over the opening brace */ + *errorcodeptr = ERR37; } /* Give an error if what follows is not a quantifier, but don't override @@ -1639,7 +1592,10 @@ else if ((i = escapes[c - ESCAPES_FIRST]) != 0) { if (!read_repeat_counts(&p, ptrend, NULL, NULL, errorcodeptr) && *errorcodeptr == 0) + { + ptr++; /* Skip over the opening brace */ *errorcodeptr = ERR37; + } } } } @@ -1660,10 +1616,11 @@ else if (cb == NULL) { - if (c != CHAR_c && c != CHAR_o && c != CHAR_x) + if (!(c >= CHAR_0 && c <= CHAR_9) && c != CHAR_c && c != CHAR_o && + c != CHAR_x && c != CHAR_g) { *errorcodeptr = ERR3; - return 0; + goto EXIT; } alt_bsux = FALSE; /* Do not modify \x handling */ } @@ -1688,7 +1645,9 @@ else because otherwise \u{ 12} (for example) would be treated as u{12}. */ case CHAR_u: - if (!alt_bsux) *errorcodeptr = ERR37; else + if (!alt_bsux) + *errorcodeptr = ERR37; + else { uint32_t xc; @@ -1715,6 +1674,7 @@ else hptr >= ptrend || /* Hit end of input */ *hptr != CHAR_RIGHT_CURLY_BRACKET) /* No } terminator */ { + if (isclass) break; /* In a class, just treat as '\u' literal */ escape = ESC_ub; /* Special return */ ptr++; /* Skip { */ break; /* Hex escape not recognized */ @@ -1773,8 +1733,14 @@ else (possibly recursive) subroutine calls, _not_ backreferences. We return the ESC_g code. - Summary: Return a negative number for a numerical back reference, ESC_k for - a named back reference, and ESC_g for a named or numbered subroutine call. + Summary: Return a negative number for a numerical back reference (offset + by 1), ESC_k for a named back reference, and ESC_g for a named or + numbered subroutine call. + + The above describes the \g behaviour inside patterns. Inside replacement + strings (pcre2_substitute) we support only \g for Python + compatibility. Return ESG_g for the named case, and -(num+1) for the + numbered case. */ case CHAR_g: @@ -1786,6 +1752,40 @@ else break; } + if (cb == NULL) + { + PCRE2_SPTR p; + /* Substitution strings */ + if (*ptr != CHAR_LESS_THAN_SIGN) + { + *errorcodeptr = ERR57; + break; + } + + p = ptr + 1; + + if (!read_number(&p, ptrend, -1, MAX_GROUP_NUMBER, ERR61, &s, + errorcodeptr)) + { + if (*errorcodeptr == 0) escape = ESC_g; /* No number found */ + break; + } + + if (p >= ptrend || *p != CHAR_GREATER_THAN_SIGN) + { + ptr = p; + *errorcodeptr = ERR119; /* Missing terminator for number */ + break; + } + + /* This is the reason that back references are returned as -(s+1) rather + than just -s. In a pattern, \0 is not a back reference, but \g<0> is + valid in a substitution string, so this must be representable. */ + ptr = p + 1; + escape = -(s+1); + break; + } + if (*ptr == CHAR_LESS_THAN_SIGN || *ptr == CHAR_APOSTROPHE) { escape = ESC_g; @@ -1800,7 +1800,7 @@ else PCRE2_SPTR p = ptr + 1; while (p < ptrend && (*p == CHAR_SPACE || *p == CHAR_HT)) p++; - if (!read_number(&p, ptrend, cb->bracount, MAX_GROUP_NUMBER, ERR61, &s, + if (!read_number(&p, ptrend, bracount, MAX_GROUP_NUMBER, ERR61, &s, errorcodeptr)) { if (*errorcodeptr == 0) escape = ESC_k; /* No number found */ @@ -1810,7 +1810,8 @@ else if (p >= ptrend || *p != CHAR_RIGHT_CURLY_BRACKET) { - *errorcodeptr = ERR57; + ptr = p; + *errorcodeptr = ERR119; /* Missing terminator for number */ break; } ptr = p + 1; @@ -1820,7 +1821,7 @@ else else { - if (!read_number(&ptr, ptrend, cb->bracount, MAX_GROUP_NUMBER, ERR61, &s, + if (!read_number(&ptr, ptrend, bracount, MAX_GROUP_NUMBER, ERR61, &s, errorcodeptr)) { if (*errorcodeptr == 0) *errorcodeptr = ERR57; /* No number found */ @@ -1834,7 +1835,7 @@ else break; } - escape = -s; + escape = -(s+1); break; /* The handling of escape sequences consisting of a string of digits @@ -1846,7 +1847,16 @@ else number is less than 10, or if there are that many previous extracting left brackets, it is a back reference. Otherwise, up to three octal digits are read to form an escaped character code. Thus \123 is likely to be octal 123 - (cf \0123, which is octal 012 followed by the literal 3). + (cf \0123, which is octal 012 followed by the literal 3). This is the "Perl + style" of handling ambiguous octal/backrefences such as \12. + + There is an alternative disambiguation strategy, selected by + PCRE2_EXTRA_PYTHON_OCTAL, which follows Python's behaviour. An octal must + have either a leading zero, or exactly three octal digits; otherwise it's + a backreference. The disambiguation is stable, and does not depend on how + many capture groups are defined (it's simply an invalid backreference if + there is no corresponding capture group). Additionally, octal values above + \377 (\xff) are rejected. Inside a character class, \ followed by a digit is always either a literal 8 or 9 or an octal number. */ @@ -1854,24 +1864,65 @@ else case CHAR_1: case CHAR_2: case CHAR_3: case CHAR_4: case CHAR_5: case CHAR_6: case CHAR_7: case CHAR_8: case CHAR_9: - if (!isclass) + if (isclass) + { + /* Fall through to octal handling; never a backreference inside a class. */ + } + else if ((xoptions & PCRE2_EXTRA_PYTHON_OCTAL) != 0) + { + /* Python-style disambiguation. */ + if (ptr[-1] <= CHAR_7 && ptr + 1 < ptrend && ptr[0] >= CHAR_0 && + ptr[0] <= CHAR_7 && ptr[1] >= CHAR_0 && ptr[1] <= CHAR_7) + { + /* We peeked a three-digit octal, so fall through */ + } + else + { + /* We are at a digit, so the only possible error from read_number() is + a number that is too large. */ + ptr--; /* Back to the digit */ + + if (!read_number(&ptr, ptrend, -1, MAX_GROUP_NUMBER, 0, &s, errorcodeptr)) + { + *errorcodeptr = ERR61; + break; + } + + escape = -(s+1); + break; + } + } + else { + /* Perl-style disambiguation. */ oldptr = ptr; ptr--; /* Back to the digit */ /* As we know we are at a digit, the only possible error from - read_number() is a number that is too large to be a group number. In this - case we fall through handle this as not a group reference. If we have - read a small enough number, check for a back reference. + read_number() is a number that is too large to be a group number. Because + that number might be still valid if read as an octal, errorcodeptr is not + set on failure and therefore a sentinel value of INT_MAX is used instead + of the original value, and will be used later to properly set the error, + if not falling through. */ - \1 to \9 are always back references. \8x and \9x are too; \1x to \7x + if (!read_number(&ptr, ptrend, -1, MAX_GROUP_NUMBER, 0, &s, errorcodeptr)) + s = INT_MAX; + + /* \1 to \9 are always back references. \8x and \9x are too; \1x to \7x are octal escapes if there are not that many previous captures. */ - if (read_number(&ptr, ptrend, -1, INT_MAX/10 - 1, 0, &s, errorcodeptr) && - (s < 10 || oldptr[-1] >= CHAR_8 || s <= (int)cb->bracount)) + if (s < 10 || c >= CHAR_8 || (unsigned)s <= bracount) { - if (s > (int)MAX_GROUP_NUMBER) *errorcodeptr = ERR61; - else escape = -s; /* Indicates a back reference */ + /* s > MAX_GROUP_NUMBER should not be possible because of read_number(), + but we keep it just to be safe and because it will also catch the + sentinel value that was set on failure by that function. */ + + if ((unsigned)s > MAX_GROUP_NUMBER) + { + PCRE2_ASSERT(s == INT_MAX); + *errorcodeptr = ERR61; + } + else escape = -(s+1); /* Indicates a back reference */ break; } @@ -1885,21 +1936,31 @@ else if (c >= CHAR_8) break; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* \0 always starts an octal number, but we may drop through to here with a larger first octal digit. The original code used just to take the least significant 8 bits of octal numbers (I think this is what early Perls used - to do). Nowadays we allow for larger numbers in UTF-8 mode and 16-bit mode, + to do). Nowadays we allow for larger numbers in UTF-8 mode and 16/32-bit mode, but no more than 3 octal digits. */ case CHAR_0: c -= CHAR_0; while(i++ < 2 && ptr < ptrend && *ptr >= CHAR_0 && *ptr <= CHAR_7) c = c * 8 + *ptr++ - CHAR_0; + if (c > 0xff) + { + if ((xoptions & PCRE2_EXTRA_PYTHON_OCTAL) != 0) *errorcodeptr = ERR102; #if PCRE2_CODE_UNIT_WIDTH == 8 - if (!utf && c > 0xff) *errorcodeptr = ERR51; + else if (!utf) *errorcodeptr = ERR51; #endif + } + + /* PCRE2_EXTRA_NO_BS0 disables the NUL escape '\0' but doesn't affect + two- or three-character octal escapes \00 and \000, nor \x00. */ + + if ((xoptions & PCRE2_EXTRA_NO_BS0) != 0 && c == 0 && i == 1) + *errorcodeptr = ERR98; break; /* \o is a relatively new Perl feature, supporting a more general way of @@ -1907,12 +1968,12 @@ else with optional spaces or tabs after { and before }. */ case CHAR_o: - if (ptr >= ptrend || *ptr++ != CHAR_LEFT_CURLY_BRACKET) + if (ptr >= ptrend || *ptr != CHAR_LEFT_CURLY_BRACKET) { - ptr--; *errorcodeptr = ERR55; break; } + ptr++; while (ptr < ptrend && (*ptr == CHAR_SPACE || *ptr == CHAR_HT)) ptr++; if (ptr >= ptrend || *ptr == CHAR_RIGHT_CURLY_BRACKET) @@ -1928,7 +1989,7 @@ else cc = *ptr++; if (c == 0 && cc == CHAR_0) continue; /* Leading zeroes */ #if PCRE2_CODE_UNIT_WIDTH == 32 - if (c >= 0x20000000l) { overflow = TRUE; break; } + if (c >= 0x20000000u) { overflow = TRUE; break; } #endif c = (c << 3) + (cc - CHAR_0); #if PCRE2_CODE_UNIT_WIDTH == 8 @@ -1947,19 +2008,19 @@ else while (ptr < ptrend && *ptr >= CHAR_0 && *ptr <= CHAR_7) ptr++; *errorcodeptr = ERR34; } - else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET) + else if (utf && c >= 0xd800 && c <= 0xdfff && + (xoptions & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) { - if (utf && c >= 0xd800 && c <= 0xdfff && - (xoptions & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) - { - ptr--; - *errorcodeptr = ERR73; - } + *errorcodeptr = ERR73; + } + else if (ptr < ptrend && *ptr == CHAR_RIGHT_CURLY_BRACKET) + { + ptr++; } else { - ptr--; *errorcodeptr = ERR64; + if (ptr < ptrend) goto ESCAPE_FAILED_FORWARD; } break; @@ -2028,14 +2089,14 @@ else while (ptr < ptrend && XDIGIT(*ptr) != 0xff) ptr++; *errorcodeptr = ERR34; } - else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET) + else if (utf && c >= 0xd800 && c <= 0xdfff && + (xoptions & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) { - if (utf && c >= 0xd800 && c <= 0xdfff && - (xoptions & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) - { - ptr--; - *errorcodeptr = ERR73; - } + *errorcodeptr = ERR73; + } + else if (ptr < ptrend && *ptr == CHAR_RIGHT_CURLY_BRACKET) + { + ptr++; } /* If the sequence of hex digits (followed by optional space) does not @@ -2045,8 +2106,8 @@ else else { - ptr--; *errorcodeptr = ERR67; + if (ptr < ptrend) goto ESCAPE_FAILED_FORWARD; } } /* End of \x{} processing */ @@ -2054,10 +2115,29 @@ else else { - c = 0; - if (ptr >= ptrend || (cc = XDIGIT(*ptr)) == 0xff) break; /* Not a hex digit */ + /* Perl has the surprising/broken behaviour that \x without following + hex digits is treated as an escape for NUL. Their source code laments + this but keeps it for backwards compatibility. A warning is printed + when "use warnings" is enabled. Because we don't have warnings, we + simply forbid it. */ + if (ptr >= ptrend || (cc = XDIGIT(*ptr)) == 0xff) + { + /* Not a hex digit */ + *errorcodeptr = ERR78; + break; + } ptr++; c = cc; + + /* With "use re 'strict'" Perl actually requires exactly two digits (error + for \x, \xA and \xAAA). While \x was already rejected, this seems overly + strict, and there seems little incentive to align with that, given the + backwards-compatibility cost. + + For comparison, note that other engines disagree. For example: + - Java allows 1 or 2 hex digits. Error if 0 digits. No error if >2 digits + - .NET requires 2 hex digits. Error if 0, 1 digits. No error if >2 digits. + */ if (ptr >= ptrend || (cc = XDIGIT(*ptr)) == 0xff) break; /* Not a hex digit */ ptr++; c = (c << 4) | cc; @@ -2079,11 +2159,7 @@ else For testing the EBCDIC handling of \c in an ASCII environment, recognize the EBCDIC value of 'c' explicitly. */ -#if defined EBCDIC && 'a' != 0x81 - case 0x83: -#else case CHAR_c: -#endif if (ptr >= ptrend) { *errorcodeptr = ERR2; @@ -2098,7 +2174,7 @@ else if (c < 32 || c > 126) /* Excludes all non-printable ASCII */ { *errorcodeptr = ERR68; - break; + goto ESCAPE_FAILED_FORWARD; } c ^= 0x40; @@ -2109,14 +2185,20 @@ else #else if (c == CHAR_QUESTION_MARK) - c = ('\\' == 188 && '`' == 74)? 0x5f : 0xff; + c = (CHAR_BACKSLASH == 188 && CHAR_GRAVE_ACCENT == 74)? 0x5f : 0xff; else { for (i = 0; i < 32; i++) { if (c == ebcdic_escape_c[i]) break; } - if (i < 32) c = i; else *errorcodeptr = ERR68; + if (i < 32) + c = i; + else + { + *errorcodeptr = ERR68; + goto ESCAPE_FAILED_FORWARD; + } } #endif /* EBCDIC */ @@ -2128,16 +2210,25 @@ else default: *errorcodeptr = ERR3; - *ptrptr = ptr - 1; /* Point to the character at fault */ - return 0; + break; } } /* Set the pointer to the next character before returning. */ +EXIT: *ptrptr = ptr; *chptr = c; return escape; + +/* Some errors need to indicate the next character. */ + +ESCAPE_FAILED_FORWARD: +ptr++; +#ifdef SUPPORT_UNICODE +if (utf) FORWARDCHARTEST(ptr, ptrend); +#endif +goto EXIT; } @@ -2154,6 +2245,7 @@ after the final code unit of the escape sequence. Arguments: ptrptr the pattern position pointer + utf true if the input is UTF-encoded negptr a boolean that is set TRUE for negation else FALSE ptypeptr an unsigned int that is set to the type value pdataptr an unsigned int that is set to the detailed property value @@ -2164,52 +2256,84 @@ Returns: TRUE if the type value was found, or FALSE for an invalid type */ static BOOL -get_ucp(PCRE2_SPTR *ptrptr, BOOL *negptr, uint16_t *ptypeptr, +get_ucp(PCRE2_SPTR *ptrptr, BOOL utf, BOOL *negptr, uint16_t *ptypeptr, uint16_t *pdataptr, int *errorcodeptr, compile_block *cb) { -PCRE2_UCHAR c; -PCRE2_SIZE i, bot, top; +uint32_t c; +ptrdiff_t i; +PCRE2_SIZE bot, top; PCRE2_SPTR ptr = *ptrptr; PCRE2_UCHAR name[50]; PCRE2_UCHAR *vptr = NULL; uint16_t ptscript = PT_NOTSCRIPT; +#ifndef MAYBE_UTF_MULTI +(void)utf; /* Avoid compiler warning */ +#endif + if (ptr >= cb->end_pattern) goto ERROR_RETURN; -c = *ptr++; +GETCHARINCTEST(c, ptr); *negptr = FALSE; /* \P or \p can be followed by a name in {}, optionally preceded by ^ for -negation. */ +negation. We must be handling Unicode encoding here, though we may be compiling +for UTF-8 input in an EBCDIC environment. (PCRE2 does not support both EBCDIC +input and Unicode input in the same build.) In accordance with Unicode's "loose +matching" rules, ASCII white space, hyphens, and underscores are ignored. We +don't use isspace() or tolower() because (a) code points may be greater than +255, and (b) they wouldn't work when compiling for Unicode in an EBCDIC +environment. */ if (c == CHAR_LEFT_CURLY_BRACKET) { if (ptr >= cb->end_pattern) goto ERROR_RETURN; - if (*ptr == CHAR_CIRCUMFLEX_ACCENT) - { - *negptr = TRUE; - ptr++; - } - for (i = 0; i < (int)(sizeof(name) / sizeof(PCRE2_UCHAR)) - 1; i++) { + REDO: + if (ptr >= cb->end_pattern) goto ERROR_RETURN; - c = *ptr++; -#if PCRE2_CODE_UNIT_WIDTH != 8 - while (c == '_' || c == '-' || (c <= 0xff && isspace(c))) -#else - while (c == '_' || c == '-' || isspace(c)) -#endif + GETCHARINCTEST(c, ptr); + + /* Skip ignorable Unicode characters. */ + + if (c == CHAR_UNDERSCORE || c == CHAR_MINUS || c == CHAR_SPACE || + (c >= CHAR_HT && c <= CHAR_CR)) { - if (ptr >= cb->end_pattern) goto ERROR_RETURN; - c = *ptr++; + goto REDO; + } + + /* The first significant character being circumflex negates the meaning of + the item. */ + + if (i == 0 && !*negptr && c == CHAR_CIRCUMFLEX_ACCENT) + { + *negptr = TRUE; + goto REDO; } - if (c == CHAR_NUL) goto ERROR_RETURN; + if (c == CHAR_RIGHT_CURLY_BRACKET) break; - name[i] = tolower(c); - if ((c == ':' || c == '=') && vptr == NULL) vptr = name + i; + + /* Names consist of ASCII letters and digits, but equals and colon may also + occur as a name/value separator. We must also allow for \p{L&}. A simple + check for a value between '&' and 'z' suffices because anything else in a + name or value will cause an "unknown property" error anyway. */ + + if (c < CHAR_AMPERSAND || c > CHAR_z) goto ERROR_RETURN; + + /* Lower case a capital letter or remember where the name/value separator + is. */ + + if (c >= CHAR_A && c <= CHAR_Z) c |= 0x20; + else if ((c == CHAR_COLON || c == CHAR_EQUALS_SIGN) && vptr == NULL) + vptr = name + i; + + name[i] = c; } + /* Error if the loop didn't end with '}' - either we hit the end of the + pattern or the name was longer than any legal property name. */ + if (c != CHAR_RIGHT_CURLY_BRACKET) goto ERROR_RETURN; name[i] = 0; } @@ -2217,14 +2341,19 @@ if (c == CHAR_LEFT_CURLY_BRACKET) /* If { doesn't follow \p or \P there is just one following character, which must be an ASCII letter. */ -else if (MAX_255(c) && (cb->ctypes[c] & ctype_letter) != 0) +else if (c >= CHAR_A && c <= CHAR_Z) + { + name[0] = c | 0x20; /* Lower case */ + name[1] = 0; + } +else if (c >= CHAR_a && c <= CHAR_z) { - name[0] = tolower(c); + name[0] = c; name[1] = 0; } else goto ERROR_RETURN; -*ptrptr = ptr; +*ptrptr = ptr; /* Update pattern pointer */ /* If the property contains ':' or '=' we have class name and value separately specified. The following are supported: @@ -2439,7 +2568,7 @@ return -1; the name of a subpattern or a (*VERB) or an (*alpha_assertion). The initial pointer must be to the preceding character. If that character is '*' we are reading a verb or alpha assertion name. The pointer is updated to point after -the name, for a VERB or alpha assertion name, or after tha name's terminator +the name, for a VERB or alpha assertion name, or after the name's terminator for a subpattern name. Returning both the offset and the name pointer is redundant information, but some callers use one and some the other, so it is simplest just to return both. When the name is in braces, spaces and tabs are @@ -2482,6 +2611,9 @@ if (ptr >= ptrend) /* No characters in name */ *nameptr = ptr; *offsetptr = (PCRE2_SIZE)(ptr - cb->start_pattern); +/* If this logic were ever to change, the matching function in pcre2_substitute.c +ought to be updated to match. */ + /* In UTF mode, a group name may contain letters and decimal digits as defined by Unicode properties, and underscores, but must not start with a digit. */ @@ -2489,12 +2621,14 @@ by Unicode properties, and underscores, but must not start with a digit. */ if (utf && is_group) { uint32_t c, type; + PCRE2_SPTR p = ptr; - GETCHAR(c, ptr); + GETCHARINC(c, p); /* Peek at next character */ type = UCD_CHARTYPE(c); if (type == ucp_Nd) { + ptr = p; *errorcodeptr = ERR44; goto FAILED; } @@ -2503,10 +2637,9 @@ if (utf && is_group) { if (type != ucp_Nd && PRIV(ucp_gentype)[type] != ucp_L && c != CHAR_UNDERSCORE) break; - ptr++; - FORWARDCHARTEST(ptr, ptrend); - if (ptr >= ptrend) break; - GETCHAR(c, ptr); + ptr = p; /* Accept character and peek again */ + if (p >= ptrend) break; + GETCHARINC(c, p); type = UCD_CHARTYPE(c); } } @@ -2522,6 +2655,7 @@ won't be recognized. */ { if (is_group && IS_DIGIT(*ptr)) { + ++ptr; *errorcodeptr = ERR44; goto FAILED; } @@ -2534,7 +2668,7 @@ won't be recognized. */ /* Check name length */ -if (ptr > *nameptr + MAX_NAME_SIZE) +if (ptr - *nameptr > MAX_NAME_SIZE) { *errorcodeptr = ERR48; goto FAILED; @@ -2553,12 +2687,15 @@ if (is_group) } if (is_braced) while (ptr < ptrend && (*ptr == CHAR_SPACE || *ptr == CHAR_HT)) ptr++; - if (ptr >= ptrend || *ptr != (PCRE2_UCHAR)terminator) + if (terminator != 0) { - *errorcodeptr = ERR42; - goto FAILED; + if (ptr >= ptrend || *ptr != (PCRE2_UCHAR)terminator) + { + *errorcodeptr = ERR42; + goto FAILED; + } + ptr++; } - ptr++; } *ptrptr = ptr; @@ -2571,6 +2708,128 @@ return FALSE; +/************************************************** +* Parse capturing bracket argument list * +**************************************************/ + +/* Reads a list of capture references. The references +can be numbers or names. + +Arguments: + ptrptr points to the character pointer variable + ptrend points to the end of the input string + utf true if the input is UTF-encoded + parsed_pattern the parsed pattern pointer + offset last known offset + errcodeptr where to put an error code + cb pointer to the compile data block + +Returns: updated parsed_pattern pointer on success + NULL otherwise +*/ + +static uint32_t * +parse_capture_list(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, + BOOL utf, uint32_t *parsed_pattern, PCRE2_SIZE offset, + int *errorcodeptr, compile_block *cb) +{ +PCRE2_SIZE next_offset; +PCRE2_SPTR ptr = *ptrptr; +PCRE2_SPTR name; +PCRE2_UCHAR terminator; +uint32_t meta, namelen; +int i; + +if (ptr >= ptrend || *ptr != CHAR_LEFT_PARENTHESIS) + { + *errorcodeptr = ERR118; + goto FAILED; + } + +for (;;) + { + ptr++; + next_offset = (PCRE2_SIZE)(ptr - cb->start_pattern); + + if (ptr >= ptrend) + { + *errorcodeptr = ERR117; + goto FAILED; + } + + /* Handle [+-]number cases */ + if (read_number(&ptr, ptrend, cb->bracount, MAX_GROUP_NUMBER, ERR61, + &i, errorcodeptr)) + { + PCRE2_ASSERT(i >= 0); + if (i <= 0) + { + *errorcodeptr = ERR15; + goto FAILED; + } + meta = META_CAPTURE_NUMBER; + namelen = (uint32_t)i; + } + else if (*errorcodeptr != 0) goto FAILED; /* Number too big */ + else + { + /* Handle 'name' or cases. */ + if (*ptr == CHAR_LESS_THAN_SIGN) + terminator = CHAR_GREATER_THAN_SIGN; + else if (*ptr == CHAR_APOSTROPHE) + terminator = CHAR_APOSTROPHE; + else + { + *errorcodeptr = ERR117; + goto FAILED; + } + + if (!read_name(&ptr, ptrend, utf, terminator, &next_offset, + &name, &namelen, errorcodeptr, cb)) goto FAILED; + + meta = META_CAPTURE_NAME; + } + + PCRE2_ASSERT(next_offset > 0); + if (offset == 0 || (next_offset - offset) >= 0x10000) + { + *parsed_pattern++ = META_OFFSET; + PUTOFFSET(next_offset, parsed_pattern); + offset = next_offset; + } + + /* The offset is encoded as a relative offset, because for some + inputs such as ",2" in (1,2,3), we only have space for two uint32_t + values, and an opcode and absolute offset may require three uint32_t + values. */ + *parsed_pattern++ = meta | (uint32_t)(next_offset - offset); + *parsed_pattern++ = namelen; + offset = next_offset; + + if (ptr >= ptrend) goto UNCLOSED_PARENTHESIS; + + if (*ptr == CHAR_RIGHT_PARENTHESIS) break; + + if (*ptr != CHAR_COMMA) + { + *errorcodeptr = ERR24; + goto FAILED; + } + } + +*ptrptr = ptr + 1; +return parsed_pattern; + +UNCLOSED_PARENTHESIS: +*errorcodeptr = ERR14; + +FAILED: +*ptrptr = ptr; +return NULL; +} + + + /************************************************* * Manage callouts at start of cycle * *************************************************/ @@ -2649,21 +2908,21 @@ switch(escape) { case ESC_D: prop = ESC_P; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case ESC_d: ascii_option = PCRE2_EXTRA_ASCII_BSD; break; case ESC_S: prop = ESC_P; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case ESC_s: ascii_option = PCRE2_EXTRA_ASCII_BSS; break; case ESC_W: prop = ESC_P; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case ESC_w: ascii_option = PCRE2_EXTRA_ASCII_BSW; break; @@ -2701,26 +2960,80 @@ return parsed_pattern; /************************************************* -* Parse regex and identify named groups * +* Maximum size of parsed_pattern for given input * *************************************************/ -/* This function is called first of all. It scans the pattern and does two -things: (1) It identifies capturing groups and makes a table of named capturing -groups so that information about them is fully available to both the compiling -scans. (2) It writes a parsed version of the pattern with comments omitted and -escapes processed into the parsed_pattern vector. +/* This function is called from parse_regex() below, to determine the amount +of memory to allocate for parsed_pattern. It is also called to check whether +the amount of data written respects the amount of memory allocated. Arguments: ptr points to the start of the pattern - options compiling dynamic options (may change during the scan) - has_lookbehind points to a boolean, set TRUE if a lookbehind is found - cb pointer to the compile data block + ptrend points to the end of the pattern + utf TRUE in UTF mode + options the options bits -Returns: zero on success or a non-zero error code, with the - error offset placed in the cb field +Returns: the number of uint32_t units for parsed_pattern */ +static ptrdiff_t +max_parsed_pattern(PCRE2_SPTR ptr, PCRE2_SPTR ptrend, BOOL utf, + uint32_t options) +{ +PCRE2_SIZE big32count = 0; +ptrdiff_t parsed_size_needed; + +/* When PCRE2_AUTO_CALLOUT is not set, in all but one case the number of +unsigned 32-bit ints written out to the parsed pattern is bounded by the length +of the pattern. The exceptional case is when running in 32-bit, non-UTF mode, +when literal characters greater than META_END (0x80000000) have to be coded as +two units. In this case, therefore, we scan the pattern to check for such +values. */ -/* A structure and some flags for dealing with nested groups. */ +#if PCRE2_CODE_UNIT_WIDTH == 32 +if (!utf) + { + PCRE2_SPTR p; + for (p = ptr; p < ptrend; p++) if (*p >= META_END) big32count++; + } +#else +(void)utf; /* Avoid compiler warning */ +#endif + +parsed_size_needed = (ptrend - ptr) + big32count; + +/* When PCRE2_AUTO_CALLOUT is set we have to assume a numerical callout (4 +elements) for each character. This is overkill, but memory is plentiful these +days. */ + +if ((options & PCRE2_AUTO_CALLOUT) != 0) + parsed_size_needed += (ptrend - ptr) * 4; + +return parsed_size_needed; +} + + + +/************************************************* +* Parse regex and identify named groups * +*************************************************/ + +/* This function is called first of all. It scans the pattern and does two +things: (1) It identifies capturing groups and makes a table of named capturing +groups so that information about them is fully available to both the compiling +scans. (2) It writes a parsed version of the pattern with comments omitted and +escapes processed into the parsed_pattern vector. + +Arguments: + ptr points to the start of the pattern + options compiling dynamic options (may change during the scan) + has_lookbehind points to a boolean, set TRUE if a lookbehind is found + cb pointer to the compile data block + +Returns: zero on success or a non-zero error code, with the + error offset placed in the cb field +*/ + +/* A structure and some flags for dealing with nested groups. */ typedef struct nest_save { uint16_t nest_depth; @@ -2751,7 +3064,33 @@ the main compiling phase. */ /* States used for analyzing ranges in character classes. The two OK values must be last. */ -enum { RANGE_NO, RANGE_STARTED, RANGE_OK_ESCAPED, RANGE_OK_LITERAL }; +enum { + RANGE_NO, /* State after '[' (initial), or '[a-z'; hyphen is literal */ + RANGE_STARTED, /* State after '[1-'; last-emitted code is META_RANGE_XYZ */ + RANGE_FORBID_NO, /* State after '[\d'; '-]' is allowed but not '-1]' */ + RANGE_FORBID_STARTED, /* State after '[\d-'*/ + RANGE_OK_ESCAPED, /* State after '[\1'; hyphen may be a range */ + RANGE_OK_LITERAL /* State after '[1'; hyphen may be a range */ +}; + +/* States used for analyzing operators and operands in extended character +classes. */ + +enum { + CLASS_OP_EMPTY, /* At start of an expression; empty previous contents */ + CLASS_OP_OPERAND, /* Have preceding operand; after "z" a "--" can follow */ + CLASS_OP_OPERATOR /* Have preceding operator; after "--" operand must follow */ +}; + +/* States used for determining the parse mode in character classes. The two +PERL_EXT values must be last. */ + +enum { + CLASS_MODE_NORMAL, /* Ordinary PCRE2 '[...]' class. */ + CLASS_MODE_ALT_EXT, /* UTS#18-style extended '[...]' class. */ + CLASS_MODE_PERL_EXT, /* Perl extended '(?[...])' class. */ + CLASS_MODE_PERL_EXT_LEAF /* Leaf within extended '(?[ [...] ])' class. */ +}; /* Only in 32-bit mode can there be literals > META_END. A macro encapsulates the storing of literal values in the main parsed pattern, where they can always @@ -2770,13 +3109,16 @@ be quantified. */ /* Here's the actual function. */ -static int parse_regex(PCRE2_SPTR ptr, uint32_t options, BOOL *has_lookbehind, - compile_block *cb) +static int parse_regex(PCRE2_SPTR ptr, uint32_t options, uint32_t xoptions, + BOOL *has_lookbehind, compile_block *cb) { uint32_t c; uint32_t delimiter; uint32_t namelen; uint32_t class_range_state; +uint32_t class_op_state; +uint32_t class_mode_state; +uint32_t *class_start; uint32_t *verblengthptr = NULL; /* Value avoids compiler warning */ uint32_t *verbstartptr = NULL; uint32_t *previous_callout = NULL; @@ -2786,8 +3128,10 @@ uint32_t *this_parsed_item = NULL; uint32_t *prev_parsed_item = NULL; uint32_t meta_quantifier = 0; uint32_t add_after_mark = 0; -uint32_t xoptions = cb->cx->extra_options; uint16_t nest_depth = 0; +int16_t class_depth_m1 = -1; /* The m1 means minus 1. */ +int16_t class_maxdepth_m1 = -1; +uint16_t hash; int after_manual_callout = 0; int expect_cond_assert = 0; int errorcode = 0; @@ -2797,15 +3141,24 @@ BOOL inescq = FALSE; BOOL inverbname = FALSE; BOOL utf = (options & PCRE2_UTF) != 0; BOOL auto_callout = (options & PCRE2_AUTO_CALLOUT) != 0; -BOOL isdupname; +BOOL is_dupname; BOOL negate_class; BOOL okquantifier = FALSE; PCRE2_SPTR thisptr; PCRE2_SPTR name; PCRE2_SPTR ptrend = cb->end_pattern; PCRE2_SPTR verbnamestart = NULL; /* Value avoids compiler warning */ +PCRE2_SPTR class_range_forbid_ptr = NULL; named_group *ng; nest_save *top_nest, *end_nests; +#ifdef PCRE2_DEBUG +uint32_t *parsed_pattern_check; +ptrdiff_t parsed_pattern_extra = 0; +ptrdiff_t parsed_pattern_extra_check = 0; +PCRE2_SPTR ptr_check; +#endif + +PCRE2_ASSERT(parsed_pattern != NULL); /* Insert leading items for word and line matching (features provided for the benefit of pcre2grep). */ @@ -2821,6 +3174,11 @@ else if ((xoptions & PCRE2_EXTRA_MATCH_WORD) != 0) *parsed_pattern++ = META_NOCAPTURE; } +#ifdef PCRE2_DEBUG +parsed_pattern_check = parsed_pattern; +ptr_check = ptr; +#endif + /* If the pattern is actually a literal string, process it separately to avoid cluttering up the main loop. */ @@ -2828,11 +3186,15 @@ if ((options & PCRE2_LITERAL) != 0) { while (ptr < ptrend) { + /* LCOV_EXCL_START */ if (parsed_pattern >= parsed_pattern_end) { + PCRE2_DEBUG_UNREACHABLE(); errorcode = ERR63; /* Internal error (parsed pattern overflow) */ goto FAILED; } + /* LCOV_EXCL_STOP */ + thisptr = ptr; GETCHARINCTEST(c, ptr); if (auto_callout) @@ -2873,18 +3235,42 @@ while (ptr < ptrend) PCRE2_SPTR tempptr; PCRE2_SIZE offset; - if (parsed_pattern >= parsed_pattern_end) - { - errorcode = ERR63; /* Internal error (parsed pattern overflow) */ - goto FAILED; - } - if (nest_depth > cb->cx->parens_nest_limit) { errorcode = ERR19; goto FAILED; /* Parentheses too deeply nested */ } + /* Check that we haven't emitted too much into parsed_pattern. We allocate + a suitably-sized buffer upfront, then do unchecked writes to it. If we only + write a little bit too much, everything will appear to be OK, because the + upfront size is an overestimate... but a malicious pattern could end up + forcing a write past the buffer end. We must catch this during + development. */ + +#ifdef PCRE2_DEBUG + /* Strong post-write check. Won't help in release builds - at this point + the write has already occurred so it's too late. However, should stop us + committing unsafe code. */ + PCRE2_ASSERT((parsed_pattern - parsed_pattern_check) + + (parsed_pattern_extra - parsed_pattern_extra_check) <= + max_parsed_pattern(ptr_check, ptr, utf, options)); + parsed_pattern_check = parsed_pattern; + parsed_pattern_extra_check = parsed_pattern_extra; + ptr_check = ptr; +#endif + + /* LCOV_EXCL_START */ + if (parsed_pattern >= parsed_pattern_end) + { + /* Weak pre-write check; only ensures parsed_pattern[0] is writeable + (but the code below can write many chars). Better than nothing. */ + PCRE2_DEBUG_UNREACHABLE(); + errorcode = ERR63; /* Internal error (parsed pattern overflow) */ + goto FAILED; + } + /* LCOV_EXCL_STOP */ + /* If the last time round this loop something was added, parsed_pattern will no longer be equal to this_parsed_item. Remember where the previous item started and reset for the next item. Note that sometimes round the loop, @@ -2913,12 +3299,6 @@ while (ptr < ptrend) } else { - if (expect_cond_assert > 0) /* A literal is not allowed if we are */ - { /* expecting a conditional assertion, */ - ptr--; /* but an empty \Q\E sequence is OK. */ - errorcode = ERR28; - goto FAILED; - } if (inverbname) { /* Don't use PARSED_LITERAL() because it */ #if PCRE2_CODE_UNIT_WIDTH == 32 /* sets okquantifier. */ @@ -3004,7 +3384,7 @@ while (ptr < ptrend) if ((options & PCRE2_ALT_VERBNAMES) != 0) { escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options, - xoptions, FALSE, cb); + xoptions, cb->bracount, FALSE, cb); if (errorcode != 0) goto FAILED; } else escape = 0; /* Treat all as literal */ @@ -3047,6 +3427,15 @@ while (ptr < ptrend) { if (*ptr == CHAR_Q || *ptr == CHAR_E) { + /* A literal inside a \Q...\E is not allowed if we are expecting a + conditional assertion, but an empty \Q\E sequence is OK. */ + if (expect_cond_assert > 0 && *ptr == CHAR_Q && + !(ptrend - ptr >= 3 && ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)) + { + ptr--; + errorcode = ERR28; + goto FAILED; + } inescq = *ptr == CHAR_Q; ptr++; continue; @@ -3156,9 +3545,9 @@ while (ptr < ptrend) if (!ok) { - ptr--; /* Adjust error offset */ errorcode = ERR28; - goto FAILED; + if (expect_cond_assert == 2) goto FAILED; + goto FAILED_BACK; } } @@ -3204,7 +3593,7 @@ while (ptr < ptrend) case CHAR_BACKSLASH: tempptr = ptr; escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options, - xoptions, FALSE, cb); + xoptions, cb->bracount, FALSE, cb); if (errorcode != 0) { ESCAPE_FAILED: @@ -3234,8 +3623,8 @@ while (ptr < ptrend) else if (escape < 0) { - offset = (PCRE2_SIZE)(ptr - cb->start_pattern - 1); - escape = -escape; + offset = (PCRE2_SIZE)(ptr - cb->start_pattern); + escape = -escape - 1; *parsed_pattern++ = META_BACKREF | (uint32_t)escape; if (escape < 10) { @@ -3332,7 +3721,7 @@ while (ptr < ptrend) { BOOL negated; uint16_t ptype = 0, pdata = 0; - if (!get_ucp(&ptr, &negated, &ptype, &pdata, &errorcode, cb)) + if (!get_ucp(&ptr, utf, &negated, &ptype, &pdata, &errorcode, cb)) goto ESCAPE_FAILED; if (negated) escape = (escape == ESC_P)? ESC_p : ESC_P; *parsed_pattern++ = META_ESCAPE + escape; @@ -3347,7 +3736,7 @@ while (ptr < ptrend) /* When \g is used with quotes or angle brackets as delimiters, it is a numerical or named subroutine call, and control comes here. When used - with brace delimiters it is a numberical back reference and does not come + with brace delimiters it is a numerical back reference and does not come here because check_escape() returns it directly as a reference. \k is always a named back reference. */ @@ -3374,10 +3763,11 @@ while (ptr < ptrend) { if (p >= ptrend || *p != terminator) { - errorcode = ERR57; + ptr = p; + errorcode = ERR119; /* Missing terminator for number */ goto ESCAPE_FAILED; } - ptr = p; + ptr = p + 1; goto SET_RECURSION; } if (errorcode != 0) goto ESCAPE_FAILED; @@ -3458,7 +3848,7 @@ while (ptr < ptrend) if (!prev_okquantifier) { errorcode = ERR9; - goto FAILED_BACK; + goto FAILED; } /* Most (*VERB)s are not allowed to be quantified, but an ungreedy @@ -3474,6 +3864,11 @@ while (ptr < ptrend) *verbstartptr = META_NOCAPTURE; parsed_pattern[1] = META_KET; parsed_pattern += 2; + +#ifdef PCRE2_DEBUG + PCRE2_ASSERT(parsed_pattern_extra >= 2); + parsed_pattern_extra -= 2; +#endif } /* Now we can put the quantifier into the parsed pattern vector. At this @@ -3493,7 +3888,6 @@ while (ptr < ptrend) /* ---- Character class ---- */ case CHAR_LEFT_SQUARE_BRACKET: - okquantifier = TRUE; /* In another (POSIX) regex library, the ugly syntax [[:<:]] and [[:>:]] is used for "start of word" and "end of word". As these are otherwise illegal @@ -3531,6 +3925,7 @@ while (ptr < ptrend) } *parsed_pattern++ = META_KET; ptr += 6; + okquantifier = TRUE; break; } @@ -3542,49 +3937,18 @@ while (ptr < ptrend) check_posix_syntax(ptr, ptrend, &tempptr)) { errorcode = (*ptr-- == CHAR_COLON)? ERR12 : ERR13; + ptr = tempptr + 2; goto FAILED; } - /* Process a regular character class. If the first character is '^', set - the negation flag. If the first few characters (either before or after ^) - are \Q\E or \E or space or tab in extended-more mode, we skip them too. - This makes for compatibility with Perl. */ - - negate_class = FALSE; - while (ptr < ptrend) - { - GETCHARINCTEST(c, ptr); - if (c == CHAR_BACKSLASH) - { - if (ptr < ptrend && *ptr == CHAR_E) ptr++; - else if (ptrend - ptr >= 3 && - PRIV(strncmp_c8)(ptr, STR_Q STR_BACKSLASH STR_E, 3) == 0) - ptr += 3; - else - break; - } - else if ((options & PCRE2_EXTENDED_MORE) != 0 && - (c == CHAR_SPACE || c == CHAR_HT)) /* Note: just these two */ - continue; - else if (!negate_class && c == CHAR_CIRCUMFLEX_ACCENT) - negate_class = TRUE; - else break; - } - - /* Now the real contents of the class; c has the first "real" character. - Empty classes are permitted only if the option is set. */ - - if (c == CHAR_RIGHT_SQUARE_BRACKET && - (cb->external_options & PCRE2_ALLOW_EMPTY_CLASS) != 0) - { - *parsed_pattern++ = negate_class? META_CLASS_EMPTY_NOT : META_CLASS_EMPTY; - break; /* End of class processing */ - } + class_mode_state = ((options & PCRE2_ALT_EXTENDED_CLASS) != 0)? + CLASS_MODE_ALT_EXT : CLASS_MODE_NORMAL; - /* Process a non-empty class. */ + /* Jump here from '(?[...])'. That jump must initialize class_mode_state, + set c to the '[' character, and ptr to just after the '['. */ - *parsed_pattern++ = negate_class? META_CLASS_NOT : META_CLASS; - class_range_state = RANGE_NO; + FROM_PERL_EXTENDED_CLASS: + okquantifier = TRUE; /* In an EBCDIC environment, Perl treats alphabetic ranges specially because there are holes in the encoding, and simply using the range A-Z @@ -3594,7 +3958,16 @@ while (ptr < ptrend) character values are literal or not, and a state variable for handling ranges. */ - /* Loop for the contents of the class */ + /* Loop for the contents of the class. Classes may be nested, if + PCRE2_ALT_EXTENDED_CLASS is set, or the class is of the form (?[...]). */ + + /* c is still set to '[' so the loop will handle the start of the class. */ + + class_depth_m1 = -1; + class_maxdepth_m1 = -1; + class_range_state = RANGE_NO; + class_op_state = CLASS_OP_EMPTY; + class_start = NULL; for (;;) { @@ -3610,13 +3983,26 @@ while (ptr < ptrend) ptr++; /* Skip the 'E' */ goto CLASS_CONTINUE; } + + /* Surprisingly, you cannot use \Q..\E to escape a character inside a + Perl extended class. However, empty \Q\E sequences are allowed, so here + were're only giving an error if the \Q..\E is non-empty. */ + + if (class_mode_state == CLASS_MODE_PERL_EXT) + { + errorcode = ERR116; + goto FAILED; + } + goto CLASS_LITERAL; } - /* Skip over space and tab (only) in extended-more mode. */ + /* Skip over space and tab (only) in extended-more mode, or anywhere + inside a Perl extended class (which implies /xx). */ - if ((options & PCRE2_EXTENDED_MORE) != 0 && - (c == CHAR_SPACE || c == CHAR_HT)) + if ((c == CHAR_SPACE || c == CHAR_HT) && + ((options & PCRE2_EXTENDED_MORE) != 0 || + class_mode_state >= CLASS_MODE_PERL_EXT)) goto CLASS_CONTINUE; /* Handle POSIX class names. Perl allows a negation extension of the @@ -3625,7 +4011,8 @@ while (ptr < ptrend) [.ch.] and [=ch=] ("collating elements") and fault them, as Perl 5.6 and 5.8 do. */ - if (c == CHAR_LEFT_SQUARE_BRACKET && + if (class_depth_m1 >= 0 && + c == CHAR_LEFT_SQUARE_BRACKET && ptrend - ptr >= 3 && (*ptr == CHAR_COLON || *ptr == CHAR_DOT || *ptr == CHAR_EQUALS_SIGN) && @@ -3641,14 +4028,41 @@ while (ptr < ptrend) if (class_range_state == RANGE_STARTED) { + ptr = tempptr + 2; + errorcode = ERR50; + goto FAILED; + } + + /* Perl treats a hyphen after a POSIX class as a literal, not the + start of a range. However, it gives a warning in its warning mode + unless the hyphen is the last character in the class. PCRE does not + have a warning mode, so we give an error, because this is likely an + error on the user's part. + + Roll back to the hyphen for the error position. */ + + if (class_range_state == RANGE_FORBID_STARTED) + { + ptr = class_range_forbid_ptr; errorcode = ERR50; goto FAILED; } + /* Disallow implicit union in Perl extended classes. */ + + if (class_op_state == CLASS_OP_OPERAND && + class_mode_state == CLASS_MODE_PERL_EXT) + { + ptr = tempptr + 2; + errorcode = ERR113; + goto FAILED; + } + if (*ptr != CHAR_COLON) { + ptr = tempptr + 2; errorcode = ERR13; - goto FAILED_BACK; + goto FAILED; } if (*(++ptr) == CHAR_CIRCUMFLEX_ACCENT) @@ -3658,33 +4072,19 @@ while (ptr < ptrend) } posix_class = check_posix_name(ptr, (int)(tempptr - ptr)); + ptr = tempptr + 2; if (posix_class < 0) { errorcode = ERR30; goto FAILED; } - ptr = tempptr + 2; - - /* Perl treats a hyphen after a POSIX class as a literal, not the - start of a range. However, it gives a warning in its warning mode - unless the hyphen is the last character in the class. PCRE does not - have a warning mode, so we give an error, because this is likely an - error on the user's part. */ - - if (ptr < ptrend - 1 && *ptr == CHAR_MINUS && - ptr[1] != CHAR_RIGHT_SQUARE_BRACKET) - { - errorcode = ERR50; - goto FAILED; - } - /* Set "a hyphen is not the start of a range" for the -] case, and also - in case the POSIX class is followed by \E or \Q\E (possibly repeated - - fuzzers do that kind of thing) and *then* a hyphen. This causes that - hyphen to be treated as a literal. I don't think it's worth setting up - special apparatus to do otherwise. */ + /* Set "a hyphen is forbidden to be the start of a range". For the '-]' + case, the hyphen is treated as a literal, but for '-1' it is disallowed + (because it would be interpreted as range). */ - class_range_state = RANGE_NO; + class_range_state = RANGE_FORBID_NO; + class_op_state = CLASS_OP_OPERAND; /* When PCRE2_UCP is set, unless PCRE2_EXTRA_ASCII_POSIX is set, some of the POSIX classes are converted to use Unicode properties \p or \P @@ -3727,114 +4127,389 @@ while (ptr < ptrend) *parsed_pattern++ = posix_class; } - /* Handle potential start of range */ + /* Check for the start of the outermost class, or the start of a nested class. */ - else if (c == CHAR_MINUS && class_range_state >= RANGE_OK_ESCAPED) + else if ((c == CHAR_LEFT_SQUARE_BRACKET && + (class_depth_m1 < 0 || class_mode_state == CLASS_MODE_ALT_EXT || + class_mode_state == CLASS_MODE_PERL_EXT)) || + (c == CHAR_LEFT_PARENTHESIS && + class_mode_state == CLASS_MODE_PERL_EXT)) { - *parsed_pattern++ = (class_range_state == RANGE_OK_LITERAL)? - META_RANGE_LITERAL : META_RANGE_ESCAPED; - class_range_state = RANGE_STARTED; - } + uint32_t start_c = c; + uint32_t new_class_mode_state; - /* Handle a literal character */ + /* Update the class mode, if moving into a 'leaf' inside a Perl extended + class. */ + + if (start_c == CHAR_LEFT_SQUARE_BRACKET && + class_mode_state == CLASS_MODE_PERL_EXT && class_depth_m1 >= 0) + new_class_mode_state = CLASS_MODE_PERL_EXT_LEAF; + else + new_class_mode_state = class_mode_state; + + /* Tidy up the other class before starting the nested class. */ + /* -[ beginning a nested class is a literal '-' */ - else if (c != CHAR_BACKSLASH) - { - CLASS_LITERAL: if (class_range_state == RANGE_STARTED) + parsed_pattern[-1] = CHAR_MINUS; + + /* Disallow implicit union in Perl extended classes. */ + + if (class_op_state == CLASS_OP_OPERAND && + class_mode_state == CLASS_MODE_PERL_EXT) { - if (c == parsed_pattern[-2]) /* Optimize one-char range */ - parsed_pattern--; - else if (parsed_pattern[-2] > c) /* Check range is in order */ + errorcode = ERR113; + goto FAILED; + } + + /* Validate nesting depth */ + if (class_depth_m1 >= ECLASS_NEST_LIMIT - 1) + { + ptr--; /* Point rightwards at the paren, same as ERR19. */ + errorcode = ERR107; /* Classes too deeply nested */ + goto FAILED; + } + + /* Process the character class start. If the first character is '^', set + the negation flag. If the first few characters (either before or after ^) + are \Q\E or \E or space or tab in extended-more mode, we skip them too. + This makes for compatibility with Perl. */ + + negate_class = FALSE; + for (;;) + { + if (ptr >= ptrend) { - errorcode = ERR8; - goto FAILED_BACK; + if (start_c == CHAR_LEFT_PARENTHESIS) + errorcode = ERR14; /* Missing terminating ')' */ + else + errorcode = ERR6; /* Missing terminating ']' */ + goto FAILED; } - else + + GETCHARINCTEST(c, ptr); + if (new_class_mode_state == CLASS_MODE_PERL_EXT) break; + else if (c == CHAR_BACKSLASH) { - if (!char_is_literal && parsed_pattern[-1] == META_RANGE_LITERAL) - parsed_pattern[-1] = META_RANGE_ESCAPED; - PARSED_LITERAL(c, parsed_pattern); + if (ptr < ptrend && *ptr == CHAR_E) ptr++; + else if (ptrend - ptr >= 3 && + PRIV(strncmp_c8)(ptr, STR_Q STR_BACKSLASH STR_E, 3) == 0) + ptr += 3; + else + break; } - class_range_state = RANGE_NO; + else if ((c == CHAR_SPACE || c == CHAR_HT) && /* Note: just these two */ + ((options & PCRE2_EXTENDED_MORE) != 0 || + new_class_mode_state >= CLASS_MODE_PERL_EXT)) + continue; + else if (!negate_class && c == CHAR_CIRCUMFLEX_ACCENT) + negate_class = TRUE; + else break; } - else /* Potential start of range */ + + /* Now the real contents of the class; c has the first "real" character. + Empty classes are permitted only if the option is set, and if it's not + a Perl-extended class. */ + + if (c == CHAR_RIGHT_SQUARE_BRACKET && + (cb->external_options & PCRE2_ALLOW_EMPTY_CLASS) != 0 && + new_class_mode_state < CLASS_MODE_PERL_EXT) { - class_range_state = char_is_literal? - RANGE_OK_LITERAL : RANGE_OK_ESCAPED; + PCRE2_ASSERT(start_c == CHAR_LEFT_SQUARE_BRACKET); + + if (class_start != NULL) + { + PCRE2_ASSERT(class_depth_m1 >= 0); + /* Represents that the class is an extended class. */ + *class_start |= CLASS_IS_ECLASS; + class_start = NULL; + } + + *parsed_pattern++ = negate_class? META_CLASS_EMPTY_NOT : META_CLASS_EMPTY; + + /* Leave nesting depth unchanged; but check for zero depth to handle the + very first (top-level) class being empty. */ + if (class_depth_m1 < 0) break; + + class_range_state = RANGE_NO; /* for processing the containing class */ + class_op_state = CLASS_OP_OPERAND; + goto CLASS_CONTINUE; + } + + /* Enter a non-empty class. */ + + if (class_start != NULL) + { + PCRE2_ASSERT(class_depth_m1 >= 0); + /* Represents that the class is an extended class. */ + *class_start |= CLASS_IS_ECLASS; + class_start = NULL; + } + + class_start = parsed_pattern; + *parsed_pattern++ = negate_class? META_CLASS_NOT : META_CLASS; + class_range_state = RANGE_NO; + class_op_state = CLASS_OP_EMPTY; + class_mode_state = new_class_mode_state; + ++class_depth_m1; + if (class_maxdepth_m1 < class_depth_m1) + class_maxdepth_m1 = class_depth_m1; + /* Reset; no op seen yet at new depth. */ + cb->class_op_used[class_depth_m1] = 0; + + /* Implement the special start-of-class literal meaning of ']'. */ + if (c == CHAR_RIGHT_SQUARE_BRACKET && + new_class_mode_state != CLASS_MODE_PERL_EXT) + { + class_range_state = RANGE_OK_LITERAL; + class_op_state = CLASS_OP_OPERAND; PARSED_LITERAL(c, parsed_pattern); + goto CLASS_CONTINUE; } + + continue; /* We have already loaded c with the next character */ } - /* Handle escapes in a class */ + /* Check for the end of the class. */ - else + else if (c == CHAR_RIGHT_SQUARE_BRACKET || + (c == CHAR_RIGHT_PARENTHESIS && class_mode_state == CLASS_MODE_PERL_EXT)) { - tempptr = ptr; - escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options, - xoptions, TRUE, cb); - - if (errorcode != 0) + /* In Perl extended mode, the ']' can only be used to match the + opening '[', and ')' must match an opening parenthesis. */ + if (class_mode_state == CLASS_MODE_PERL_EXT) { - if ((xoptions & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) == 0) + if (c == CHAR_RIGHT_SQUARE_BRACKET && class_depth_m1 != 0) + { + errorcode = ERR14; + ptr--; /* Correct the offset */ goto FAILED; - ptr = tempptr; - if (ptr >= ptrend) c = CHAR_BACKSLASH; else + } + if (c == CHAR_RIGHT_PARENTHESIS && class_depth_m1 < 1) { - GETCHARINCTEST(c, ptr); /* Get character value, increment pointer */ + errorcode = ERR22; + goto FAILED; } - escape = 0; /* Treat as literal character */ } - switch(escape) + /* Check no trailing operator. */ + if (class_op_state == CLASS_OP_OPERATOR) { - case 0: /* Escaped character code point is in c */ - char_is_literal = FALSE; - goto CLASS_LITERAL; /* (a few lines above) */ - - case ESC_b: - c = CHAR_BS; /* \b is backspace in a class */ - char_is_literal = FALSE; - goto CLASS_LITERAL; - - case ESC_Q: - inescq = TRUE; /* Enter literal mode */ - goto CLASS_CONTINUE; - - case ESC_E: /* Ignore orphan \E */ - goto CLASS_CONTINUE; - - case ESC_B: /* Always an error in a class */ - case ESC_R: - case ESC_X: - errorcode = ERR7; - ptr--; + errorcode = ERR110; goto FAILED; } - /* The second part of a range can be a single-character escape - sequence (detected above), but not any of the other escapes. Perl - treats a hyphen as a literal in such circumstances. However, in Perl's - warning mode, a warning is given, so PCRE now faults it, as it is - almost certainly a mistake on the user's part. */ + /* Check no empty expression for Perl extended expressions. */ + if (class_mode_state == CLASS_MODE_PERL_EXT && + class_op_state == CLASS_OP_EMPTY) + { + errorcode = ERR114; + goto FAILED; + } + /* -] at the end of a class is a literal '-' */ if (class_range_state == RANGE_STARTED) + parsed_pattern[-1] = CHAR_MINUS; + + *parsed_pattern++ = META_CLASS_END; + + if (--class_depth_m1 < 0) { - errorcode = ERR50; - goto FAILED; /* Not CLASS_ESCAPE_FAILED; always an error */ + /* Check for and consume ')' after '(?[...]'. */ + PCRE2_ASSERT(class_mode_state != CLASS_MODE_PERL_EXT_LEAF); + if (class_mode_state == CLASS_MODE_PERL_EXT) + { + if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS) + { + errorcode = ERR115; + goto FAILED; + } + + ptr++; + } + + break; } - /* Of the remaining escapes, only those that define characters are - allowed in a class. None may start a range. */ + class_range_state = RANGE_NO; /* for processing the containing class */ + class_op_state = CLASS_OP_OPERAND; + if (class_mode_state == CLASS_MODE_PERL_EXT_LEAF) + class_mode_state = CLASS_MODE_PERL_EXT; + /* The extended class flag has already + been set for the parent class. */ + class_start = NULL; + } - class_range_state = RANGE_NO; - switch(escape) + /* Handle a Perl set binary operator */ + + else if (class_mode_state == CLASS_MODE_PERL_EXT && + (c == CHAR_PLUS || c == CHAR_VERTICAL_LINE || c == CHAR_MINUS || + c == CHAR_AMPERSAND || c == CHAR_CIRCUMFLEX_ACCENT)) + { + /* Check that there was a preceding operand. */ + if (class_op_state != CLASS_OP_OPERAND) { - case ESC_N: - errorcode = ERR71; + errorcode = ERR109; goto FAILED; + } - case ESC_H: + if (class_start != NULL) + { + PCRE2_ASSERT(class_depth_m1 >= 0); + /* Represents that the class is an extended class. */ + *class_start |= CLASS_IS_ECLASS; + class_start = NULL; + } + + PCRE2_ASSERT(class_range_state != RANGE_STARTED && + class_range_state != RANGE_FORBID_STARTED); + + *parsed_pattern++ = c == CHAR_PLUS? META_ECLASS_OR : + c == CHAR_VERTICAL_LINE? META_ECLASS_OR : + c == CHAR_MINUS? META_ECLASS_SUB : + c == CHAR_AMPERSAND? META_ECLASS_AND : + META_ECLASS_XOR; + class_range_state = RANGE_NO; + class_op_state = CLASS_OP_OPERATOR; + } + + /* Handle a Perl set unary operator */ + + else if (class_mode_state == CLASS_MODE_PERL_EXT && + c == CHAR_EXCLAMATION_MARK) + { + /* Check that the "!" has not got a preceding operand (i.e. it's the + start of the class, or follows an operator). */ + if (class_op_state == CLASS_OP_OPERAND) + { + errorcode = ERR113; + goto FAILED; + } + + if (class_start != NULL) + { + PCRE2_ASSERT(class_depth_m1 >= 0); + /* Represents that the class is an extended class. */ + *class_start |= CLASS_IS_ECLASS; + class_start = NULL; + } + + PCRE2_ASSERT(class_range_state != RANGE_STARTED && + class_range_state != RANGE_FORBID_STARTED); + + *parsed_pattern++ = META_ECLASS_NOT; + class_range_state = RANGE_NO; + class_op_state = CLASS_OP_OPERATOR; + } + + /* Handle a UTS#18 set operator */ + + else if (class_mode_state == CLASS_MODE_ALT_EXT && + (c == CHAR_VERTICAL_LINE || c == CHAR_MINUS || + c == CHAR_AMPERSAND || c == CHAR_TILDE) && + ptr < ptrend && *ptr == c) + { + ++ptr; + + /* Check there isn't a triple-repetition. */ + if (ptr < ptrend && *ptr == c) + { + while (ptr < ptrend && *ptr == c) ++ptr; /* Improve error offset. */ + errorcode = ERR108; + goto FAILED; + } + + /* Check for a preceding operand. */ + if (class_op_state != CLASS_OP_OPERAND) + { + errorcode = ERR109; + goto FAILED; + } + + /* Check for mixed precedence. Forbid [A--B&&C]. */ + if (cb->class_op_used[class_depth_m1] != 0 && + cb->class_op_used[class_depth_m1] != (uint8_t)c) + { + errorcode = ERR111; + goto FAILED; + } + + if (class_start != NULL) + { + PCRE2_ASSERT(class_depth_m1 >= 0); + /* Represents that the class is an extended class. */ + *class_start |= CLASS_IS_ECLASS; + class_start = NULL; + } + + /* Dangling '-' before an operator is a literal */ + if (class_range_state == RANGE_STARTED) + parsed_pattern[-1] = CHAR_MINUS; + + *parsed_pattern++ = c == CHAR_VERTICAL_LINE? META_ECLASS_OR : + c == CHAR_MINUS? META_ECLASS_SUB : + c == CHAR_AMPERSAND? META_ECLASS_AND : + META_ECLASS_XOR; + class_range_state = RANGE_NO; + class_op_state = CLASS_OP_OPERATOR; + cb->class_op_used[class_depth_m1] = (uint8_t)c; + } + + /* Handle escapes in a class */ + + else if (c == CHAR_BACKSLASH) + { + tempptr = ptr; + escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options, + xoptions, cb->bracount, TRUE, cb); + + if (errorcode != 0) + { + if ((xoptions & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) == 0 || + class_mode_state >= CLASS_MODE_PERL_EXT) + goto FAILED; + ptr = tempptr; + if (ptr >= ptrend) c = CHAR_BACKSLASH; else + { + GETCHARINCTEST(c, ptr); /* Get character value, increment pointer */ + } + escape = 0; /* Treat as literal character */ + } + + switch(escape) + { + case 0: /* Escaped character code point is in c */ + char_is_literal = FALSE; + goto CLASS_LITERAL; /* (a few lines above) */ + + case ESC_b: + c = CHAR_BS; /* \b is backspace in a class */ + char_is_literal = FALSE; + goto CLASS_LITERAL; + + case ESC_k: + c = CHAR_k; /* \k is not special in a class, just like \g */ + char_is_literal = FALSE; + goto CLASS_LITERAL; + + case ESC_Q: + inescq = TRUE; /* Enter literal mode */ + goto CLASS_CONTINUE; + + case ESC_E: /* Ignore orphan \E */ + goto CLASS_CONTINUE; + + case ESC_B: /* Always an error in a class */ + case ESC_R: + case ESC_X: + errorcode = ERR7; + goto FAILED; + + case ESC_N: /* Not permitted by Perl either */ + errorcode = ERR71; + goto FAILED; + + case ESC_H: case ESC_h: case ESC_V: case ESC_v: @@ -3862,8 +4537,20 @@ while (ptr < ptrend) { BOOL negated; uint16_t ptype = 0, pdata = 0; - if (!get_ucp(&ptr, &negated, &ptype, &pdata, &errorcode, cb)) + if (!get_ucp(&ptr, utf, &negated, &ptype, &pdata, &errorcode, cb)) goto FAILED; + + /* In caseless matching, particular characteristics Lu, Ll, and Lt + get converted to the general characteristic L&. That is, upper, + lower, and title case letters are all conflated. */ + + if ((options & PCRE2_CASELESS) != 0 && ptype == PT_PC && + (pdata == ucp_Lu || pdata == ucp_Ll || pdata == ucp_Lt)) + { + ptype = PT_LAMP; + pdata = 0; + } + if (negated) escape = (escape == ESC_P)? ESC_p : ESC_P; *parsed_pattern++ = META_ESCAPE + escape; *parsed_pattern++ = (ptype << 16) | pdata; @@ -3874,21 +4561,135 @@ while (ptr < ptrend) #endif break; /* End \P and \p */ - default: /* All others are not allowed in a class */ + /* All others are not allowed in a class */ + + /* LCOV_EXCL_START */ + default: + PCRE2_DEBUG_UNREACHABLE(); + PCRE2_FALLTHROUGH /* Fall through */ + /* LCOV_EXCL_STOP */ + + case ESC_A: + case ESC_Z: + case ESC_z: + case ESC_G: + case ESC_K: + case ESC_C: errorcode = ERR7; - ptr--; goto FAILED; } - /* Perl gives a warning unless a following hyphen is the last character - in the class. PCRE throws an error. */ + /* All the switch-cases above which end in "break" describe a set + of characters. None may start a range. */ + + /* The second part of a range can be a single-character escape + sequence (detected above), but not any of the other escapes. Perl + treats a hyphen as a literal in such circumstances. However, in Perl's + warning mode, a warning is given, so PCRE now faults it, as it is + almost certainly a mistake on the user's part. */ + + if (class_range_state == RANGE_STARTED) + { + errorcode = ERR50; + goto FAILED; + } + + /* Perl gives a warning unless the hyphen following a multi-character + escape is the last character in the class. PCRE throws an error. */ + + if (class_range_state == RANGE_FORBID_STARTED) + { + ptr = class_range_forbid_ptr; + errorcode = ERR50; + goto FAILED; + } + + /* Disallow implicit union in Perl extended classes. */ + + if (class_op_state == CLASS_OP_OPERAND && + class_mode_state == CLASS_MODE_PERL_EXT) + { + errorcode = ERR113; + goto FAILED; + } + + class_range_state = RANGE_FORBID_NO; + class_op_state = CLASS_OP_OPERAND; + } + + /* Forbid unescaped literals, and the special meaning of '-', inside a + Perl extended class. */ + + else if (class_mode_state == CLASS_MODE_PERL_EXT) + { + errorcode = ERR116; + goto FAILED; + } + + /* Handle potential start of range */ + + else if (c == CHAR_MINUS && class_range_state >= RANGE_OK_ESCAPED) + { + *parsed_pattern++ = (class_range_state == RANGE_OK_LITERAL)? + META_RANGE_LITERAL : META_RANGE_ESCAPED; + class_range_state = RANGE_STARTED; + } + + /* Handle forbidden start of range */ + + else if (c == CHAR_MINUS && class_range_state == RANGE_FORBID_NO) + { + *parsed_pattern++ = CHAR_MINUS; + class_range_state = RANGE_FORBID_STARTED; + class_range_forbid_ptr = ptr; + } + + /* Handle a literal character */ + + else + { + CLASS_LITERAL: + + /* Disallow implicit union in Perl extended classes. */ + + if (class_op_state == CLASS_OP_OPERAND && + class_mode_state == CLASS_MODE_PERL_EXT) + { + errorcode = ERR113; + goto FAILED; + } - if (ptr < ptrend - 1 && *ptr == CHAR_MINUS && - ptr[1] != CHAR_RIGHT_SQUARE_BRACKET) + if (class_range_state == RANGE_STARTED) + { + if (c == parsed_pattern[-2]) /* Optimize one-char range */ + parsed_pattern--; + else if (parsed_pattern[-2] > c) /* Check range is in order */ + { + errorcode = ERR8; + goto FAILED; + } + else + { + if (!char_is_literal && parsed_pattern[-1] == META_RANGE_LITERAL) + parsed_pattern[-1] = META_RANGE_ESCAPED; + PARSED_LITERAL(c, parsed_pattern); + } + class_range_state = RANGE_NO; + class_op_state = CLASS_OP_OPERAND; + } + else if (class_range_state == RANGE_FORBID_STARTED) { + ptr = class_range_forbid_ptr; errorcode = ERR50; goto FAILED; } + else /* Potential start of range */ + { + class_range_state = char_is_literal? + RANGE_OK_LITERAL : RANGE_OK_ESCAPED; + class_op_state = CLASS_OP_OPERAND; + PARSED_LITERAL(c, parsed_pattern); + } } /* Proceed to next thing in the class. */ @@ -3896,22 +4697,18 @@ while (ptr < ptrend) CLASS_CONTINUE: if (ptr >= ptrend) { - errorcode = ERR6; /* Missing terminating ']' */ + if (class_mode_state == CLASS_MODE_PERL_EXT && class_depth_m1 > 0) + errorcode = ERR14; /* Missing terminating ')' */ + if (class_mode_state == CLASS_MODE_ALT_EXT && + class_depth_m1 == 0 && class_maxdepth_m1 == 1) + errorcode = ERR112; /* Missing terminating ']', but we saw '[ [ ]...' */ + else + errorcode = ERR6; /* Missing terminating ']' */ goto FAILED; } GETCHARINCTEST(c, ptr); - if (c == CHAR_RIGHT_SQUARE_BRACKET && !inescq) break; } /* End of class-processing loop */ - /* -] at the end of a class is a literal '-' */ - - if (class_range_state == RANGE_STARTED) - { - parsed_pattern[-1] = CHAR_MINUS; - class_range_state = RANGE_NO; - } - - *parsed_pattern++ = META_CLASS_END; break; /* End of character class */ @@ -3965,10 +4762,11 @@ while (ptr < ptrend) vn = alasnames; if (!read_name(&ptr, ptrend, utf, 0, &offset, &name, &namelen, &errorcode, cb)) goto FAILED; - if (ptr >= ptrend || *ptr != CHAR_COLON) + if (ptr >= ptrend) goto UNCLOSED_PARENTHESIS; + if (*ptr != CHAR_COLON) { errorcode = ERR95; /* Malformed */ - goto FAILED; + goto FAILED_FORWARD; } /* Scan the table of alpha assertion names */ @@ -3994,8 +4792,7 @@ while (ptr < ptrend) if (prev_expect_cond_assert > 0 && (meta < META_LOOKAHEAD || meta > META_LOOKBEHINDNOT)) { - errorcode = (meta == META_LOOKAHEAD_NA || meta == META_LOOKBEHIND_NA)? - ERR98 : ERR28; /* (Atomic) assertion expected */ + errorcode = ERR28; /* Atomic assertion expected */ goto FAILED; } @@ -4004,9 +4801,12 @@ while (ptr < ptrend) switch(meta) { + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); errorcode = ERR89; /* Unknown code; should never occur because */ goto FAILED; /* the meta values come from a table above. */ + /* LCOV_EXCL_STOP */ case META_ATOMIC: goto ATOMIC_GROUP; @@ -4020,6 +4820,15 @@ while (ptr < ptrend) case META_LOOKAHEADNOT: goto NEGATIVE_LOOK_AHEAD; + case META_SCS: + ptr++; + *parsed_pattern++ = META_SCS; + + parsed_pattern = parse_capture_list(&ptr, ptrend, utf, parsed_pattern, + 0, &errorcode, cb); + if (parsed_pattern == NULL) goto FAILED; + goto POST_ASSERTION; + case META_LOOKBEHIND: case META_LOOKBEHINDNOT: case META_LOOKBEHIND_NA: @@ -4051,6 +4860,12 @@ while (ptr < ptrend) top_nest->flags = NSF_ATOMICSR; top_nest->options = options & PARSE_TRACKED_OPTIONS; top_nest->xoptions = xoptions & PARSE_TRACKED_EXTRA_OPTIONS; + +#ifdef PCRE2_DEBUG + /* We'll write out two META_KETs for a single ")" in the input + pattern, so we reserve space for that in our bounds check. */ + parsed_pattern_extra++; +#endif } break; #else /* SUPPORT_UNICODE */ @@ -4110,6 +4925,11 @@ while (ptr < ptrend) verbstartptr = parsed_pattern; okquantifier = (verbs[i].meta == META_ACCEPT); +#ifdef PCRE2_DEBUG + /* Reserve space in our bounds check for optionally wrapping the (*ACCEPT) + with a non-capturing bracket, if there is a following quantifier. */ + if (okquantifier) parsed_pattern_extra += 2; +#endif /* It appears that Perl allows any characters whatsoever, other than a closing parenthesis, to appear in arguments ("names"), so we no longer @@ -4233,7 +5053,6 @@ while (ptr < ptrend) if (!hyphenok) { errorcode = ERR94; - ptr--; /* Correct the offset */ goto FAILED; } optset = &unset; @@ -4307,7 +5126,6 @@ while (ptr < ptrend) default: errorcode = ERR11; - ptr--; /* Correct the offset */ goto FAILED; } } @@ -4376,7 +5194,7 @@ while (ptr < ptrend) if (*ptr != CHAR_EQUALS_SIGN) { errorcode = ERR41; - goto FAILED; + goto FAILED_FORWARD; } if (!read_name(&ptr, ptrend, utf, CHAR_RIGHT_PARENTHESIS, &offset, &name, &namelen, &errorcode, cb)) goto FAILED; @@ -4392,23 +5210,30 @@ while (ptr < ptrend) case CHAR_R: i = 0; /* (?R) == (?R0) */ ptr++; - if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS) + if (ptr >= ptrend || (*ptr != CHAR_RIGHT_PARENTHESIS && *ptr != CHAR_LEFT_PARENTHESIS)) { errorcode = ERR58; goto FAILED; } + terminator = CHAR_NUL; goto SET_RECURSION; /* An item starting (?- followed by a digit comes here via the "default" case because (?- followed by a non-digit is an options setting. */ case CHAR_PLUS: - if (ptrend - ptr < 2 || !IS_DIGIT(ptr[1])) + if (ptr + 1 >= ptrend) + { + ++ptr; + goto UNCLOSED_PARENTHESIS; + } + if (!IS_DIGIT(ptr[1])) { errorcode = ERR29; /* Missing number */ - goto FAILED; + ++ptr; + goto FAILED_FORWARD; } - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case CHAR_0: case CHAR_1: case CHAR_2: case CHAR_3: case CHAR_4: case CHAR_5: case CHAR_6: case CHAR_7: case CHAR_8: case CHAR_9: @@ -4417,38 +5242,56 @@ while (ptr < ptrend) (IS_DIGIT(*ptr))? -1:(int)(cb->bracount), /* + and - are relative */ MAX_GROUP_NUMBER, ERR61, &i, &errorcode)) goto FAILED; - if (i < 0) /* NB (?0) is permitted */ - { - errorcode = ERR15; /* Unknown group */ - goto FAILED_BACK; - } - if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS) - goto UNCLOSED_PARENTHESIS; + PCRE2_ASSERT(i >= 0); /* NB (?0) is permitted, represented by i=0 */ + terminator = CHAR_NUL; SET_RECURSION: *parsed_pattern++ = META_RECURSE | (uint32_t)i; offset = (PCRE2_SIZE)(ptr - cb->start_pattern); - ptr++; - PUTOFFSET(offset, parsed_pattern); - okquantifier = TRUE; - break; /* End of recursive call by number handling */ + /* End of recursive call by number handling */ + goto READ_RECURSION_ARGUMENTS; /* ---- Recursion/subroutine calls by name ---- */ case CHAR_AMPERSAND: RECURSE_BY_NAME: - if (!read_name(&ptr, ptrend, utf, CHAR_RIGHT_PARENTHESIS, &offset, &name, + if (!read_name(&ptr, ptrend, utf, 0, &offset, &name, &namelen, &errorcode, cb)) goto FAILED; *parsed_pattern++ = META_RECURSE_BYNAME; *parsed_pattern++ = namelen; + terminator = CHAR_NUL; + + READ_RECURSION_ARGUMENTS: PUTOFFSET(offset, parsed_pattern); okquantifier = TRUE; + + /* Arguments are not supported for \g construct. */ + if (terminator != CHAR_NUL) break; + + if (ptr < ptrend && *ptr == CHAR_LEFT_PARENTHESIS) + { + parsed_pattern = parse_capture_list(&ptr, ptrend, utf, parsed_pattern, + offset, &errorcode, cb); + if (parsed_pattern == NULL) goto FAILED; + } + + if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS) + goto UNCLOSED_PARENTHESIS; + + ptr++; break; /* ---- Callout with numerical or string argument ---- */ case CHAR_C: + if ((xoptions & PCRE2_EXTRA_NEVER_CALLOUT) != 0) + { + ptr++; + errorcode = ERR103; + goto FAILED; + } + if (++ptr >= ptrend) goto UNCLOSED_PARENTHESIS; /* If the previous item was a condition starting (?(? an assertion, @@ -4497,7 +5340,7 @@ while (ptr < ptrend) if (delimiter == 0) { errorcode = ERR82; - goto FAILED; + goto FAILED_FORWARD; } *parsed_pattern = META_CALLOUT_STRING; @@ -4536,7 +5379,7 @@ while (ptr < ptrend) parsed_pattern += 3; /* Skip pattern info */ while (ptr < ptrend && IS_DIGIT(*ptr)) { - n = n * 10 + *ptr++ - CHAR_0; + n = n * 10 + (*ptr++ - CHAR_0); if (n > 255) { errorcode = ERR38; @@ -4607,6 +5450,7 @@ while (ptr < ptrend) if (read_number(&ptr, ptrend, cb->bracount, MAX_GROUP_NUMBER, ERR61, &i, &errorcode)) { + PCRE2_ASSERT(i >= 0); if (i <= 0) { errorcode = ERR15; @@ -4640,20 +5484,31 @@ while (ptr < ptrend) references its argument twice. */ if (*ptr != CHAR_EQUALS_SIGN || (ptr++, !IS_DIGIT(*ptr))) - goto BAD_VERSION_CONDITION; + { + errorcode = ERR79; + if (!ge) goto FAILED_FORWARD; + goto FAILED; + } if (!read_number(&ptr, ptrend, -1, 1000, ERR79, &major, &errorcode)) goto FAILED; - if (ptr >= ptrend) goto BAD_VERSION_CONDITION; - if (*ptr == CHAR_DOT) + if (ptr < ptrend && *ptr == CHAR_DOT) { - if (++ptr >= ptrend || !IS_DIGIT(*ptr)) goto BAD_VERSION_CONDITION; - minor = (*ptr++ - CHAR_0) * 10; - if (ptr >= ptrend) goto BAD_VERSION_CONDITION; - if (IS_DIGIT(*ptr)) minor += *ptr++ - CHAR_0; - if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS) - goto BAD_VERSION_CONDITION; + if (++ptr >= ptrend || !IS_DIGIT(*ptr)) + { + errorcode = ERR79; + if (ptr < ptrend) goto FAILED_FORWARD; + goto FAILED; + } + if (!read_number(&ptr, ptrend, -1, 1000, ERR79, &minor, &errorcode)) + goto FAILED; + } + if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS) + { + errorcode = ERR79; + if (ptr < ptrend) goto FAILED_FORWARD; + goto FAILED; } *parsed_pattern++ = META_COND_VERSION; @@ -4687,6 +5542,7 @@ while (ptr < ptrend) terminator = CHAR_RIGHT_PARENTHESIS; ptr--; /* Point to char before name */ } + if (!read_name(&ptr, ptrend, utf, terminator, &offset, &name, &namelen, &errorcode, cb)) goto FAILED; @@ -4757,7 +5613,7 @@ while (ptr < ptrend) goto POST_ASSERTION; case CHAR_ASTERISK: - POSITIVE_NONATOMIC_LOOK_AHEAD: /* Come from (?* */ + POSITIVE_NONATOMIC_LOOK_AHEAD: /* Come from (*napla: */ *parsed_pattern++ = META_LOOKAHEAD_NA; ptr++; goto POST_ASSERTION; @@ -4866,21 +5722,37 @@ while (ptr < ptrend) scanning in case this is a duplicate with the same number. For non-duplicate names, give an error if the number is duplicated. */ - isdupname = FALSE; + is_dupname = FALSE; + hash = PRIV(compile_get_hash_from_name)(name, namelen); ng = cb->named_groups; for (i = 0; i < cb->names_found; i++, ng++) { - if (namelen == ng->length && + if (namelen == ng->length && hash == NAMED_GROUP_GET_HASH(ng) && PRIV(strncmp)(name, ng->name, (PCRE2_SIZE)namelen) == 0) { + /* When a bracket is referenced by the same name multiple + times, is not considered as a duplicate and ignored. */ if (ng->number == cb->bracount) break; if ((options & PCRE2_DUPNAMES) == 0) { errorcode = ERR43; goto FAILED; } - isdupname = ng->isdup = TRUE; /* Mark as a duplicate */ + + ng->hash_dup |= NAMED_GROUP_IS_DUPNAME; + is_dupname = TRUE; /* Mark as a duplicate */ cb->dupnames = TRUE; /* Duplicate names exist */ + + /* The entry represents a duplicate. */ + name = ng->name; + namelen = 0; + + /* Even duplicated names may refer to the same + capture index. These references are also ignored. */ + for (; i < cb->names_found; i++, ng++) + if (ng->name == name && ng->number == cb->bracount) + break; + break; } else if (ng->number == cb->bracount) { @@ -4889,7 +5761,8 @@ while (ptr < ptrend) } } - if (i < cb->names_found) break; /* Ignore duplicate with same number */ + /* Ignore duplicate with same number. */ + if (i < cb->names_found) break; /* Increase the list size if necessary */ @@ -4915,13 +5788,27 @@ while (ptr < ptrend) } /* Add this name to the list */ + if (is_dupname) + hash |= NAMED_GROUP_IS_DUPNAME; cb->named_groups[cb->names_found].name = name; cb->named_groups[cb->names_found].length = (uint16_t)namelen; cb->named_groups[cb->names_found].number = cb->bracount; - cb->named_groups[cb->names_found].isdup = (uint16_t)isdupname; + cb->named_groups[cb->names_found].hash_dup = hash; cb->names_found++; break; + + + /* ---- Perl extended character class ---- */ + + /* These are of the form '(?[...])'. We handle these via the same parser + that consumes ordinary '[...]' classes, but with a flag set to activate + the extended behaviour. */ + + case CHAR_LEFT_SQUARE_BRACKET: + class_mode_state = CLASS_MODE_PERL_EXT; + c = *ptr++; + goto FROM_PERL_EXTENDED_CLASS; } /* End of (? switch */ break; /* End of ( handling */ @@ -4960,6 +5847,11 @@ while (ptr < ptrend) if ((top_nest->flags & NSF_ATOMICSR) != 0) { *parsed_pattern++ = META_KET; + +#ifdef PCRE2_DEBUG + PCRE2_ASSERT(parsed_pattern_extra > 0); + parsed_pattern_extra--; +#endif } if (top_nest == (nest_save *)(cb->start_workspace)) top_nest = NULL; @@ -4968,7 +5860,7 @@ while (ptr < ptrend) if (nest_depth == 0) /* Unmatched closing parenthesis */ { errorcode = ERR22; - goto FAILED_BACK; + goto FAILED; } nest_depth--; *parsed_pattern++ = META_KET; @@ -4984,9 +5876,15 @@ if (inverbname && ptr >= ptrend) goto FAILED; } -/* Manage callout for the final item */ PARSED_END: + +PCRE2_ASSERT((parsed_pattern - parsed_pattern_check) + + (parsed_pattern_extra - parsed_pattern_extra_check) <= + max_parsed_pattern(ptr_check, ptr, utf, options)); + +/* Manage callout for the final item */ + parsed_pattern = manage_callouts(ptr, &previous_callout, auto_callout, parsed_pattern, cb); @@ -5007,11 +5905,14 @@ else if ((xoptions & PCRE2_EXTRA_MATCH_WORD) != 0) /* Terminate the parsed pattern, then return success if all groups are closed. Otherwise we have unclosed parentheses. */ +/* LCOV_EXCL_START */ if (parsed_pattern >= parsed_pattern_end) { + PCRE2_DEBUG_UNREACHABLE(); errorcode = ERR63; /* Internal error (parsed pattern overflow) */ goto FAILED; } +/* LCOV_EXCL_STOP */ *parsed_pattern = META_END; if (nest_depth == 0) return 0; @@ -5029,12 +5930,18 @@ return errorcode; FAILED_BACK: ptr--; +#ifdef SUPPORT_UNICODE +if (utf) BACKCHAR(ptr); +#endif goto FAILED; -/* This failure happens several times. */ +/* Some errors need to indicate the next character. */ -BAD_VERSION_CONDITION: -errorcode = ERR79; +FAILED_FORWARD: +ptr++; +#ifdef SUPPORT_UNICODE +if (utf) FORWARDCHARTEST(ptr, ptrend); +#endif goto FAILED; } @@ -5078,7 +5985,7 @@ for (;;) case OP_UCP_WORD_BOUNDARY: case OP_NOT_UCP_WORD_BOUNDARY: if (!skipassert) return code; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_CALLOUT: case OP_CREF: @@ -5118,485 +6025,10 @@ for (;;) return code; } } -/* Control never reaches here */ -} - - - -#ifdef SUPPORT_UNICODE -/************************************************* -* Get othercase range * -*************************************************/ - -/* This function is passed the start and end of a class range in UCP mode. For -single characters the range may be just one character long. The function -searches up the characters, looking for ranges of characters in the "other" -case. Each call returns the next one, updating the start address. A character -with multiple other cases is returned on its own with a special return value. - -Arguments: - cptr points to starting character value; updated - d end value - ocptr where to put start of othercase range - odptr where to put end of othercase range - restricted TRUE if caseless restriction applies - -Yield: -1 when no more - 0 when a range is returned - >0 the CASESET offset for char with multiple other cases; - for this return, *ocptr contains the original -*/ - -static int -get_othercase_range(uint32_t *cptr, uint32_t d, uint32_t *ocptr, - uint32_t *odptr, BOOL restricted) -{ -uint32_t c, othercase, next; -unsigned int co; - -/* Find the first character that has an other case. If it has multiple other -cases, return its case offset value. When CASELESS_RESTRICT is set, ignore the -multi-case entries that begin with ASCII values. In 32-bit mode, a value -greater than the Unicode maximum ends the range. */ - -for (c = *cptr; c <= d; c++) - { -#if PCRE2_CODE_UNIT_WIDTH == 32 - if (c > MAX_UTF_CODE_POINT) return -1; -#endif - if ((co = UCD_CASESET(c)) != 0 && - (!restricted || PRIV(ucd_caseless_sets)[co] > 127)) - { - *ocptr = c++; /* Character that has the set */ - *cptr = c; /* Rest of input range */ - return (int)co; - } - - /* This is not a valid multiple-case character. Check that the single other - case is different to the original. We don't need to check "restricted" here - because the non-ASCII characters with multiple cases that include an ASCII - character don't have a different "othercase". */ - - if ((othercase = UCD_OTHERCASE(c)) != c) break; - } - -if (c > d) return -1; /* Reached end of range */ - -/* Found a character that has a single other case. Search for the end of the -range, which is either the end of the input range, or a character that has zero -or more than one other cases. */ - -*ocptr = othercase; -next = othercase + 1; - -for (++c; c <= d; c++) - { - if ((co = UCD_CASESET(c)) != 0 || UCD_OTHERCASE(c) != next) break; - next++; - } - -*odptr = next - 1; /* End of othercase range */ -*cptr = c; /* Rest of input range */ -return 0; -} -#endif /* SUPPORT_UNICODE */ - - - -/************************************************* -* Add a character or range to a class (internal) * -*************************************************/ - -/* This function packages up the logic of adding a character or range of -characters to a class. The character values in the arguments will be within the -valid values for the current mode (8-bit, 16-bit, UTF, etc). This function is -called only from within the "add to class" group of functions, some of which -are recursive and mutually recursive. The external entry point is -add_to_class(). - -Arguments: - classbits the bit map for characters < 256 - uchardptr points to the pointer for extra data - options the options bits - xoptions the extra options bits - cb compile data - start start of range character - end end of range character - -Returns: the number of < 256 characters added - the pointer to extra data is updated -*/ - -static unsigned int -add_to_class_internal(uint8_t *classbits, PCRE2_UCHAR **uchardptr, - uint32_t options, uint32_t xoptions, compile_block *cb, uint32_t start, - uint32_t end) -{ -uint32_t c; -uint32_t classbits_end = (end <= 0xff ? end : 0xff); -unsigned int n8 = 0; - -/* If caseless matching is required, scan the range and process alternate -cases. In Unicode, there are 8-bit characters that have alternate cases that -are greater than 255 and vice-versa (though these may be ignored if caseless -restriction is in force). Sometimes we can just extend the original range. */ - -if ((options & PCRE2_CASELESS) != 0) - { -#ifdef SUPPORT_UNICODE - if ((options & (PCRE2_UTF|PCRE2_UCP)) != 0) - { - int rc; - uint32_t oc, od; - - options &= ~PCRE2_CASELESS; /* Remove for recursive calls */ - c = start; - - while ((rc = get_othercase_range(&c, end, &oc, &od, - (xoptions & PCRE2_EXTRA_CASELESS_RESTRICT) != 0)) >= 0) - { - /* Handle a single character that has more than one other case. */ - - if (rc > 0) n8 += add_list_to_class_internal(classbits, uchardptr, - options, xoptions, cb, PRIV(ucd_caseless_sets) + rc, oc); - - /* Do nothing if the other case range is within the original range. */ - - else if (oc >= cb->class_range_start && od <= cb->class_range_end) - continue; - - /* Extend the original range if there is overlap, noting that if oc < c, - we can't have od > end because a subrange is always shorter than the - basic range. Otherwise, use a recursive call to add the additional range. - */ - - else if (oc < start && od >= start - 1) start = oc; /* Extend downwards */ - else if (od > end && oc <= end + 1) - { - end = od; /* Extend upwards */ - if (end > classbits_end) classbits_end = (end <= 0xff ? end : 0xff); - } - else n8 += add_to_class_internal(classbits, uchardptr, options, xoptions, - cb, oc, od); - } - } - else -#else - (void)xoptions; /* Avoid compiler warning */ -#endif /* SUPPORT_UNICODE */ - - /* Not UTF mode */ - - for (c = start; c <= classbits_end; c++) - { - SETBIT(classbits, cb->fcc[c]); - n8++; - } - } - -/* Now handle the originally supplied range. Adjust the final value according -to the bit length - this means that the same lists of (e.g.) horizontal spaces -can be used in all cases. */ - -if ((options & PCRE2_UTF) == 0 && end > MAX_NON_UTF_CHAR) - end = MAX_NON_UTF_CHAR; - -if (start > cb->class_range_start && end < cb->class_range_end) return n8; - -/* Use the bitmap for characters < 256. Otherwise use extra data.*/ - -for (c = start; c <= classbits_end; c++) - { - /* Regardless of start, c will always be <= 255. */ - SETBIT(classbits, c); - n8++; - } - -#ifdef SUPPORT_WIDE_CHARS -if (start <= 0xff) start = 0xff + 1; - -if (end >= start) - { - PCRE2_UCHAR *uchardata = *uchardptr; - -#ifdef SUPPORT_UNICODE - if ((options & PCRE2_UTF) != 0) - { - if (start < end) - { - *uchardata++ = XCL_RANGE; - uchardata += PRIV(ord2utf)(start, uchardata); - uchardata += PRIV(ord2utf)(end, uchardata); - } - else if (start == end) - { - *uchardata++ = XCL_SINGLE; - uchardata += PRIV(ord2utf)(start, uchardata); - } - } - else -#endif /* SUPPORT_UNICODE */ - - /* Without UTF support, character values are constrained by the bit length, - and can only be > 256 for 16-bit and 32-bit libraries. */ - -#if PCRE2_CODE_UNIT_WIDTH == 8 - {} -#else - if (start < end) - { - *uchardata++ = XCL_RANGE; - *uchardata++ = start; - *uchardata++ = end; - } - else if (start == end) - { - *uchardata++ = XCL_SINGLE; - *uchardata++ = start; - } -#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ - *uchardptr = uchardata; /* Updata extra data pointer */ - } -#else /* SUPPORT_WIDE_CHARS */ - (void)uchardptr; /* Avoid compiler warning */ -#endif /* SUPPORT_WIDE_CHARS */ - -return n8; /* Number of 8-bit characters */ -} - - - -#ifdef SUPPORT_UNICODE -/************************************************* -* Add a list of characters to a class (internal) * -*************************************************/ - -/* This function is used for adding a list of case-equivalent characters to a -class when in UTF mode. This function is called only from within -add_to_class_internal(), with which it is mutually recursive. - -Arguments: - classbits the bit map for characters < 256 - uchardptr points to the pointer for extra data - options the options bits - xoptions the extra options bits - cb contains pointers to tables etc. - p points to row of 32-bit values, terminated by NOTACHAR - except character to omit; this is used when adding lists of - case-equivalent characters to avoid including the one we - already know about - -Returns: the number of < 256 characters added - the pointer to extra data is updated -*/ - -static unsigned int -add_list_to_class_internal(uint8_t *classbits, PCRE2_UCHAR **uchardptr, - uint32_t options, uint32_t xoptions, compile_block *cb, const uint32_t *p, - unsigned int except) -{ -unsigned int n8 = 0; -while (p[0] < NOTACHAR) - { - unsigned int n = 0; - if (p[0] != except) - { - while(p[n+1] == p[0] + n + 1) n++; - n8 += add_to_class_internal(classbits, uchardptr, options, xoptions, cb, - p[0], p[n]); - } - p += n + 1; - } -return n8; -} -#endif - - - -/************************************************* -* External entry point for add range to class * -*************************************************/ - -/* This function sets the overall range so that the internal functions can try -to avoid duplication when handling case-independence. - -Arguments: - classbits the bit map for characters < 256 - uchardptr points to the pointer for extra data - options the options bits - xoptions the extra options bits - cb compile data - start start of range character - end end of range character - -Returns: the number of < 256 characters added - the pointer to extra data is updated -*/ - -static unsigned int -add_to_class(uint8_t *classbits, PCRE2_UCHAR **uchardptr, uint32_t options, - uint32_t xoptions, compile_block *cb, uint32_t start, uint32_t end) -{ -cb->class_range_start = start; -cb->class_range_end = end; -return add_to_class_internal(classbits, uchardptr, options, xoptions, cb, - start, end); -} - - -/************************************************* -* External entry point for add list to class * -*************************************************/ - -/* This function is used for adding a list of horizontal or vertical whitespace -characters to a class. The list must be in order so that ranges of characters -can be detected and handled appropriately. This function sets the overall range -so that the internal functions can try to avoid duplication when handling -case-independence. - -Arguments: - classbits the bit map for characters < 256 - uchardptr points to the pointer for extra data - options the options bits - xoptions the extra options bits - cb contains pointers to tables etc. - p points to row of 32-bit values, terminated by NOTACHAR - except character to omit; this is used when adding lists of - case-equivalent characters to avoid including the one we - already know about - -Returns: the number of < 256 characters added - the pointer to extra data is updated -*/ - -static unsigned int -add_list_to_class(uint8_t *classbits, PCRE2_UCHAR **uchardptr, uint32_t options, - uint32_t xoptions, compile_block *cb, const uint32_t *p, unsigned int except) -{ -unsigned int n8 = 0; -while (p[0] < NOTACHAR) - { - unsigned int n = 0; - if (p[0] != except) - { - while(p[n+1] == p[0] + n + 1) n++; - cb->class_range_start = p[0]; - cb->class_range_end = p[n]; - n8 += add_to_class_internal(classbits, uchardptr, options, xoptions, cb, - p[0], p[n]); - } - p += n + 1; - } -return n8; -} - - - -/************************************************* -* Add characters not in a list to a class * -*************************************************/ - -/* This function is used for adding the complement of a list of horizontal or -vertical whitespace to a class. The list must be in order. - -Arguments: - classbits the bit map for characters < 256 - uchardptr points to the pointer for extra data - options the options bits - xoptions the extra options bits - cb contains pointers to tables etc. - p points to row of 32-bit values, terminated by NOTACHAR - -Returns: the number of < 256 characters added - the pointer to extra data is updated -*/ - -static unsigned int -add_not_list_to_class(uint8_t *classbits, PCRE2_UCHAR **uchardptr, - uint32_t options, uint32_t xoptions, compile_block *cb, const uint32_t *p) -{ -BOOL utf = (options & PCRE2_UTF) != 0; -unsigned int n8 = 0; -if (p[0] > 0) - n8 += add_to_class(classbits, uchardptr, options, xoptions, cb, 0, p[0] - 1); -while (p[0] < NOTACHAR) - { - while (p[1] == p[0] + 1) p++; - n8 += add_to_class(classbits, uchardptr, options, xoptions, cb, p[0] + 1, - (p[1] == NOTACHAR) ? (utf ? 0x10ffffu : 0xffffffffu) : p[1] - 1); - p++; - } -return n8; -} - - - -/************************************************* -* Find details of duplicate group names * -*************************************************/ - -/* This is called from compile_branch() when it needs to know the index and -count of duplicates in the names table when processing named backreferences, -either directly, or as conditions. - -Arguments: - name points to the name - length the length of the name - indexptr where to put the index - countptr where to put the count of duplicates - errorcodeptr where to put an error code - cb the compile block - -Returns: TRUE if OK, FALSE if not, error code set -*/ - -static BOOL -find_dupname_details(PCRE2_SPTR name, uint32_t length, int *indexptr, - int *countptr, int *errorcodeptr, compile_block *cb) -{ -uint32_t i, groupnumber; -int count; -PCRE2_UCHAR *slot = cb->name_table; - -/* Find the first entry in the table */ - -for (i = 0; i < cb->names_found; i++) - { - if (PRIV(strncmp)(name, slot+IMM2_SIZE, length) == 0 && - slot[IMM2_SIZE+length] == 0) break; - slot += cb->name_entry_size; - } - -/* This should not occur, because this function is called only when we know we -have duplicate names. Give an internal error. */ - -if (i >= cb->names_found) - { - *errorcodeptr = ERR53; - cb->erroroffset = name - cb->start_pattern; - return FALSE; - } - -/* Record the index and then see how many duplicates there are, updating the -backref map and maximum back reference as we do. */ - -*indexptr = i; -count = 0; - -for (;;) - { - count++; - groupnumber = GET2(slot,0); - cb->backref_map |= (groupnumber < 32)? (1u << groupnumber) : 1; - if (groupnumber > cb->top_backref) cb->top_backref = groupnumber; - if (++i >= cb->names_found) break; - slot += cb->name_entry_size; - if (PRIV(strncmp)(name, slot+IMM2_SIZE, length) != 0 || - (slot+IMM2_SIZE)[length] != 0) break; - } - -*countptr = count; -return TRUE; + +/* LCOV_EXCL_START */ +PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */ +/* LCOV_EXCL_STOP */ } @@ -5649,12 +6081,13 @@ uint32_t options = *optionsptr; /* May change dynamically */ uint32_t xoptions = *xoptionsptr; /* May change dynamically */ uint32_t firstcu, reqcu; uint32_t zeroreqcu, zerofirstcu; -uint32_t escape; uint32_t *pptr = *pptrptr; uint32_t meta, meta_arg; uint32_t firstcuflags, reqcuflags; uint32_t zeroreqcuflags, zerofirstcuflags; uint32_t req_caseopt, reqvary, tempreqvary; +/* Some opcodes, such as META_CAPTURE_NUMBER or META_CAPTURE_NAME, +depends on the previous value of offset. */ PCRE2_SIZE offset = 0; PCRE2_SIZE length_prevgroup = 0; PCRE2_UCHAR *code = *codeptr; @@ -5668,8 +6101,6 @@ BOOL had_accept = FALSE; BOOL matched_char = FALSE; BOOL previous_matched_char = FALSE; BOOL reset_caseful = FALSE; -const uint8_t *cbits = cb->cbits; -uint8_t classbits[32]; /* We can fish out the UTF setting once and for all into a BOOL, but we must not do this for other options (e.g. PCRE2_EXTENDED) that may change dynamically @@ -5682,17 +6113,6 @@ BOOL ucp = (options & PCRE2_UCP) != 0; BOOL utf = FALSE; #endif -/* Helper variables for OP_XCLASS opcode (for characters > 255). We define -class_uchardata always so that it can be passed to add_to_class() always, -though it will not be used in non-UTF 8-bit cases. This avoids having to supply -alternative calls for the different cases. */ - -PCRE2_UCHAR *class_uchardata; -#ifdef SUPPORT_WIDE_CHARS -BOOL xclass; -PCRE2_UCHAR *class_uchardata_base; -#endif - /* Set up the default and non-default settings for greediness */ greedy_default = ((options & PCRE2_UNGREEDY) != 0); @@ -5722,15 +6142,8 @@ req_caseopt = ((options & PCRE2_CASELESS) != 0)? REQ_CASELESS : 0; for (;; pptr++) { -#ifdef SUPPORT_WIDE_CHARS - BOOL xclass_has_prop; -#endif - BOOL negate_class; - BOOL should_flip_negation; - BOOL match_all_or_no_wide_chars; BOOL possessive_quantifier; BOOL note_group_empty; - int class_has_8bitchar; uint32_t mclength; uint32_t skipunits; uint32_t subreqcu, subfirstcu; @@ -5750,11 +6163,21 @@ for (;; pptr++) if (lengthptr != NULL) { + /* LCOV_EXCL_START */ + if (code >= cb->start_workspace + cb->workspace_size) + { + PCRE2_DEBUG_UNREACHABLE(); + *errorcodeptr = ERR52; /* Over-ran workspace - internal error */ + cb->erroroffset = 0; + return 0; + } + /* LCOV_EXCL_STOP */ + if (code > cb->start_workspace + cb->workspace_size - WORK_SIZE_SAFETY_MARGIN) /* Check for overrun */ { - *errorcodeptr = (code >= cb->start_workspace + cb->workspace_size)? - ERR52 : ERR86; + *errorcodeptr = ERR86; /* Pattern too complicated */ + cb->erroroffset = 0; return 0; } @@ -5772,15 +6195,18 @@ for (;; pptr++) if (meta < META_ASTERISK || meta > META_MINMAX_QUERY) { - if (OFLOW_MAX - *lengthptr < (PCRE2_SIZE)(code - orig_code)) + if (*lengthptr > OFLOW_MAX || + OFLOW_MAX - *lengthptr < (PCRE2_SIZE)(code - orig_code)) { *errorcodeptr = ERR20; /* Integer overflow */ + cb->erroroffset = 0; return 0; } *lengthptr += (PCRE2_SIZE)(code - orig_code); if (*lengthptr > MAX_PATTERN_SIZE) { *errorcodeptr = ERR20; /* Pattern is too large */ + cb->erroroffset = 0; return 0; } code = orig_code; @@ -5860,13 +6286,24 @@ for (;; pptr++) /* ===================================================================*/ /* Empty character classes are allowed if PCRE2_ALLOW_EMPTY_CLASS is set. Otherwise, an initial ']' is taken as a data character. When empty classes - are allowed, [] must always fail, so generate OP_FAIL, whereas [^] must - match any character, so generate OP_ALLANY. */ + are allowed, [] must generate an empty class - we have no dedicated opcode + to optimise the representation, but it's a rare case (the '(*FAIL)' + construct would be a clearer way for a pattern author to represent a + non-matching branch, but it does have different semantics to '[]' if both + are followed by a quantifier). The empty-negated [^] matches any character, + so is useful: generate OP_ALLANY for this. */ case META_CLASS_EMPTY: case META_CLASS_EMPTY_NOT: matched_char = TRUE; - *code++ = (meta == META_CLASS_EMPTY_NOT)? OP_ALLANY : OP_FAIL; + if (meta == META_CLASS_EMPTY_NOT) *code++ = OP_ALLANY; + else + { + *code++ = OP_CLASS; + memset(code, 0, 32); + code += 32 / sizeof(PCRE2_UCHAR); + } + if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE; zerofirstcu = firstcu; zerofirstcuflags = firstcuflags; @@ -5889,7 +6326,16 @@ for (;; pptr++) case META_CLASS_NOT: case META_CLASS: matched_char = TRUE; - negate_class = meta == META_CLASS_NOT; + + /* Check for complex extended classes and handle them separately. */ + + if ((*pptr & CLASS_IS_ECLASS) != 0) + { + if (!PRIV(compile_class_nested)(options, xoptions, &pptr, &code, + errorcodeptr, cb, lengthptr)) + return 0; + goto CLASS_END_PROCESSING; + } /* We can optimize the case of a single character in a class by generating OP_CHAR or OP_CHARI if it's positive, or OP_NOT or OP_NOTI if it's @@ -5902,9 +6348,6 @@ for (;; pptr++) if (pptr[1] < META_END && pptr[2] == META_CLASS_END) { -#ifdef SUPPORT_UNICODE - uint32_t d; -#endif uint32_t c = pptr[1]; pptr += 2; /* Move on to class end */ @@ -5925,18 +6368,35 @@ for (;; pptr++) /* For caseless UTF or UCP mode, check whether this character has more than one other case. If so, generate a special OP_NOTPROP item instead of OP_NOTI. When restricted by PCRE2_EXTRA_CASELESS_RESTRICT, ignore any - caseless set that starts with an ASCII character. */ + caseless set that starts with an ASCII character. If the character is + affected by the special Turkish rules, hardcode the not-matching + characters using a caseset. */ #ifdef SUPPORT_UNICODE - if ((utf||ucp) && (options & PCRE2_CASELESS) != 0 && - (d = UCD_CASESET(c)) != 0 && - ((xoptions & PCRE2_EXTRA_CASELESS_RESTRICT) == 0 || - PRIV(ucd_caseless_sets)[d] > 127)) + if ((utf||ucp) && (options & PCRE2_CASELESS) != 0) { - *code++ = OP_NOTPROP; - *code++ = PT_CLIST; - *code++ = d; - break; /* We are finished with this class */ + uint32_t caseset; + + if ((xoptions & (PCRE2_EXTRA_TURKISH_CASING|PCRE2_EXTRA_CASELESS_RESTRICT)) == + PCRE2_EXTRA_TURKISH_CASING && + UCD_ANY_I(c)) + { + caseset = PRIV(ucd_turkish_dotted_i_caseset) + (UCD_DOTTED_I(c)? 0 : 3); + } + else if ((caseset = UCD_CASESET(c)) != 0 && + (xoptions & PCRE2_EXTRA_CASELESS_RESTRICT) != 0 && + PRIV(ucd_caseless_sets)[caseset] < 128) + { + caseset = 0; /* Ignore the caseless set if it's restricted. */ + } + + if (caseset != 0) + { + *code++ = OP_NOTPROP; + *code++ = PT_CLIST; + *code++ = caseset; + break; /* We are finished with this class */ + } } #endif /* Char has only one other (usable) case, or UCP not available */ @@ -5951,7 +6411,8 @@ for (;; pptr++) they are case partners. This can be optimized to generate a caseless single character match (which also sets first/required code units if relevant). When casing restrictions apply, ignore a caseless set if both characters - are ASCII. */ + are ASCII. When Turkish casing applies, an 'i' does not match its normal + Unicode "othercase". */ if (meta == META_CLASS && pptr[1] < META_END && pptr[2] < META_END && pptr[3] == META_CLASS_END) @@ -5959,9 +6420,12 @@ for (;; pptr++) uint32_t c = pptr[1]; #ifdef SUPPORT_UNICODE - if (UCD_CASESET(c) == 0 || - ((xoptions & PCRE2_EXTRA_CASELESS_RESTRICT) != 0 && - c < 128 && pptr[2] < 128)) + if ((UCD_CASESET(c) == 0 || + ((xoptions & PCRE2_EXTRA_CASELESS_RESTRICT) != 0 && + c < 128 && pptr[2] < 128)) && + !((xoptions & (PCRE2_EXTRA_TURKISH_CASING|PCRE2_EXTRA_CASELESS_RESTRICT)) == + PCRE2_EXTRA_TURKISH_CASING && + UCD_ANY_I(c))) #endif { uint32_t d; @@ -5991,384 +6455,15 @@ for (;; pptr++) } } - /* If a non-extended class contains a negative special such as \S, we need - to flip the negation flag at the end, so that support for characters > 255 - works correctly (they are all included in the class). An extended class may - need to insert specific matching or non-matching code for wide characters. - */ - - should_flip_negation = match_all_or_no_wide_chars = FALSE; - - /* Extended class (xclass) will be used when characters > 255 - might match. */ - -#ifdef SUPPORT_WIDE_CHARS - xclass = FALSE; - class_uchardata = code + LINK_SIZE + 2; /* For XCLASS items */ - class_uchardata_base = class_uchardata; /* Save the start */ -#endif - - /* For optimization purposes, we track some properties of the class: - class_has_8bitchar will be non-zero if the class contains at least one - character with a code point less than 256; xclass_has_prop will be TRUE if - Unicode property checks are present in the class. */ - - class_has_8bitchar = 0; -#ifdef SUPPORT_WIDE_CHARS - xclass_has_prop = FALSE; -#endif - - /* Initialize the 256-bit (32-byte) bit map to all zeros. We build the map - in a temporary bit of memory, in case the class contains fewer than two - 8-bit characters because in that case the compiled code doesn't use the bit - map. */ - - memset(classbits, 0, 32 * sizeof(uint8_t)); - - /* Process items until META_CLASS_END is reached. */ - - while ((meta = *(++pptr)) != META_CLASS_END) - { - /* Handle POSIX classes such as [:alpha:] etc. */ - - if (meta == META_POSIX || meta == META_POSIX_NEG) - { - BOOL local_negate = (meta == META_POSIX_NEG); - int posix_class = *(++pptr); - int taboffset, tabopt; - uint8_t pbits[32]; - - should_flip_negation = local_negate; /* Note negative special */ - - /* If matching is caseless, upper and lower are converted to alpha. - This relies on the fact that the class table starts with alpha, - lower, upper as the first 3 entries. */ - - if ((options & PCRE2_CASELESS) != 0 && posix_class <= 2) - posix_class = 0; - - /* When PCRE2_UCP is set, some of the POSIX classes are converted to - different escape sequences that use Unicode properties \p or \P. - Others that are not available via \p or \P have to generate - XCL_PROP/XCL_NOTPROP directly, which is done here. */ - -#ifdef SUPPORT_UNICODE - if ((options & PCRE2_UCP) != 0 && - (xoptions & PCRE2_EXTRA_ASCII_POSIX) == 0) - { - switch(posix_class) - { - case PC_GRAPH: - case PC_PRINT: - case PC_PUNCT: - *class_uchardata++ = local_negate? XCL_NOTPROP : XCL_PROP; - *class_uchardata++ = (PCRE2_UCHAR) - ((posix_class == PC_GRAPH)? PT_PXGRAPH : - (posix_class == PC_PRINT)? PT_PXPRINT : PT_PXPUNCT); - *class_uchardata++ = 0; - xclass_has_prop = TRUE; - goto CONTINUE_CLASS; - - /* For the other POSIX classes (ex: ascii) we are going to - fall through to the non-UCP case and build a bit map for - characters with code points less than 256. However, if we are in - a negated POSIX class, characters with code points greater than - 255 must either all match or all not match, depending on whether - the whole class is not or is negated. For example, for - [[:^ascii:]... they must all match, whereas for [^[:^ascii:]... - they must not. - - In the special case where there are no xclass items, this is - automatically handled by the use of OP_CLASS or OP_NCLASS, but an - explicit range is needed for OP_XCLASS. Setting a flag here - causes the range to be generated later when it is known that - OP_XCLASS is required. In the 8-bit library this is relevant only in - utf mode, since no wide characters can exist otherwise. */ - - default: -#if PCRE2_CODE_UNIT_WIDTH == 8 - if (utf) -#endif - match_all_or_no_wide_chars |= local_negate; - break; - } - } -#endif /* SUPPORT_UNICODE */ - - /* In the non-UCP case, or when UCP makes no difference, we build the - bit map for the POSIX class in a chunk of local store because we may - be adding and subtracting from it, and we don't want to subtract bits - that may be in the main map already. At the end we or the result into - the bit map that is being built. */ - - posix_class *= 3; - - /* Copy in the first table (always present) */ - - memcpy(pbits, cbits + posix_class_maps[posix_class], - 32 * sizeof(uint8_t)); - - /* If there is a second table, add or remove it as required. */ - - taboffset = posix_class_maps[posix_class + 1]; - tabopt = posix_class_maps[posix_class + 2]; - - if (taboffset >= 0) - { - if (tabopt >= 0) - for (int i = 0; i < 32; i++) pbits[i] |= cbits[(int)i + taboffset]; - else - for (int i = 0; i < 32; i++) pbits[i] &= ~cbits[(int)i + taboffset]; - } - - /* Now see if we need to remove any special characters. An option - value of 1 removes vertical space and 2 removes underscore. */ - - if (tabopt < 0) tabopt = -tabopt; - if (tabopt == 1) pbits[1] &= ~0x3c; - else if (tabopt == 2) pbits[11] &= 0x7f; - - /* Add the POSIX table or its complement into the main table that is - being built and we are done. */ - - if (local_negate) - for (int i = 0; i < 32; i++) classbits[i] |= (uint8_t)(~pbits[i]); - else - for (int i = 0; i < 32; i++) classbits[i] |= pbits[i]; - - /* Every class contains at least one < 256 character. */ - - class_has_8bitchar = 1; - goto CONTINUE_CLASS; /* End of POSIX handling */ - } - - /* Other than POSIX classes, the only items we should encounter are - \d-type escapes and literal characters (possibly as ranges). */ - - if (meta == META_BIGVALUE) - { - meta = *(++pptr); - goto CLASS_LITERAL; - } - - /* Any other non-literal must be an escape */ - - if (meta >= META_END) - { - if (META_CODE(meta) != META_ESCAPE) - { -#ifdef DEBUG_SHOW_PARSED - fprintf(stderr, "** Unrecognized parsed pattern item 0x%.8x " - "in character class\n", meta); -#endif - *errorcodeptr = ERR89; /* Internal error - unrecognized. */ - return 0; - } - escape = META_DATA(meta); - - /* Every class contains at least one < 256 character. */ + /* Now emit the OP_CLASS/OP_NCLASS/OP_XCLASS/OP_ALLANY opcode. */ - class_has_8bitchar++; + pptr = PRIV(compile_class_not_nested)(options, xoptions, pptr + 1, + &code, meta == META_CLASS_NOT, NULL, + errorcodeptr, cb, lengthptr); + if (pptr == NULL) return 0; + PCRE2_ASSERT(*pptr == META_CLASS_END); - switch(escape) - { - case ESC_d: - for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_digit]; - break; - - case ESC_D: - should_flip_negation = TRUE; - for (int i = 0; i < 32; i++) - classbits[i] |= (uint8_t)(~cbits[i+cbit_digit]); - break; - - case ESC_w: - for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_word]; - break; - - case ESC_W: - should_flip_negation = TRUE; - for (int i = 0; i < 32; i++) - classbits[i] |= (uint8_t)(~cbits[i+cbit_word]); - break; - - /* Perl 5.004 onwards omitted VT from \s, but restored it at Perl - 5.18. Before PCRE 8.34, we had to preserve the VT bit if it was - previously set by something earlier in the character class. - Luckily, the value of CHAR_VT is 0x0b in both ASCII and EBCDIC, so - we could just adjust the appropriate bit. From PCRE 8.34 we no - longer treat \s and \S specially. */ - - case ESC_s: - for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_space]; - break; - - case ESC_S: - should_flip_negation = TRUE; - for (int i = 0; i < 32; i++) - classbits[i] |= (uint8_t)(~cbits[i+cbit_space]); - break; - - /* When adding the horizontal or vertical space lists to a class, or - their complements, disable PCRE2_CASELESS, because it justs wastes - time, and in the "not-x" UTF cases can create unwanted duplicates in - the XCLASS list (provoked by characters that have more than one other - case and by both cases being in the same "not-x" sublist). */ - - case ESC_h: - (void)add_list_to_class(classbits, &class_uchardata, - options & ~PCRE2_CASELESS, xoptions, cb, PRIV(hspace_list), - NOTACHAR); - break; - - case ESC_H: - (void)add_not_list_to_class(classbits, &class_uchardata, - options & ~PCRE2_CASELESS, xoptions, cb, PRIV(hspace_list)); - break; - - case ESC_v: - (void)add_list_to_class(classbits, &class_uchardata, - options & ~PCRE2_CASELESS, xoptions, cb, PRIV(vspace_list), - NOTACHAR); - break; - - case ESC_V: - (void)add_not_list_to_class(classbits, &class_uchardata, - options & ~PCRE2_CASELESS, xoptions, cb, PRIV(vspace_list)); - break; - - /* If Unicode is not supported, \P and \p are not allowed and are - faulted at parse time, so will never appear here. */ - -#ifdef SUPPORT_UNICODE - case ESC_p: - case ESC_P: - { - uint32_t ptype = *(++pptr) >> 16; - uint32_t pdata = *pptr & 0xffff; - *class_uchardata++ = (escape == ESC_p)? XCL_PROP : XCL_NOTPROP; - *class_uchardata++ = ptype; - *class_uchardata++ = pdata; - xclass_has_prop = TRUE; - class_has_8bitchar--; /* Undo! */ - } - break; -#endif - } - - goto CONTINUE_CLASS; - } /* End handling \d-type escapes */ - - /* A literal character may be followed by a range meta. At parse time - there are checks for out-of-order characters, for ranges where the two - characters are equal, and for hyphens that cannot indicate a range. At - this point, therefore, no checking is needed. */ - - else - { - uint32_t c, d; - - CLASS_LITERAL: - c = d = meta; - - /* Remember if \r or \n were explicitly used */ - - if (c == CHAR_CR || c == CHAR_NL) cb->external_flags |= PCRE2_HASCRORLF; - - /* Process a character range */ - - if (pptr[1] == META_RANGE_LITERAL || pptr[1] == META_RANGE_ESCAPED) - { -#ifdef EBCDIC - BOOL range_is_literal = (pptr[1] == META_RANGE_LITERAL); -#endif - pptr += 2; - d = *pptr; - if (d == META_BIGVALUE) d = *(++pptr); - - /* Remember an explicit \r or \n, and add the range to the class. */ - - if (d == CHAR_CR || d == CHAR_NL) cb->external_flags |= PCRE2_HASCRORLF; - - /* In an EBCDIC environment, Perl treats alphabetic ranges specially - because there are holes in the encoding, and simply using the range - A-Z (for example) would include the characters in the holes. This - applies only to literal ranges; [\xC1-\xE9] is different to [A-Z]. */ - -#ifdef EBCDIC - if (range_is_literal && - (cb->ctypes[c] & ctype_letter) != 0 && - (cb->ctypes[d] & ctype_letter) != 0 && - (c <= CHAR_z) == (d <= CHAR_z)) - { - uint32_t uc = (d <= CHAR_z)? 0 : 64; - uint32_t C = c - uc; - uint32_t D = d - uc; - - if (C <= CHAR_i) - { - class_has_8bitchar += - add_to_class(classbits, &class_uchardata, options, xoptions, - cb, C + uc, ((D < CHAR_i)? D : CHAR_i) + uc); - C = CHAR_j; - } - - if (C <= D && C <= CHAR_r) - { - class_has_8bitchar += - add_to_class(classbits, &class_uchardata, options, xoptions, - cb, C + uc, ((D < CHAR_r)? D : CHAR_r) + uc); - C = CHAR_s; - } - - if (C <= D) - { - class_has_8bitchar += - add_to_class(classbits, &class_uchardata, options, xoptions, - cb, C + uc, D + uc); - } - } - else -#endif - /* Not an EBCDIC special range */ - - class_has_8bitchar += add_to_class(classbits, &class_uchardata, - options, xoptions, cb, c, d); - goto CONTINUE_CLASS; /* Go get the next char in the class */ - } /* End of range handling */ - - - /* Handle a single character. */ - - class_has_8bitchar += - add_to_class(classbits, &class_uchardata, options, xoptions, cb, - meta, meta); - } - - /* Continue to the next item in the class. */ - - CONTINUE_CLASS: - -#ifdef SUPPORT_WIDE_CHARS - /* If any wide characters or Unicode properties have been encountered, - set xclass = TRUE. Then, in the pre-compile phase, accumulate the length - of the extra data and reset the pointer. This is so that very large - classes that contain a zillion wide characters or Unicode property tests - do not overwrite the workspace (which is on the stack). */ - - if (class_uchardata > class_uchardata_base) - { - xclass = TRUE; - if (lengthptr != NULL) - { - *lengthptr += class_uchardata - class_uchardata_base; - class_uchardata = class_uchardata_base; - } - } -#endif - - continue; /* Needed to avoid error when not supporting wide chars */ - } /* End of main class-processing loop */ + CLASS_END_PROCESSING: /* If this class is the first thing in the branch, there can be no first char setting, whatever the repeat count. Any reqcu setting must remain @@ -6379,108 +6474,6 @@ for (;; pptr++) zerofirstcuflags = firstcuflags; zeroreqcu = reqcu; zeroreqcuflags = reqcuflags; - - /* If there are characters with values > 255, or Unicode property settings - (\p or \P), we have to compile an extended class, with its own opcode, - unless there were no property settings and there was a negated special such - as \S in the class, and PCRE2_UCP is not set, because in that case all - characters > 255 are in or not in the class, so any that were explicitly - given as well can be ignored. - - In the UCP case, if certain negated POSIX classes (ex: [:^ascii:]) were - were present in a class, we either have to match or not match all wide - characters (depending on whether the whole class is or is not negated). - This requirement is indicated by match_all_or_no_wide_chars being true. - We do this by including an explicit range, which works in both cases. - This applies only in UTF and 16-bit and 32-bit non-UTF modes, since there - cannot be any wide characters in 8-bit non-UTF mode. - - When there *are* properties in a positive UTF-8 or any 16-bit or 32_bit - class where \S etc is present without PCRE2_UCP, causing an extended class - to be compiled, we make sure that all characters > 255 are included by - forcing match_all_or_no_wide_chars to be true. - - If, when generating an xclass, there are no characters < 256, we can omit - the bitmap in the actual compiled code. */ - -#ifdef SUPPORT_WIDE_CHARS /* Defined for 16/32 bits, or 8-bit with Unicode */ - if (xclass && ( -#ifdef SUPPORT_UNICODE - (options & PCRE2_UCP) != 0 || -#endif - xclass_has_prop || !should_flip_negation)) - { - if (match_all_or_no_wide_chars || ( -#if PCRE2_CODE_UNIT_WIDTH == 8 - utf && -#endif - should_flip_negation && !negate_class && (options & PCRE2_UCP) == 0)) - { - *class_uchardata++ = XCL_RANGE; - if (utf) /* Will always be utf in the 8-bit library */ - { - class_uchardata += PRIV(ord2utf)(0x100, class_uchardata); - class_uchardata += PRIV(ord2utf)(MAX_UTF_CODE_POINT, class_uchardata); - } - else /* Can only happen for the 16-bit & 32-bit libraries */ - { -#if PCRE2_CODE_UNIT_WIDTH == 16 - *class_uchardata++ = 0x100; - *class_uchardata++ = 0xffffu; -#elif PCRE2_CODE_UNIT_WIDTH == 32 - *class_uchardata++ = 0x100; - *class_uchardata++ = 0xffffffffu; -#endif - } - } - *class_uchardata++ = XCL_END; /* Marks the end of extra data */ - *code++ = OP_XCLASS; - code += LINK_SIZE; - *code = negate_class? XCL_NOT:0; - if (xclass_has_prop) *code |= XCL_HASPROP; - - /* If the map is required, move up the extra data to make room for it; - otherwise just move the code pointer to the end of the extra data. */ - - if (class_has_8bitchar > 0) - { - *code++ |= XCL_MAP; - (void)memmove(code + (32 / sizeof(PCRE2_UCHAR)), code, - CU2BYTES(class_uchardata - code)); - if (negate_class && !xclass_has_prop) - { - /* Using 255 ^ instead of ~ avoids clang sanitize warning. */ - for (int i = 0; i < 32; i++) classbits[i] = 255 ^ classbits[i]; - } - memcpy(code, classbits, 32); - code = class_uchardata + (32 / sizeof(PCRE2_UCHAR)); - } - else code = class_uchardata; - - /* Now fill in the complete length of the item */ - - PUT(previous, 1, (int)(code - previous)); - break; /* End of class handling */ - } -#endif /* SUPPORT_WIDE_CHARS */ - - /* If there are no characters > 255, or they are all to be included or - excluded, set the opcode to OP_CLASS or OP_NCLASS, depending on whether the - whole class was negated and whether there were negative specials such as \S - (non-UCP) in the class. Then copy the 32-byte map into the code vector, - negating it if necessary. */ - - *code++ = (negate_class == should_flip_negation) ? OP_CLASS : OP_NCLASS; - if (lengthptr == NULL) /* Save time in the pre-compile phase */ - { - if (negate_class) - { - /* Using 255 ^ instead of ~ avoids clang sanitize warning. */ - for (int i = 0; i < 32; i++) classbits[i] = 255 ^ classbits[i]; - } - memcpy(code, classbits, 32); - } - code += 32 / sizeof(PCRE2_UCHAR); break; /* End of class processing */ @@ -6516,7 +6509,7 @@ for (;; pptr++) case META_PRUNE: case META_SKIP: cb->had_pruneorskip = TRUE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case META_COMMIT: case META_FAIL: *code++ = verbops[(meta - META_MARK) >> 16]; @@ -6541,7 +6534,7 @@ for (;; pptr++) case META_PRUNE_ARG: case META_SKIP_ARG: cb->had_pruneorskip = TRUE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case META_MARK: case META_COMMIT_ARG: VERB_ARG: @@ -6586,6 +6579,70 @@ for (;; pptr++) req_caseopt = ((options & PCRE2_CASELESS) != 0)? REQ_CASELESS : 0; break; + /* ===================================================================*/ + /* Handle scan substring. Scan substring assertion starts with META_SCS, + which recursively calls compile_branch. The first opcode processed by + this recursive call is always META_OFFSET. */ + + case META_OFFSET: + if (lengthptr != NULL) + { + pptr = PRIV(compile_parse_scan_substr_args)(pptr, errorcodeptr, cb, lengthptr); + if (pptr == NULL) + return 0; + break; + } + + while (TRUE) + { + int count, index; + named_group *ng; + + switch (META_CODE(*pptr)) + { + case META_OFFSET: + pptr++; + SKIPOFFSET(pptr); + continue; + + case META_CAPTURE_NAME: + ng = cb->named_groups + pptr[1]; + pptr += 2; + count = 0; + index = 0; + + if (!PRIV(compile_find_dupname_details)(ng->name, ng->length, &index, + &count, errorcodeptr, cb)) return 0; + + code[0] = OP_DNCREF; + PUT2(code, 1, index); + PUT2(code, 1 + IMM2_SIZE, count); + code += 1 + 2 * IMM2_SIZE; + continue; + + case META_CAPTURE_NUMBER: + pptr += 2; + if (pptr[-1] == 0) continue; + + code[0] = OP_CREF; + PUT2(code, 1, pptr[-1]); + code += 1 + IMM2_SIZE; + continue; + + default: + break; + } + + break; + } + --pptr; + break; + + case META_SCS: + bravalue = OP_ASSERT_SCS; + cb->assert_depth += 1; + goto GROUP_PROCESS; + /* ===================================================================*/ /* Handle conditional subpatterns. The case of (?(Rdigits) is ambiguous @@ -6598,11 +6655,13 @@ for (;; pptr++) case META_COND_NAME: /* (?(name) or (?'name') or ?() */ case META_COND_RNAME: /* (?(R&name) - test for recursion */ bravalue = OP_COND; + + if (lengthptr != NULL) { - int count, index; - unsigned int i; + uint32_t i; PCRE2_SPTR name; - named_group *ng = cb->named_groups; + named_group *ng; + uint32_t *start_pptr = pptr; uint32_t length = *(++pptr); GETPLUSOFFSET(offset, pptr); @@ -6614,35 +6673,20 @@ for (;; pptr++) this name is duplicated. If it is not duplicated, we can handle it as a numerical group. */ - for (i = 0; i < cb->names_found; i++, ng++) - { - if (length == ng->length && - PRIV(strncmp)(name, ng->name, length) == 0) - { - if (!ng->isdup) - { - code[1+LINK_SIZE] = (meta == META_COND_RNAME)? OP_RREF : OP_CREF; - PUT2(code, 2+LINK_SIZE, ng->number); - if (ng->number > cb->top_backref) cb->top_backref = ng->number; - skipunits = 1+IMM2_SIZE; - goto GROUP_PROCESS_NOTE_EMPTY; - } - break; /* Found a duplicated name */ - } - } - - /* If the name was not found we have a bad reference, unless we are - dealing with R, which is treated as a recursion test by number. - */ + ng = PRIV(compile_find_named_group)(name, length, cb); - if (i >= cb->names_found) + if (ng == NULL) { + /* If the name was not found we have a bad reference, unless we are + dealing with R, which is treated as a recursion test by + number. */ + groupnumber = 0; if (meta == META_COND_RNUMBER) { for (i = 1; i < length; i++) { - groupnumber = groupnumber * 10 + name[i] - CHAR_0; + groupnumber = groupnumber * 10 + (name[i] - CHAR_0); if (groupnumber > MAX_GROUP_NUMBER) { *errorcodeptr = ERR61; @@ -6664,33 +6708,88 @@ for (;; pptr++) translated into RREF_ANY (which is 0xffff). */ if (groupnumber == 0) groupnumber = RREF_ANY; - code[1+LINK_SIZE] = OP_RREF; - PUT2(code, 2+LINK_SIZE, groupnumber); + PCRE2_ASSERT(start_pptr[0] == META_COND_RNUMBER); + start_pptr[1] = groupnumber; skipunits = 1+IMM2_SIZE; goto GROUP_PROCESS_NOTE_EMPTY; } - /* A duplicated name was found. Note that if an R name is found - (META_COND_RNUMBER), it is a reference test, not a recursion test. */ + /* From here on, we know we have a name (not a number), + so treat META_COND_RNUMBER the same as META_COND_NAME. */ + if (meta == META_COND_RNUMBER) meta = META_COND_NAME; - code[1+LINK_SIZE] = (meta == META_COND_RNAME)? OP_RREF : OP_CREF; + if ((ng->hash_dup & NAMED_GROUP_IS_DUPNAME) == 0) + { + /* Found a non-duplicated name. Since it is a global, + it is enough to update it in the pre-processing phase. */ + if (ng->number > cb->top_backref) cb->top_backref = ng->number; + + start_pptr[0] = meta; + start_pptr[1] = ng->number; + + skipunits = 1 + IMM2_SIZE; + goto GROUP_PROCESS_NOTE_EMPTY; + } /* We have a duplicated name. In the compile pass we have to search the main table in order to get the index and count values. */ + start_pptr[0] = meta | 1; + start_pptr[1] = (uint32_t)(ng - cb->named_groups); + + /* A duplicated name was found. Note that if an R name is found + (META_COND_RNUMBER), it is a reference test, not a recursion test. */ + skipunits = 1 + 2 * IMM2_SIZE; + } + else + { + /* Otherwise lengthptr equals to NULL, + which is the second phase of compilation. */ + int count, index; + named_group *ng; + + /* Generate code using the data + collected in the pre-processing phase. */ + + if (meta == META_COND_RNUMBER) + { + code[1+LINK_SIZE] = OP_RREF; + PUT2(code, 2 + LINK_SIZE, pptr[1]); + skipunits = 1 + IMM2_SIZE; + pptr += 1 + SIZEOFFSET; + goto GROUP_PROCESS_NOTE_EMPTY; + } + + if (meta_arg == 0) + { + code[1+LINK_SIZE] = (meta == META_COND_RNAME)? OP_RREF : OP_CREF; + PUT2(code, 2 + LINK_SIZE, pptr[1]); + skipunits = 1 + IMM2_SIZE; + pptr += 1 + SIZEOFFSET; + goto GROUP_PROCESS_NOTE_EMPTY; + } + + ng = cb->named_groups + pptr[1]; count = 0; /* Values for first pass (avoids compiler warning) */ index = 0; - if (lengthptr == NULL && !find_dupname_details(name, length, &index, + + /* The failed case is an internal error. */ + if (!PRIV(compile_find_dupname_details)(ng->name, ng->length, &index, &count, errorcodeptr, cb)) return 0; - /* Add one to the opcode to change CREF/RREF into DNCREF/DNRREF and - insert appropriate data values. */ + /* A duplicated name was found. Note that if an R name is found + (META_COND_RNUMBER), it is a reference test, not a recursion test. */ - code[1+LINK_SIZE]++; - skipunits = 1+2*IMM2_SIZE; - PUT2(code, 2+LINK_SIZE, index); - PUT2(code, 2+LINK_SIZE+IMM2_SIZE, count); + code[1 + LINK_SIZE] = (meta == META_COND_RNAME)? OP_DNRREF : OP_DNCREF; + + /* Insert appropriate data values. */ + PUT2(code, 2 + LINK_SIZE, index); + PUT2(code, 2 + LINK_SIZE + IMM2_SIZE, count); + skipunits = 1 + 2 * IMM2_SIZE; + pptr += 1 + SIZEOFFSET; } + + PCRE2_ASSERT(meta != META_CAPTURE_NAME); goto GROUP_PROCESS_NOTE_EMPTY; /* The DEFINE condition is always false. Its internal groups may never @@ -6709,6 +6808,7 @@ for (;; pptr++) case META_COND_NUMBER: bravalue = OP_COND; GETPLUSOFFSET(offset, pptr); + groupnumber = *(++pptr); if (groupnumber > cb->bracount) { @@ -6717,7 +6817,9 @@ for (;; pptr++) return 0; } if (groupnumber > cb->top_backref) cb->top_backref = groupnumber; - offset -= 2; /* Point at initial ( for too many branches error */ + + /* Point at initial ( for too many branches error */ + offset -= 2; code[1+LINK_SIZE] = OP_CREF; skipunits = 1+IMM2_SIZE; PUT2(code, 2+LINK_SIZE, groupnumber); @@ -6855,7 +6957,7 @@ for (;; pptr++) /* If we've just compiled an assertion, pop the assert depth. */ - if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NA) + if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERT_SCS) cb->assert_depth -= 1; /* At the end of compiling, code is still pointing to the start of the @@ -7023,8 +7125,7 @@ for (;; pptr++) { int count, index; PCRE2_SPTR name; - BOOL is_dupname = FALSE; - named_group *ng = cb->named_groups; + named_group *ng; uint32_t length = *(++pptr); GETPLUSOFFSET(offset, pptr); @@ -7035,47 +7136,39 @@ for (;; pptr++) generated in the pre-pass in order to get a number and whether or not this name is duplicated. */ - groupnumber = 0; - for (unsigned int i = 0; i < cb->names_found; i++, ng++) - { - if (length == ng->length && - PRIV(strncmp)(name, ng->name, length) == 0) - { - is_dupname = ng->isdup; - groupnumber = ng->number; + ng = PRIV(compile_find_named_group)(name, length, cb); - /* For a recursion, that's all that is needed. We can now go to - the code that handles numerical recursion, applying it to the first - group with the given name. */ + if (ng == NULL) + { + /* If the name was not found we have a bad reference. */ + *errorcodeptr = ERR15; + cb->erroroffset = offset; + return 0; + } - if (meta == META_RECURSE_BYNAME) - { - meta_arg = groupnumber; - goto HANDLE_NUMERICAL_RECURSION; - } + groupnumber = ng->number; - /* For a back reference, update the back reference map and the - maximum back reference. */ + /* For a recursion, that's all that is needed. We can now go to + the code that handles numerical recursion, applying it to the first + group with the given name. */ - cb->backref_map |= (groupnumber < 32)? (1u << groupnumber) : 1; - if (groupnumber > cb->top_backref) - cb->top_backref = groupnumber; - } + if (meta == META_RECURSE_BYNAME) + { + meta_arg = groupnumber; + goto HANDLE_NUMERICAL_RECURSION; } - /* If the name was not found we have a bad reference. */ + /* For a back reference, update the back reference map and the + maximum back reference. */ - if (groupnumber == 0) - { - *errorcodeptr = ERR15; - cb->erroroffset = offset; - return 0; - } + cb->backref_map |= (groupnumber < 32)? (1u << groupnumber) : 1; + if (groupnumber > cb->top_backref) + cb->top_backref = groupnumber; /* If a back reference name is not duplicated, we can handle it as a numerical reference. */ - if (!is_dupname) + if ((ng->hash_dup & NAMED_GROUP_IS_DUPNAME) == 0) { meta_arg = groupnumber; goto HANDLE_SINGLE_REFERENCE; @@ -7087,13 +7180,18 @@ for (;; pptr++) count = 0; /* Values for first pass (avoids compiler warning) */ index = 0; - if (lengthptr == NULL && !find_dupname_details(name, length, &index, - &count, errorcodeptr, cb)) return 0; + if (lengthptr == NULL && !PRIV(compile_find_dupname_details)(name, length, + &index, &count, errorcodeptr, cb)) return 0; if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE; *code++ = ((options & PCRE2_CASELESS) != 0)? OP_DNREFI : OP_DNREF; PUT2INC(code, 0, index); PUT2INC(code, 0, count); + if ((options & PCRE2_CASELESS) != 0) + *code++ = (((xoptions & PCRE2_EXTRA_CASELESS_RESTRICT) != 0)? + REFI_FLAG_CASELESS_RESTRICT : 0) | + (((xoptions & PCRE2_EXTRA_TURKISH_CASING) != 0)? + REFI_FLAG_TURKISH_CASING : 0); } break; @@ -7213,7 +7311,6 @@ for (;; pptr++) single-char opcodes. */ reqvary = (repeat_min == repeat_max)? 0 : REQ_VARY; - op_type = 0; /* Adjust first and required code units for a zero repeat. */ @@ -7254,6 +7351,7 @@ for (;; pptr++) /* Save start of previous item, in case we have to move it up in order to insert something before it, and remember what it was. */ + PCRE2_ASSERT(previous != NULL); tempcode = previous; op_previous = *previous; @@ -7313,6 +7411,7 @@ for (;; pptr++) #ifdef SUPPORT_WIDE_CHARS case OP_XCLASS: + case OP_ECLASS: #endif case OP_CLASS: case OP_NCLASS: @@ -7343,14 +7442,6 @@ for (;; pptr++) } break; - /* If previous is OP_FAIL, it was generated by an empty class [] - (PCRE2_ALLOW_EMPTY_CLASS is set). The other ways in which OP_FAIL can be - generated, that is by (*FAIL) or (?!), disallow a quantifier at parse - time. We can just ignore this repeat. */ - - case OP_FAIL: - goto END_REPEAT; - /* Prior to 10.30, repeated recursions were wrapped in OP_ONCE brackets because pcre2_match() could not handle backtracking into recursively called groups. Now that this backtracking is available, we no longer need @@ -7374,6 +7465,7 @@ for (;; pptr++) if (repeat_min > 0 && (repeat_min != 1 || repeat_max != REPEAT_UNLIMITED)) { int replicate = repeat_min; + if (repeat_min == repeat_max) replicate--; /* In the pre-compile phase, we don't actually do the replication. We @@ -7383,7 +7475,7 @@ for (;; pptr++) if (lengthptr != NULL) { PCRE2_SIZE delta; - if (PRIV(ckd_smul)(&delta, replicate, 1 + LINK_SIZE) || + if (PRIV(ckd_smul)(&delta, replicate, (int)length_prevgroup) || OFLOW_MAX - *lengthptr < delta) { *errorcodeptr = ERR20; @@ -7391,12 +7483,11 @@ for (;; pptr++) } *lengthptr += delta; } - else for (int i = 0; i < replicate; i++) { - memcpy(code, previous, CU2BYTES(1 + LINK_SIZE)); + memcpy(code, previous, CU2BYTES(length_prevgroup)); previous = code; - code += 1 + LINK_SIZE; + code += length_prevgroup; } /* If the number of repeats is fixed, we are done. Otherwise, adjust @@ -7408,18 +7499,21 @@ for (;; pptr++) } /* Wrap the recursion call in OP_BRA brackets. */ + { + PCRE2_SIZE length = (lengthptr != NULL) ? 1 + LINK_SIZE : length_prevgroup; - (void)memmove(previous + 1 + LINK_SIZE, previous, CU2BYTES(1 + LINK_SIZE)); - op_previous = *previous = OP_BRA; - PUT(previous, 1, 2 + 2*LINK_SIZE); - previous[2 + 2*LINK_SIZE] = OP_KET; - PUT(previous, 3 + 2*LINK_SIZE, 2 + 2*LINK_SIZE); + (void)memmove(previous + 1 + LINK_SIZE, previous, CU2BYTES(length)); + op_previous = *previous = OP_BRA; + PUT(previous, 1, 1 + LINK_SIZE + length); + previous[1 + LINK_SIZE + length] = OP_KET; + PUT(previous, 2 + LINK_SIZE + length, 1 + LINK_SIZE + length); + } code += 2 + 2 * LINK_SIZE; - length_prevgroup = 3 + 3*LINK_SIZE; + length_prevgroup += 2 + 2 * LINK_SIZE; group_return = -1; /* Set "may match empty string" */ /* Now treat as a repeated OP_BRA. */ - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* If previous was a bracket group, we may have to replicate it in certain cases. Note that at this point we can encounter only the "basic" @@ -7434,6 +7528,7 @@ for (;; pptr++) case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: case OP_ASSERTBACK_NA: + case OP_ASSERT_SCS: case OP_ONCE: case OP_SCRIPT_RUN: case OP_BRA: @@ -7758,12 +7853,16 @@ for (;; pptr++) here because it just makes it horribly messy. */ default: - if (op_previous >= OP_EODN) /* Not a character type - internal error */ + + /* LCOV_EXCL_START */ + if (op_previous >= OP_EODN || op_previous <= OP_WORD_BOUNDARY) { - *errorcodeptr = ERR10; + PCRE2_DEBUG_UNREACHABLE(); + *errorcodeptr = ERR10; /* Not a character type - internal error */ return 0; } - else + /* LCOV_EXCL_STOP */ + { int prop_type, prop_value; PCRE2_UCHAR *oldcode; @@ -7780,7 +7879,8 @@ for (;; pptr++) } else { - /* Come here from just above with a character in mcbuffer/mclength. */ + /* Come here from just above with a character in mcbuffer/mclength. + You must also set op_type before the jump. */ OUTPUT_SINGLE_REPEAT: prop_type = prop_value = -1; } @@ -7963,9 +8063,17 @@ for (;; pptr++) #ifdef SUPPORT_WIDE_CHARS case OP_XCLASS: + case OP_ECLASS: tempcode += GET(tempcode, 1); break; #endif + + case OP_REF: + case OP_REFI: + case OP_DNREF: + case OP_DNREFI: + tempcode += PRIV(OP_lengths)[*tempcode]; + break; } /* If tempcode is equal to code (which points to the end of the repeated @@ -8047,6 +8155,11 @@ for (;; pptr++) if (firstcuflags == REQ_UNSET) zerofirstcuflags = firstcuflags = REQ_NONE; *code++ = ((options & PCRE2_CASELESS) != 0)? OP_REFI : OP_REF; PUT2INC(code, 0, meta_arg); + if ((options & PCRE2_CASELESS) != 0) + *code++ = (((xoptions & PCRE2_EXTRA_CASELESS_RESTRICT) != 0)? + REFI_FLAG_CASELESS_RESTRICT : 0) | + (((xoptions & PCRE2_EXTRA_TURKISH_CASING) != 0)? + REFI_FLAG_TURKISH_CASING : 0); /* Update the map of back references, and keep the highest one. We could do this in parse_regex() for numerical back references, but not @@ -8079,6 +8192,52 @@ for (;; pptr++) *code = OP_RECURSE; PUT(code, 1, meta_arg); code += 1 + LINK_SIZE; + /* Repeat processing requires this information to + determine the real length in pre-compile phase. */ + length_prevgroup = 1 + LINK_SIZE; + + if (META_CODE(pptr[1]) == META_OFFSET || + META_CODE(pptr[1]) == META_CAPTURE_NAME || + META_CODE(pptr[1]) == META_CAPTURE_NUMBER) + { + recurse_arguments *args; + + if (lengthptr != NULL) + { + if (!PRIV(compile_parse_recurse_args)(pptr, offset, errorcodeptr, cb)) + return 0; + + args = (recurse_arguments*)cb->last_data; + length_prevgroup += (args->size * (1 + IMM2_SIZE)); + *lengthptr += (args->size * (1 + IMM2_SIZE)); + pptr += args->skip_size; + } + else + { + uint16_t *current, *end; + + args = (recurse_arguments*)cb->first_data; + PCRE2_ASSERT(args != NULL && args->header.type == CDATA_RECURSE_ARGS); + + current = (uint16_t*)(args + 1); + end = current + args->size; + PCRE2_ASSERT(end > current); + + do + { + code[0] = OP_CREF; + PUT2(code, 1, *current); + code += 1 + IMM2_SIZE; + } + while (++current < end); + + length_prevgroup += (args->size * (1 + IMM2_SIZE)); + pptr += args->skip_size; + cb->first_data = args->header.next; + cb->cx->memctl.free(args, cb->cx->memctl.memory_data); + } + } + groupsetfirstcu = FALSE; cb->had_recurse = TRUE; if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE; @@ -8139,12 +8298,30 @@ for (;; pptr++) uint32_t ptype = *(++pptr) >> 16; uint32_t pdata = *pptr & 0xffff; - /* The special case of \p{Any} is compiled to OP_ALLANY so as to benefit - from the auto-anchoring code. */ + /* In caseless matching, particular characteristics Lu, Ll, and Lt get + converted to the general characteristic L&. That is, upper, lower, and + title case letters are all conflated. */ + + if ((options & PCRE2_CASELESS) != 0 && ptype == PT_PC && + (pdata == ucp_Lu || pdata == ucp_Ll || pdata == ucp_Lt)) + { + ptype = PT_LAMP; + pdata = 0; + } + + /* The special case of \p{Any} is compiled to OP_ALLANY and \P{Any} + is compiled to [] so as to benefit from the auto-anchoring code. */ - if (meta_arg == ESC_p && ptype == PT_ANY) + if (ptype == PT_ANY) { - *code++ = OP_ALLANY; + if (meta_arg == ESC_P) + { + *code++ = OP_CLASS; + memset(code, 0, 32); + code += 32 / sizeof(PCRE2_UCHAR); + } + else + *code++ = OP_ALLANY; } else { @@ -8185,6 +8362,7 @@ for (;; pptr++) cb->external_flags |= PCRE2_HASBKC; /* Record */ #if PCRE2_CODE_UNIT_WIDTH == 32 meta_arg = OP_ALLANY; + (void)utf; /* Avoid compiler warning. */ #else if (!utf) meta_arg = OP_ALLANY; #endif @@ -8195,11 +8373,15 @@ for (;; pptr++) if ((options & PCRE2_UCP) != 0 && (xoptions & PCRE2_EXTRA_ASCII_BSW) == 0) meta_arg = (meta_arg == ESC_B)? OP_NOT_UCP_WORD_BOUNDARY : OP_UCP_WORD_BOUNDARY; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case ESC_A: if (cb->max_lookbehind == 0) cb->max_lookbehind = 1; break; + + case ESC_K: + cb->external_flags |= PCRE2_HASBSK; /* Record */ + break; } *code++ = meta_arg; @@ -8211,14 +8393,14 @@ for (;; pptr++) META_END is a literal. Otherwise we have a problem. */ default: + /* LCOV_EXCL_START */ if (meta >= META_END) { -#ifdef DEBUG_SHOW_PARSED - fprintf(stderr, "** Unrecognized parsed pattern item 0x%.8x\n", *pptr); -#endif + PCRE2_DEBUG_UNREACHABLE(); *errorcodeptr = ERR89; /* Internal error - unrecognized. */ return 0; } + /* LCOV_EXCL_STOP */ /* Handle a literal character. We come here by goto in the case of a 32-bit, non-UTF character whose value is greater than META_END. */ @@ -8231,15 +8413,28 @@ for (;; pptr++) /* For caseless UTF or UCP mode, check whether this character has more than one other case. If so, generate a special OP_PROP item instead of OP_CHARI. When casing restrictions apply, ignore caseless sets that start with an - ASCII character. */ + ASCII character. If the character is affected by the special Turkish rules, + hardcode the matching characters using a caseset. */ #ifdef SUPPORT_UNICODE if ((utf||ucp) && (options & PCRE2_CASELESS) != 0) { - uint32_t caseset = UCD_CASESET(meta); - if (caseset != 0 && - ((xoptions & PCRE2_EXTRA_CASELESS_RESTRICT) == 0 || - PRIV(ucd_caseless_sets)[caseset] > 127)) + uint32_t caseset; + + if ((xoptions & (PCRE2_EXTRA_TURKISH_CASING|PCRE2_EXTRA_CASELESS_RESTRICT)) == + PCRE2_EXTRA_TURKISH_CASING && + UCD_ANY_I(meta)) + { + caseset = PRIV(ucd_turkish_dotted_i_caseset) + (UCD_DOTTED_I(meta)? 0 : 3); + } + else if ((caseset = UCD_CASESET(meta)) != 0 && + (xoptions & PCRE2_EXTRA_CASELESS_RESTRICT) != 0 && + PRIV(ucd_caseless_sets)[caseset] < 128) + { + caseset = 0; /* Ignore the caseless set if it's restricted. */ + } + + if (caseset != 0) { *code++ = OP_PROP; *code++ = PT_CLIST; @@ -8337,7 +8532,10 @@ for (;; pptr++) } /* End of big switch */ } /* End of big loop */ -/* Control never reaches here. */ +/* LCOV_EXCL_START */ +PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */ +return 0; /* Avoid compiler warnings */ +/* LCOV_EXCL_STOP */ } @@ -8393,8 +8591,6 @@ uint32_t firstcu, reqcu; uint32_t lookbehindlength; uint32_t lookbehindminlength; uint32_t firstcuflags, reqcuflags; -uint32_t branchfirstcu, branchreqcu; -uint32_t branchfirstcuflags, branchreqcuflags; PCRE2_SIZE length; branch_chain bc; @@ -8404,6 +8600,7 @@ if (cb->cx->stack_guard != NULL && cb->cx->stack_guard(cb->parens_depth, cb->cx->stack_guard_data)) { *errorcodeptr= ERR33; + cb->erroroffset = 0; return 0; } @@ -8463,9 +8660,11 @@ code += 1 + LINK_SIZE + skipunits; for (;;) { int branch_return; + uint32_t branchfirstcu = 0, branchreqcu = 0; + uint32_t branchfirstcuflags = REQ_UNSET, branchreqcuflags = REQ_UNSET; /* Insert OP_REVERSE or OP_VREVERSE if this is a lookbehind assertion. There - is only a single mimimum length for the whole assertion. When the mimimum + is only a single minimum length for the whole assertion. When the minimum length is LOOKBEHIND_MAX it means that all branches are of fixed length, though not necessarily the same length. In this case, the original OP_REVERSE can be used. It can also be used if a branch in a variable length lookbehind @@ -8577,10 +8776,10 @@ for (;;) { if (lengthptr == NULL) { - PCRE2_SIZE branch_length = code - last_branch; + uint32_t branch_length = (uint32_t)(code - last_branch); do { - PCRE2_SIZE prev_length = GET(last_branch, 1); + uint32_t prev_length = GET(last_branch, 1); PUT(last_branch, 1, branch_length); branch_length = prev_length; last_branch -= branch_length; @@ -8591,7 +8790,7 @@ for (;;) /* Fill in the ket */ *code = OP_KET; - PUT(code, 1, (int)(code - start_bracket)); + PUT(code, 1, (uint32_t)(code - start_bracket)); code += 1 + LINK_SIZE; /* Set values to pass back */ @@ -8604,7 +8803,8 @@ for (;;) *reqcuflagsptr = reqcuflags; if (lengthptr != NULL) { - if (OFLOW_MAX - *lengthptr < length) + if (*lengthptr > MAX_PATTERN_SIZE || + MAX_PATTERN_SIZE - *lengthptr < length) { *errorcodeptr = ERR20; return 0; @@ -8627,6 +8827,19 @@ for (;;) { code = *codeptr + 1 + LINK_SIZE + skipunits; length += 1 + LINK_SIZE; + + /* Move the accumulated length into *lengthptr, providing the next call to + compile_branch with as much space in &length and &code as the first did. */ + + if (*lengthptr > MAX_PATTERN_SIZE || + MAX_PATTERN_SIZE - *lengthptr < length) + { + *errorcodeptr = ERR20; + cb->erroroffset = 0; + return 0; + } + *lengthptr += length; + length = 0; } else { @@ -8642,7 +8855,11 @@ for (;;) lookbehindlength = META_DATA(*pptr); pptr++; } -/* Control never reaches here */ + +/* LCOV_EXCL_START */ +PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */ +return 0; /* Avoid compiler warnings */ +/* LCOV_EXCL_STOP */ } @@ -8685,13 +8902,14 @@ this prevents the number of characters it matches from being adjusted. cb points to the compile data block atomcount atomic group level inassert TRUE if in an assertion + dotstar_anchor TRUE if automatic anchoring optimization is enabled Returns: TRUE or FALSE */ static BOOL is_anchored(PCRE2_SPTR code, uint32_t bracket_map, compile_block *cb, - int atomcount, BOOL inassert) + int atomcount, BOOL inassert, BOOL dotstar_anchor) { do { PCRE2_SPTR scode = first_significant_code( @@ -8703,7 +8921,7 @@ do { if (op == OP_BRA || op == OP_BRAPOS || op == OP_SBRA || op == OP_SBRAPOS) { - if (!is_anchored(scode, bracket_map, cb, atomcount, inassert)) + if (!is_anchored(scode, bracket_map, cb, atomcount, inassert, dotstar_anchor)) return FALSE; } @@ -8714,14 +8932,14 @@ do { { int n = GET2(scode, 1+LINK_SIZE); uint32_t new_map = bracket_map | ((n < 32)? (1u << n) : 1); - if (!is_anchored(scode, new_map, cb, atomcount, inassert)) return FALSE; + if (!is_anchored(scode, new_map, cb, atomcount, inassert, dotstar_anchor)) return FALSE; } /* Positive forward assertion */ else if (op == OP_ASSERT || op == OP_ASSERT_NA) { - if (!is_anchored(scode, bracket_map, cb, atomcount, TRUE)) return FALSE; + if (!is_anchored(scode, bracket_map, cb, atomcount, TRUE, dotstar_anchor)) return FALSE; } /* Condition. If there is no second branch, it can't be anchored. */ @@ -8729,7 +8947,7 @@ do { else if (op == OP_COND || op == OP_SCOND) { if (scode[GET(scode,1)] != OP_ALT) return FALSE; - if (!is_anchored(scode, bracket_map, cb, atomcount, inassert)) + if (!is_anchored(scode, bracket_map, cb, atomcount, inassert, dotstar_anchor)) return FALSE; } @@ -8737,7 +8955,7 @@ do { else if (op == OP_ONCE) { - if (!is_anchored(scode, bracket_map, cb, atomcount + 1, inassert)) + if (!is_anchored(scode, bracket_map, cb, atomcount + 1, inassert, dotstar_anchor)) return FALSE; } @@ -8752,8 +8970,7 @@ do { op == OP_TYPEPOSSTAR)) { if (scode[1] != OP_ALLANY || (bracket_map & cb->backref_map) != 0 || - atomcount > 0 || cb->had_pruneorskip || inassert || - (cb->external_options & PCRE2_NO_DOTSTAR_ANCHOR) != 0) + atomcount > 0 || cb->had_pruneorskip || inassert || !dotstar_anchor) return FALSE; } @@ -8790,13 +9007,14 @@ or *SKIP does not count, because once again the assumption no longer holds. cb points to the compile data atomcount atomic group level inassert TRUE if in an assertion + dotstar_anchor TRUE if automatic anchoring optimization is enabled Returns: TRUE or FALSE */ static BOOL is_startline(PCRE2_SPTR code, unsigned int bracket_map, compile_block *cb, - int atomcount, BOOL inassert) + int atomcount, BOOL inassert, BOOL dotstar_anchor) { do { PCRE2_SPTR scode = first_significant_code( @@ -8827,7 +9045,8 @@ do { return FALSE; default: /* Assertion */ - if (!is_startline(scode, bracket_map, cb, atomcount, TRUE)) return FALSE; + if (!is_startline(scode, bracket_map, cb, atomcount, TRUE, dotstar_anchor)) + return FALSE; do scode += GET(scode, 1); while (*scode == OP_ALT); scode += 1 + LINK_SIZE; break; @@ -8841,7 +9060,7 @@ do { if (op == OP_BRA || op == OP_BRAPOS || op == OP_SBRA || op == OP_SBRAPOS) { - if (!is_startline(scode, bracket_map, cb, atomcount, inassert)) + if (!is_startline(scode, bracket_map, cb, atomcount, inassert, dotstar_anchor)) return FALSE; } @@ -8852,14 +9071,15 @@ do { { int n = GET2(scode, 1+LINK_SIZE); unsigned int new_map = bracket_map | ((n < 32)? (1u << n) : 1); - if (!is_startline(scode, new_map, cb, atomcount, inassert)) return FALSE; + if (!is_startline(scode, new_map, cb, atomcount, inassert, dotstar_anchor)) + return FALSE; } /* Positive forward assertions */ else if (op == OP_ASSERT || op == OP_ASSERT_NA) { - if (!is_startline(scode, bracket_map, cb, atomcount, TRUE)) + if (!is_startline(scode, bracket_map, cb, atomcount, TRUE, dotstar_anchor)) return FALSE; } @@ -8867,7 +9087,7 @@ do { else if (op == OP_ONCE) { - if (!is_startline(scode, bracket_map, cb, atomcount + 1, inassert)) + if (!is_startline(scode, bracket_map, cb, atomcount + 1, inassert, dotstar_anchor)) return FALSE; } @@ -8881,8 +9101,7 @@ do { else if (op == OP_TYPESTAR || op == OP_TYPEMINSTAR || op == OP_TYPEPOSSTAR) { if (scode[1] != OP_ANY || (bracket_map & cb->backref_map) != 0 || - atomcount > 0 || cb->had_pruneorskip || inassert || - (cb->external_options & PCRE2_NO_DOTSTAR_ANCHOR) != 0) + atomcount > 0 || cb->had_pruneorskip || inassert || !dotstar_anchor) return FALSE; } @@ -8916,8 +9135,8 @@ OP_RECURSE. Returns: pointer to the opcode for OP_RECURSE, or NULL if not found */ -static PCRE2_SPTR -find_recurse(PCRE2_SPTR code, BOOL utf) +static PCRE2_UCHAR * +find_recurse(PCRE2_UCHAR *code, BOOL utf) { for (;;) { @@ -8926,12 +9145,13 @@ for (;;) if (c == OP_RECURSE) return code; /* XCLASS is used for classes that cannot be represented just by a bit map. - This includes negated single high-valued characters. CALLOUT_STR is used for - callouts with string arguments. In both cases the length in the table is + This includes negated single high-valued characters. ECLASS is used for + classes that use set operations internally. CALLOUT_STR is used for + callouts with string arguments. In each case the length in the table is zero; the actual length is stored in the compiled code. */ - if (c == OP_XCLASS) code += GET(code, 1); - else if (c == OP_CALLOUT_STR) code += GET(code, 1 + 2*LINK_SIZE); + if (c == OP_XCLASS || c == OP_ECLASS) code += GET(code, 1); + else if (c == OP_CALLOUT_STR) code += GET(code, 1 + 2*LINK_SIZE); /* Otherwise, we can get the item's length from the table, except that for repeated character types, we have to test for \p and \P, which have an extra @@ -9111,7 +9331,7 @@ do { case OP_EXACT: scode += IMM2_SIZE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_CHAR: case OP_PLUS: @@ -9124,7 +9344,7 @@ do { case OP_EXACTI: scode += IMM2_SIZE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_CHARI: case OP_PLUSI: @@ -9159,77 +9379,16 @@ return c; -/************************************************* -* Add an entry to the name/number table * -*************************************************/ - -/* This function is called between compiling passes to add an entry to the -name/number table, maintaining alphabetical order. Checking for permitted -and forbidden duplicates has already been done. - -Arguments: - cb the compile data block - name the name to add - length the length of the name - groupno the group number - tablecount the count of names in the table so far - -Returns: nothing -*/ - -static void -add_name_to_table(compile_block *cb, PCRE2_SPTR name, int length, - unsigned int groupno, uint32_t tablecount) -{ -uint32_t i; -PCRE2_UCHAR *slot = cb->name_table; - -for (i = 0; i < tablecount; i++) - { - int crc = memcmp(name, slot+IMM2_SIZE, CU2BYTES(length)); - if (crc == 0 && slot[IMM2_SIZE+length] != 0) - crc = -1; /* Current name is a substring */ - - /* Make space in the table and break the loop for an earlier name. For a - duplicate or later name, carry on. We do this for duplicates so that in the - simple case (when ?(| is not used) they are in order of their numbers. In all - cases they are in the order in which they appear in the pattern. */ - - if (crc < 0) - { - (void)memmove(slot + cb->name_entry_size, slot, - CU2BYTES((tablecount - i) * cb->name_entry_size)); - break; - } - - /* Continue the loop for a later or duplicate name */ - - slot += cb->name_entry_size; - } - -PUT2(slot, 0, groupno); -memcpy(slot + IMM2_SIZE, name, CU2BYTES(length)); - -/* Add a terminating zero and fill the rest of the slot with zeroes so that -the memory is all initialized. Otherwise valgrind moans about uninitialized -memory when saving serialized compiled patterns. */ - -memset(slot + IMM2_SIZE + length, 0, - CU2BYTES(cb->name_entry_size - length - IMM2_SIZE)); -} - - - /************************************************* * Skip in parsed pattern * *************************************************/ /* This function is called to skip parts of the parsed pattern when finding the length of a lookbehind branch. It is called after (*ACCEPT) and (*FAIL) to find -the end of the branch, it is called to skip over an internal lookaround or -(DEFINE) group, and it is also called to skip to the end of a class, during -which it will never encounter nested groups (but there's no need to have -special code for that). +the end of the branch; it is called to skip over an internal lookaround or +(DEFINE) group; and it is also called to skip to the end of a class, during +which it will never encounter nested groups (however extended classes can +themselves be nested, with their own class-nesting level). When called to find the end of a branch or group, pptr must point to the first meta code inside the branch, not the branch-starting code. In other cases it @@ -9250,6 +9409,7 @@ static uint32_t * parsed_skip(uint32_t *pptr, uint32_t skiptype) { uint32_t nestlevel = 0; +uint32_t class_nestlevel = 0; for (;; pptr++) { @@ -9261,10 +9421,14 @@ for (;; pptr++) if (meta < META_END) continue; /* Literal */ break; - /* This should never occur. */ + /* The parsed regex is malformed; we have reached the end and did + not find the end of the construct which we are skipping over. */ + /* LCOV_EXCL_START */ case META_END: + PCRE2_DEBUG_UNREACHABLE(); return NULL; + /* LCOV_EXCL_STOP */ /* The data for these items is variable in length. */ @@ -9272,19 +9436,9 @@ for (;; pptr++) if (META_DATA(*pptr) >= 10) pptr += SIZEOFFSET; break; - case META_ESCAPE: /* A few escapes are followed by data items. */ - switch (META_DATA(*pptr)) - { - case ESC_P: - case ESC_p: - pptr += 1; - break; - - case ESC_g: - case ESC_k: - pptr += 1 + SIZEOFFSET; - break; - } + case META_ESCAPE: + if (*pptr - META_ESCAPE == ESC_P || *pptr - META_ESCAPE == ESC_p) + pptr += 1; /* Skip prop data */ break; case META_MARK: /* Add the length of the name. */ @@ -9295,12 +9449,19 @@ for (;; pptr++) pptr += pptr[1]; break; - /* These are the "active" items in this loop. */ + /* These are the active items for tracking class nesting. */ + + case META_CLASS: + case META_CLASS_NOT: + if (skiptype == PSKIP_CLASS) class_nestlevel++; + break; case META_CLASS_END: - if (skiptype == PSKIP_CLASS) return pptr; + if (skiptype == PSKIP_CLASS && --class_nestlevel == 0) return pptr; break; + /* These are the "active" items for tracking ALT/KET nesting. */ + case META_ATOMIC: case META_CAPTURE: case META_COND_ASSERT: @@ -9310,6 +9471,7 @@ for (;; pptr++) case META_COND_RNAME: case META_COND_RNUMBER: case META_COND_VERSION: + case META_SCS: case META_LOOKAHEAD: case META_LOOKAHEADNOT: case META_LOOKAHEAD_NA: @@ -9337,8 +9499,10 @@ for (;; pptr++) if (meta >= sizeof(meta_extra_lengths)) return NULL; pptr += meta_extra_lengths[meta]; } -/* Control never reaches here */ -return pptr; + +/* LCOV_EXCL_START */ +PCRE2_UNREACHABLE(); /* Control never reaches here */ +/* LCOV_EXCL_STOP */ } @@ -9469,10 +9633,10 @@ for (;; pptr++) parsed_recurse_check *r; uint32_t *gptr, *gptrend; uint32_t escape; + uint32_t min, max; uint32_t group = 0; uint32_t itemlength = 0; uint32_t itemminlength = 0; - uint32_t min, max; if (*pptr < META_END) { @@ -9571,6 +9735,7 @@ for (;; pptr++) case META_LOOKAHEAD: case META_LOOKAHEADNOT: case META_LOOKAHEAD_NA: + case META_SCS: *errcodeptr = check_lookbehinds(pptr + 1, &pptr, recurses, cb, lcptr); if (*errcodeptr != 0) return -1; @@ -9602,7 +9767,9 @@ for (;; pptr++) break; /* A nested lookbehind does not contribute any length to this lookbehind, - but must itself be checked and have its lengths set. */ + but must itself be checked and have its lengths set. Note that + set_lookbehind_lengths() updates pptr, leaving it pointing to the final ket + of the group, so no need to update it here. */ case META_LOOKBEHIND: case META_LOOKBEHINDNOT: @@ -9620,36 +9787,30 @@ for (;; pptr++) case META_BACKREF_BYNAME: if ((cb->external_options & PCRE2_MATCH_UNSET_BACKREF) != 0) goto ISNOTFIXED; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case META_RECURSE_BYNAME: { - int i; PCRE2_SPTR name; BOOL is_dupname = FALSE; - named_group *ng = cb->named_groups; + named_group *ng; uint32_t meta_code = META_CODE(*pptr); uint32_t length = *(++pptr); GETPLUSOFFSET(offset, pptr); name = cb->start_pattern + offset; - for (i = 0; i < cb->names_found; i++, ng++) - { - if (length == ng->length && PRIV(strncmp)(name, ng->name, length) == 0) - { - group = ng->number; - is_dupname = ng->isdup; - break; - } - } + ng = PRIV(compile_find_named_group)(name, length, cb); - if (group == 0) + if (ng == NULL) { *errcodeptr = ERR15; /* Non-existent subpattern */ cb->erroroffset = offset; return -1; } + group = ng->number; + is_dupname = (ng->hash_dup & NAMED_GROUP_IS_DUPNAME) != 0; + /* A numerical back reference can be fixed length if duplicate capturing groups are not being used. A non-duplicate named back reference can also be handled. */ @@ -9675,7 +9836,7 @@ for (;; pptr++) goto RECURSE_OR_BACKREF_LENGTH; } - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* For groups >= 10 - picking up group twice does no harm. */ /* A true recursion implies not fixed length, but a subroutine call may @@ -9755,7 +9916,7 @@ for (;; pptr++) case META_CAPTURE: group = META_DATA(*pptr); - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case META_ATOMIC: case META_NOCAPTURE: @@ -9802,7 +9963,7 @@ for (;; pptr++) else itemlength = (max - 1) * lastitemlength; break; } - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* Any other item means this branch does not have a fixed length. */ @@ -9837,9 +9998,12 @@ for (;; pptr++) *minptr = branchminlength; return branchlength; +/* LCOV_EXCL_START */ PARSED_SKIP_FAILED: -*errcodeptr = ERR90; +PCRE2_DEBUG_UNREACHABLE(); +*errcodeptr = ERR90; /* Unhandled META code - internal error */ return -1; +/* LCOV_EXCL_STOP */ } @@ -9922,7 +10086,7 @@ possibly different) length. */ if (variable) { gbptr[1] = minlength; - if ((uint32_t)maxlength > cb->max_varlookbehind) + if ((PCRE2_SIZE)maxlength > cb->max_varlookbehind) { *errcodeptr = ERR100; cb->erroroffset = offset; @@ -9931,8 +10095,6 @@ if (variable) } else gbptr[1] = LOOKBEHIND_MAX; - -gbptr[1] = variable? minlength : LOOKBEHIND_MAX; return TRUE; } @@ -9977,12 +10139,20 @@ for (; *pptr != META_END; pptr++) switch (META_CODE(*pptr)) { + /* The following erroroffset is a bogus but safe value. This branch should + be avoided by providing a proper implementation for all supported cases + below. */ + + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); + cb->erroroffset = 0; return ERR70; /* Unrecognized meta code */ + /* LCOV_EXCL_STOP */ case META_ESCAPE: if (*pptr - META_ESCAPE == ESC_P || *pptr - META_ESCAPE == ESC_p) - pptr += 1; + pptr += 1; /* Skip prop data */ break; case META_KET: @@ -9996,6 +10166,7 @@ for (; *pptr != META_END; pptr++) case META_ATOMIC: case META_CAPTURE: case META_COND_ASSERT: + case META_SCS: case META_LOOKAHEAD: case META_LOOKAHEADNOT: case META_LOOKAHEAD_NA: @@ -10019,6 +10190,11 @@ for (; *pptr != META_END; pptr++) case META_COMMIT: case META_DOLLAR: case META_DOT: + case META_ECLASS_AND: + case META_ECLASS_NOT: + case META_ECLASS_OR: + case META_ECLASS_SUB: + case META_ECLASS_XOR: case META_FAIL: case META_PLUS: case META_PLUS_PLUS: @@ -10033,6 +10209,7 @@ for (; *pptr != META_END; pptr++) case META_THEN: break; + case META_OFFSET: case META_RECURSE: pptr += SIZEOFFSET; break; @@ -10067,6 +10244,8 @@ for (; *pptr != META_END; pptr++) case META_BIGVALUE: case META_POSIX: case META_POSIX_NEG: + case META_CAPTURE_NAME: + case META_CAPTURE_NUMBER: pptr += 1; break; @@ -10089,6 +10268,9 @@ for (; *pptr != META_END; pptr++) pptr += 1 + pptr[1]; break; + /* Note that set_lookbehind_lengths() updates pptr, leaving it pointing to + the final ket of the group, so no need to update it here. */ + case META_LOOKBEHIND: case META_LOOKBEHINDNOT: case META_LOOKBEHIND_NA: @@ -10134,20 +10316,21 @@ pcre2_real_code *re = NULL; /* What we will return */ compile_block cb; /* "Static" compile-time data */ const uint8_t *tables; /* Char tables base pointer */ +PCRE2_UCHAR null_str[1] = { 0xcd }; /* Dummy for handling null inputs */ PCRE2_UCHAR *code; /* Current pointer in compiled code */ -PCRE2_SPTR codestart; /* Start of compiled code */ +PCRE2_UCHAR *codestart; /* Start of compiled code */ PCRE2_SPTR ptr; /* Current pointer in pattern */ uint32_t *pptr; /* Current pointer in parsed pattern */ PCRE2_SIZE length = 1; /* Allow for final END opcode */ PCRE2_SIZE usedlength; /* Actual length used */ PCRE2_SIZE re_blocksize; /* Size of memory block */ -PCRE2_SIZE big32count = 0; /* 32-bit literals >= 0x80000000 */ PCRE2_SIZE parsed_size_needed; /* Needed for parsed pattern */ uint32_t firstcuflags, reqcuflags; /* Type of first/req code unit */ uint32_t firstcu, reqcu; /* Value of first/req code unit */ uint32_t setflags = 0; /* NL and BSR set flags */ +uint32_t xoptions; /* Flags from context, modified */ uint32_t skipatstart; /* When checking (*UTF) etc */ uint32_t limit_heap = UINT32_MAX; @@ -10161,6 +10344,10 @@ int regexrc; /* Return from compile */ uint32_t i; /* Local loop counter */ +/* Enable all optimizations by default. */ +uint32_t optim_flags = ccontext != NULL ? ccontext->optimization_flags : + PCRE2_OPTIMIZATION_ALL; + /* Comments at the head of this file explain about these variables. */ uint32_t stack_groupinfo[GROUPINFO_DEFAULT_SIZE]; @@ -10178,7 +10365,16 @@ PCRE2_UCHAR *cworkspace = (PCRE2_UCHAR *)c16workspace; /* There must be error code and offset pointers. */ -if (errorptr == NULL || erroroffset == NULL) return NULL; +if (errorptr == NULL) + { + if (erroroffset != NULL) *erroroffset = 0; + return NULL; + } +if (erroroffset == NULL) + { + if (errorptr != NULL) *errorptr = ERR120; + return NULL; + } *errorptr = ERR0; *erroroffset = 0; @@ -10186,7 +10382,9 @@ if (errorptr == NULL || erroroffset == NULL) return NULL; if (pattern == NULL) { - if (patlen == 0) pattern = (PCRE2_SPTR)""; else + if (patlen == 0) + pattern = null_str; + else { *errorptr = ERR16; return NULL; @@ -10224,6 +10422,7 @@ PCRE2_ZERO_TERMINATED. Check for an overlong pattern. */ if ((zero_terminated = (patlen == PCRE2_ZERO_TERMINATED))) patlen = PRIV(strlen)(pattern); +(void)zero_terminated; /* Silence compiler; only used if Valgrind enabled */ if (patlen > ccontext->max_pattern_length) { @@ -10231,6 +10430,18 @@ if (patlen > ccontext->max_pattern_length) return NULL; } +/* Optimization flags in 'options' can override those in the compile context. +This is because some options to disable optimizations were added before the +optimization flags word existed, and we need to continue supporting them +for backwards compatibility. */ + +if ((options & PCRE2_NO_AUTO_POSSESS) != 0) + optim_flags &= ~PCRE2_OPTIM_AUTO_POSSESS; +if ((options & PCRE2_NO_DOTSTAR_ANCHOR) != 0) + optim_flags &= ~PCRE2_OPTIM_DOTSTAR_ANCHOR; +if ((options & PCRE2_NO_START_OPTIMIZE) != 0) + optim_flags &= ~PCRE2_OPTIM_START_OPTIMIZE; + /* From here on, all returns from this function should end up going via the EXIT label. */ @@ -10269,6 +10480,11 @@ cb.start_code = cworkspace; cb.start_pattern = pattern; cb.start_workspace = cworkspace; cb.workspace_size = COMPILE_WORK_SIZE; +cb.first_data = NULL; +cb.last_data = NULL; +#ifdef SUPPORT_WIDE_CHARS +cb.char_lists_size = 0; +#endif /* Maximum back reference and backref bitmap. The bitmap records up to 31 back references to help in deciding whether (.*) can be treated as anchored or not. @@ -10302,6 +10518,7 @@ non-zero-terminated patterns. */ if (zero_terminated) VALGRIND_MAKE_MEM_NOACCESS(pattern + patlen, CU2BYTES(1)); #endif +xoptions = ccontext->extra_options; ptr = pattern; skipatstart = 0; @@ -10313,13 +10530,13 @@ if ((options & PCRE2_LITERAL) == 0) { for (i = 0; i < sizeof(pso_list)/sizeof(pso); i++) { - uint32_t c, pp; const pso *p = pso_list + i; if (patlen - skipatstart - 2 >= p->length && - PRIV(strncmp_c8)(ptr + skipatstart + 2, (char *)(p->name), - p->length) == 0) + PRIV(strncmp_c8)(ptr + skipatstart + 2, p->name, p->length) == 0) { + uint32_t c, pp; + skipatstart += p->length + 2; switch(p->type) { @@ -10327,6 +10544,10 @@ if ((options & PCRE2_LITERAL) == 0) cb.external_options |= p->value; break; + case PSO_XOPT: + xoptions |= p->value; + break; + case PSO_FLG: setflags |= p->value; break; @@ -10346,34 +10567,62 @@ if ((options & PCRE2_LITERAL) == 0) case PSO_LIMH: c = 0; pp = skipatstart; - if (!IS_DIGIT(ptr[pp])) - { - errorcode = ERR60; - ptr += pp; - goto HAD_EARLY_ERROR; - } - while (IS_DIGIT(ptr[pp])) + while (pp < patlen && IS_DIGIT(ptr[pp])) { if (c > UINT32_MAX / 10 - 1) break; /* Integer overflow */ c = c*10 + (ptr[pp++] - CHAR_0); } - if (ptr[pp++] != CHAR_RIGHT_PARENTHESIS) + if (pp >= patlen || pp == skipatstart || ptr[pp] != CHAR_RIGHT_PARENTHESIS) { errorcode = ERR60; ptr += pp; + utf = FALSE; /* Used by HAD_EARLY_ERROR */ goto HAD_EARLY_ERROR; } if (p->type == PSO_LIMH) limit_heap = c; else if (p->type == PSO_LIMM) limit_match = c; else limit_depth = c; - skipatstart += pp - skipatstart; + skipatstart = ++pp; + break; + + case PSO_OPTMZ: + optim_flags &= ~(p->value); + + /* For backward compatibility the three original VERBs to disable + optimizations need to also update the corresponding bit in the + external options. */ + + switch(p->value) + { + case PCRE2_OPTIM_AUTO_POSSESS: + cb.external_options |= PCRE2_NO_AUTO_POSSESS; + break; + + case PCRE2_OPTIM_DOTSTAR_ANCHOR: + cb.external_options |= PCRE2_NO_DOTSTAR_ANCHOR; + break; + + case PCRE2_OPTIM_START_OPTIMIZE: + cb.external_options |= PCRE2_NO_START_OPTIMIZE; + break; + } + break; + + /* LCOV_EXCL_START */ + default: + /* All values in the enum need an explicit entry for this switch + but until a better way to prevent coding mistakes is invented keep + a catch all that triggers a debug build assert as a failsafe */ + PCRE2_DEBUG_UNREACHABLE(); + /* LCOV_EXCL_STOP */ } break; /* Out of the table scan loop */ } } if (i >= sizeof(pso_list)/sizeof(pso)) break; /* Out of pso loop */ } + PCRE2_ASSERT(skipatstart <= patlen); } /* End of pattern-start options; advance to start of real regex. */ @@ -10425,6 +10674,31 @@ if (ucp && (cb.external_options & PCRE2_NEVER_UCP) != 0) goto HAD_EARLY_ERROR; } +/* PCRE2_EXTRA_TURKISH_CASING checks */ + +if ((xoptions & PCRE2_EXTRA_TURKISH_CASING) != 0) + { + if (!utf && !ucp) + { + errorcode = ERR104; + goto HAD_EARLY_ERROR; + } + +#if PCRE2_CODE_UNIT_WIDTH == 8 + if (!utf) + { + errorcode = ERR105; + goto HAD_EARLY_ERROR; + } +#endif + + if ((xoptions & PCRE2_EXTRA_CASELESS_RESTRICT) != 0) + { + errorcode = ERR106; + goto HAD_EARLY_ERROR; + } + } + /* Process the BSR setting. */ if (bsr == 0) bsr = ccontext->bsr_convention; @@ -10464,51 +10738,43 @@ switch(newline) cb.nltype = NLTYPE_ANYCRLF; break; + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); errorcode = ERR56; goto HAD_EARLY_ERROR; + /* LCOV_EXCL_STOP */ } /* Pre-scan the pattern to do two things: (1) Discover the named groups and their numerical equivalents, so that this information is always available for the remaining processing. (2) At the same time, parse the pattern and put a processed version into the parsed_pattern vector. This has escapes interpreted -and comments removed (amongst other things). +and comments removed (amongst other things). */ -In all but one case, when PCRE2_AUTO_CALLOUT is not set, the number of unsigned -32-bit ints in the parsed pattern is bounded by the length of the pattern plus -one (for the terminator) plus four if PCRE2_EXTRA_WORD or PCRE2_EXTRA_LINE is -set. The exceptional case is when running in 32-bit, non-UTF mode, when literal -characters greater than META_END (0x80000000) have to be coded as two units. In -this case, therefore, we scan the pattern to check for such values. */ - -#if PCRE2_CODE_UNIT_WIDTH == 32 -if (!utf) - { - PCRE2_SPTR p; - for (p = ptr; p < cb.end_pattern; p++) if (*p >= META_END) big32count++; - } -#endif +/* Ensure that the parsed pattern buffer is big enough. For many smaller +patterns the vector on the stack (which was set up above) can be used. */ -/* Ensure that the parsed pattern buffer is big enough. When PCRE2_AUTO_CALLOUT -is set we have to assume a numerical callout (4 elements) for each character -plus one at the end. This is overkill, but memory is plentiful these days. For -many smaller patterns the vector on the stack (which was set up above) can be -used. */ +parsed_size_needed = max_parsed_pattern(ptr, cb.end_pattern, utf, options); -parsed_size_needed = patlen - skipatstart + big32count; +/* Allow for 2x uint32_t at the start and 2 at the end, for +PCRE2_EXTRA_MATCH_WORD or PCRE2_EXTRA_MATCH_LINE (which are exclusive). */ if ((ccontext->extra_options & (PCRE2_EXTRA_MATCH_WORD|PCRE2_EXTRA_MATCH_LINE)) != 0) parsed_size_needed += 4; +/* When PCRE2_AUTO_CALLOUT is set we allow for one callout at the end. */ + if ((options & PCRE2_AUTO_CALLOUT) != 0) - parsed_size_needed = (parsed_size_needed + 1) * 5; + parsed_size_needed += 4; + +parsed_size_needed += 1; /* For the final META_END */ -if (parsed_size_needed >= PARSED_PATTERN_DEFAULT_SIZE) +if (parsed_size_needed > PARSED_PATTERN_DEFAULT_SIZE) { uint32_t *heap_parsed_pattern = ccontext->memctl.malloc( - (parsed_size_needed + 1) * sizeof(uint32_t), ccontext->memctl.memory_data); + parsed_size_needed * sizeof(uint32_t), ccontext->memctl.memory_data); if (heap_parsed_pattern == NULL) { *errorptr = ERR21; @@ -10516,11 +10782,11 @@ if (parsed_size_needed >= PARSED_PATTERN_DEFAULT_SIZE) } cb.parsed_pattern = heap_parsed_pattern; } -cb.parsed_pattern_end = cb.parsed_pattern + parsed_size_needed + 1; +cb.parsed_pattern_end = cb.parsed_pattern + parsed_size_needed; /* Do the parsing scan. */ -errorcode = parse_regex(ptr, cb.external_options, &has_lookbehind, &cb); +errorcode = parse_regex(ptr, cb.external_options, xoptions, &has_lookbehind, &cb); if (errorcode != 0) goto HAD_CB_ERROR; /* If there are any lookbehinds, scan the parsed pattern to figure out their @@ -10589,7 +10855,7 @@ pptr = cb.parsed_pattern; code = cworkspace; *code = OP_BRA; -(void)compile_regex(cb.external_options, ccontext->extra_options, &code, &pptr, +(void)compile_regex(cb.external_options, xoptions, &code, &pptr, &errorcode, 0, &firstcu, &firstcuflags, &reqcu, &reqcuflags, NULL, NULL, &cb, &length); @@ -10597,9 +10863,17 @@ if (errorcode != 0) goto HAD_CB_ERROR; /* Offset is in cb.erroroffset */ /* This should be caught in compile_regex(), but just in case... */ +#if defined SUPPORT_WIDE_CHARS +PCRE2_ASSERT((cb.char_lists_size & 0x3) == 0); +if (length > MAX_PATTERN_SIZE || + BYTES2CU(cb.char_lists_size) > MAX_PATTERN_SIZE || + MAX_PATTERN_SIZE - length < BYTES2CU(cb.char_lists_size)) +#else if (length > MAX_PATTERN_SIZE) +#endif { errorcode = ERR20; + cb.erroroffset = 0; goto HAD_CB_ERROR; } @@ -10608,21 +10882,70 @@ block for storing the compiled pattern and names table. Integer overflow should no longer be possible because nowadays we limit the maximum value of cb.names_found and cb.name_entry_size. */ -re_blocksize = sizeof(pcre2_real_code) + - CU2BYTES(length + - (PCRE2_SIZE)cb.names_found * (PCRE2_SIZE)cb.name_entry_size); +re_blocksize = + CU2BYTES((PCRE2_SIZE)cb.names_found * (PCRE2_SIZE)cb.name_entry_size); + +#if defined SUPPORT_WIDE_CHARS +if (cb.char_lists_size != 0) + { +#if PCRE2_CODE_UNIT_WIDTH != 32 + /* Align to 32 bit first. This ensures the + allocated area will also be 32 bit aligned. */ + re_blocksize = (PCRE2_SIZE)CLIST_ALIGN_TO(re_blocksize, sizeof(uint32_t)); +#else + /* Already 32 bit aligned. */ +#endif + + /* We have bounded the length and BYTES2CU(char_lists_size) to + MAX_PATTERN_SIZE units, however (with 32-bit code units) char_lists_size + in bytes could still be extremely close to (or greater than) SIZE_MAX, so + we require another overflow check. */ + + if (cb.char_lists_size > PCRE2_SIZE_MAX - re_blocksize) + { + errorcode = ERR20; + cb.erroroffset = 0; + goto HAD_CB_ERROR; + } + + re_blocksize += cb.char_lists_size; + } +#endif + +if (length > BYTES2CU(PCRE2_SIZE_MAX - re_blocksize)) + { + /* Given the current value of 2^30 for MAX_PATTERN_SIZE, this block is only + reachable when both PCRE2_CODE_UNIT_WIDTH >= 16 and sizeof(size_t) is + 32 bits. */ + errorcode = ERR20; + cb.erroroffset = 0; + goto HAD_CB_ERROR; + } + +re_blocksize += CU2BYTES(length); if (re_blocksize > ccontext->max_pattern_compiled_length) { errorcode = ERR101; + cb.erroroffset = 0; + goto HAD_CB_ERROR; + } + +if (sizeof(pcre2_real_code) > PCRE2_SIZE_MAX - re_blocksize) + { + errorcode = ERR20; + cb.erroroffset = 0; goto HAD_CB_ERROR; } +re_blocksize += sizeof(pcre2_real_code); + re = (pcre2_real_code *) ccontext->memctl.malloc(re_blocksize, ccontext->memctl.memory_data); if (re == NULL) { errorcode = ERR21; + cb.erroroffset = 0; goto HAD_CB_ERROR; } @@ -10638,10 +10961,11 @@ re->tables = tables; re->executable_jit = NULL; memset(re->start_bitmap, 0, 32 * sizeof(uint8_t)); re->blocksize = re_blocksize; +re->code_start = re_blocksize - CU2BYTES(length); re->magic_number = MAGIC_NUMBER; re->compile_options = options; re->overall_options = cb.external_options; -re->extra_options = ccontext->extra_options; +re->extra_options = xoptions; re->flags = PCRE2_CODE_UNIT_WIDTH/8 | cb.external_flags | setflags; re->limit_heap = limit_heap; re->limit_match = limit_match; @@ -10656,12 +10980,12 @@ re->top_bracket = 0; re->top_backref = 0; re->name_entry_size = cb.name_entry_size; re->name_count = cb.names_found; +re->optimization_flags = optim_flags; /* The basic block is immediately followed by the name table, and the compiled code follows after that. */ -codestart = (PCRE2_SPTR)((uint8_t *)re + sizeof(pcre2_real_code)) + - re->name_entry_size * re->name_count; +codestart = (PCRE2_UCHAR *)((uint8_t *)re + re->code_start); /* Update the compile data block for the actual compile. The starting points of the name/number translation table and of the code are passed around in the @@ -10676,6 +11000,10 @@ cb.start_code = codestart; cb.req_varyopt = 0; cb.had_accept = FALSE; cb.had_pruneorskip = FALSE; +#ifdef SUPPORT_WIDE_CHARS +cb.char_lists_size = 0; +#endif + /* If any named groups were found, create the name/number table from the list created in the pre-pass. */ @@ -10683,8 +11011,14 @@ created in the pre-pass. */ if (cb.names_found > 0) { named_group *ng = cb.named_groups; + uint32_t tablecount = 0; + + /* Length 0 represents duplicates, and they have already been handled. */ for (i = 0; i < cb.names_found; i++, ng++) - add_name_to_table(&cb, ng->name, ng->length, ng->number, i); + if (ng->length > 0) + tablecount = PRIV(compile_add_name_to_table)(&cb, ng, tablecount); + + PCRE2_ASSERT(tablecount == cb.names_found); } /* Set up a starting, non-extracting bracket, then compile the expression. On @@ -10694,7 +11028,7 @@ of the function here. */ pptr = cb.parsed_pattern; code = (PCRE2_UCHAR *)codestart; *code = OP_BRA; -regexrc = compile_regex(re->overall_options, ccontext->extra_options, &code, +regexrc = compile_regex(re->overall_options, re->extra_options, &code, &pptr, &errorcode, 0, &firstcu, &firstcuflags, &reqcu, &reqcuflags, NULL, NULL, &cb, NULL); if (regexrc < 0) re->flags |= PCRE2_MATCH_EMPTY; @@ -10716,13 +11050,20 @@ memory as unaddressable, so that any out-of-bound reads can be detected. */ *code++ = OP_END; usedlength = code - codestart; -if (usedlength > length) errorcode = ERR23; else +/* LCOV_EXCL_START */ +if (usedlength > length) { - re->blocksize -= CU2BYTES(length - usedlength); + PCRE2_DEBUG_UNREACHABLE(); + errorcode = ERR23; /* Overflow of code block - internal error */ + cb.erroroffset = 0; + goto HAD_CB_ERROR; + } +/* LCOV_EXCL_STOP */ + +re->blocksize -= CU2BYTES(length - usedlength); #ifdef SUPPORT_VALGRIND - VALGRIND_MAKE_MEM_NOACCESS(code, CU2BYTES(length - usedlength)); +VALGRIND_MAKE_MEM_NOACCESS(code, CU2BYTES(length - usedlength)); #endif - } /* Scan the pattern for recursion/subroutine calls and convert the group numbers into offsets. Maintain a small cache so that repeated groups containing @@ -10738,9 +11079,9 @@ if (errorcode == 0 && cb.had_recurse) int start = RSCAN_CACHE_SIZE; recurse_cache rc[RSCAN_CACHE_SIZE]; - for (rcode = (PCRE2_UCHAR *)find_recurse(codestart, utf); + for (rcode = find_recurse(codestart, utf); rcode != NULL; - rcode = (PCRE2_UCHAR *)find_recurse(rcode + 1 + LINK_SIZE, utf)) + rcode = find_recurse(rcode + 1 + LINK_SIZE, utf)) { int p, groupnumber; @@ -10767,11 +11108,15 @@ if (errorcode == 0 && cb.had_recurse) if (rgroup == NULL) { rgroup = PRIV(find_bracket)(search_from, utf, groupnumber); + /* LCOV_EXCL_START */ if (rgroup == NULL) { + PCRE2_DEBUG_UNREACHABLE(); errorcode = ERR53; break; } + /* LCOV_EXCL_STOP */ + if (--start < 0) start = RSCAN_CACHE_SIZE - 1; rc[start].groupnumber = groupnumber; rc[start].group = rgroup; @@ -10779,7 +11124,7 @@ if (errorcode == 0 && cb.had_recurse) } } - PUT(rcode, 1, rgroup - codestart); + PUT(rcode, 1, (uint32_t)(rgroup - codestart)); } } @@ -10798,10 +11143,18 @@ used in this code because at least one compiler gives a warning about loss of "const" attribute if the cast (PCRE2_UCHAR *)codestart is used directly in the function call. */ -if (errorcode == 0 && (re->overall_options & PCRE2_NO_AUTO_POSSESS) == 0) +if (errorcode == 0 && (optim_flags & PCRE2_OPTIM_AUTO_POSSESS) != 0) { PCRE2_UCHAR *temp = (PCRE2_UCHAR *)codestart; - if (PRIV(auto_possessify)(temp, &cb) != 0) errorcode = ERR80; + int possessify_rc = PRIV(auto_possessify)(temp, &cb); + /* LCOV_EXCL_START */ + if (possessify_rc != 0) + { + PCRE2_DEBUG_UNREACHABLE(); + errorcode = ERR80; + cb.erroroffset = 0; + } + /* LCOV_EXCL_STOP */ } /* Failed to compile, or error while post-processing. */ @@ -10814,27 +11167,42 @@ or anything else, such as starting with non-atomic .* when DOTALL is set and there are no occurrences of *PRUNE or *SKIP (though there is an option to disable this case). */ -if ((re->overall_options & PCRE2_ANCHORED) == 0 && - is_anchored(codestart, 0, &cb, 0, FALSE)) - re->overall_options |= PCRE2_ANCHORED; +if ((re->overall_options & PCRE2_ANCHORED) == 0) + { + BOOL dotstar_anchor = ((optim_flags & PCRE2_OPTIM_DOTSTAR_ANCHOR) != 0); + if (is_anchored(codestart, 0, &cb, 0, FALSE, dotstar_anchor)) + re->overall_options |= PCRE2_ANCHORED; + } /* Set up the first code unit or startline flag, the required code unit, and -then study the pattern. This code need not be obeyed if PCRE2_NO_START_OPTIMIZE -is set, as the data it would create will not be used. Note that a first code +then study the pattern. This code need not be obeyed if PCRE2_OPTIM_START_OPTIMIZE +is disabled, as the data it would create will not be used. Note that a first code unit (but not the startline flag) is useful for anchored patterns because it can still give a quick "no match" and also avoid searching for a last code unit. */ -if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0) +if ((optim_flags & PCRE2_OPTIM_START_OPTIMIZE) != 0) { int minminlength = 0; /* For minimal minlength from first/required CU */ + int study_rc; /* If we do not have a first code unit, see if there is one that is asserted (these are not saved during the compile because they can cause conflicts with actual literals that follow). */ - if (firstcuflags >= REQ_NONE) - firstcu = find_firstassertedcu(codestart, &firstcuflags, 0); + if (firstcuflags >= REQ_NONE) { + uint32_t assertedcuflags = 0; + uint32_t assertedcu = find_firstassertedcu(codestart, &assertedcuflags, 0); + /* It would be wrong to use the asserted first code unit as `firstcu` for + * regexes which are able to match a 1-character string (e.g. /(?=a)b?a/) + * For that example, if we set both firstcu and reqcu to 'a', it would mean + * the subject string needs to be at least 2 characters long, which is wrong. + * With more analysis, we would be able to set firstcu in more cases. */ + if (assertedcuflags < REQ_NONE && assertedcu != reqcu) { + firstcu = assertedcu; + firstcuflags = assertedcuflags; + } + } /* Save the data for a first code unit. The existence of one means the minimum length must be at least 1. */ @@ -10855,8 +11223,8 @@ if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0) } /* The first code unit is > 128 in UTF or UCP mode, or > 255 otherwise. - In 8-bit UTF mode, codepoints in the range 128-255 are introductory code - points and cannot have another case, but if UCP is set they may do. */ + In 8-bit UTF mode, code units in the range 128-255 are introductory code + units and cannot have another case, but if UCP is set they may do. */ #ifdef SUPPORT_UNICODE #if PCRE2_CODE_UNIT_WIDTH == 8 @@ -10877,9 +11245,12 @@ if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0) non-DOTALL matches when *PRUNE and SKIP are not present. (There is an option that disables this case.) */ - else if ((re->overall_options & PCRE2_ANCHORED) == 0 && - is_startline(codestart, 0, &cb, 0, FALSE)) - re->flags |= PCRE2_STARTLINE; + else if ((re->overall_options & PCRE2_ANCHORED) == 0) + { + BOOL dotstar_anchor = ((optim_flags & PCRE2_OPTIM_DOTSTAR_ANCHOR) != 0); + if (is_startline(codestart, 0, &cb, 0, FALSE, dotstar_anchor)) + re->flags |= PCRE2_STARTLINE; + } /* Handle the "required code unit", if one is set. In the UTF case we can increment the minimum minimum length only if we are sure this really is a @@ -10937,11 +11308,16 @@ if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0) /* Study the compiled pattern to set up information such as a bitmap of starting code units and a minimum matching length. */ - if (PRIV(study)(re) != 0) + study_rc = PRIV(study)(re); + /* LCOV_EXCL_START */ + if (study_rc != 0) { + PCRE2_DEBUG_UNREACHABLE(); errorcode = ERR31; + cb.erroroffset = 0; goto HAD_CB_ERROR; } + /* LCOV_EXCL_STOP */ /* If study() set a bitmap of starting code units, it implies a minimum length of at least one. */ @@ -10961,6 +11337,11 @@ version of the pattern, free it before returning. Also free the list of named groups if a larger one had to be obtained, and likewise the group information vector. */ +#ifdef SUPPORT_UNICODE +/* All items must be freed. */ +PCRE2_ASSERT(cb.first_data == NULL); +#endif + EXIT: #ifdef SUPPORT_VALGRIND if (zero_terminated) VALGRIND_MAKE_MEM_DEFINED(pattern + patlen, CU2BYTES(1)); @@ -10971,6 +11352,7 @@ if (cb.named_group_list_size > NAMED_GROUP_LIST_SIZE) ccontext->memctl.free((void *)cb.named_groups, ccontext->memctl.memory_data); if (cb.groupinfo != stack_groupinfo) ccontext->memctl.free((void *)cb.groupinfo, ccontext->memctl.memory_data); + return re; /* Will be NULL after an error */ /* Errors discovered in parse_regex() set the offset value in the compile @@ -10983,12 +11365,41 @@ an offset is available in the parsed pattern. */ ptr = pattern + cb.erroroffset; HAD_EARLY_ERROR: +/* Ensure we don't return out-of-range erroroffset. */ +PCRE2_ASSERT(ptr >= pattern); +PCRE2_ASSERT(ptr <= (pattern + patlen)); +/* Ensure that the erroroffset never slices a UTF-encoded character in half. +If the input is invalid, then we return an offset just before the first invalid +character, so the text to the left of the offset must always be valid. */ +#if defined PCRE2_DEBUG && defined SUPPORT_UNICODE +if (ptr > pattern && utf) + { + PCRE2_SPTR prev = ptr - 1; + PCRE2_SIZE dummyoffset; + BACKCHAR(prev); + PCRE2_ASSERT(prev >= pattern); + PCRE2_ASSERT(PRIV(valid_utf)(prev, ptr - prev, &dummyoffset) == 0); + } +#endif *erroroffset = ptr - pattern; HAD_ERROR: *errorptr = errorcode; pcre2_code_free(re); re = NULL; + +if (cb.first_data != NULL) + { + compile_data* current_data = cb.first_data; + do + { + compile_data* next_data = current_data->next; + cb.cx->memctl.free(current_data, cb.cx->memctl.memory_data); + current_data = next_data; + } + while (current_data != NULL); + } + goto EXIT; } diff --git a/std/regex/pcre2/pcre2_compile.h b/std/regex/pcre2/pcre2_compile.h new file mode 100644 index 000000000..331ca3ad3 --- /dev/null +++ b/std/regex/pcre2/pcre2_compile.h @@ -0,0 +1,356 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* 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. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge + +----------------------------------------------------------------------------- +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 its + 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. +----------------------------------------------------------------------------- +*/ + +#ifndef PCRE2_COMPILE_H_IDEMPOTENT_GUARD +#define PCRE2_COMPILE_H_IDEMPOTENT_GUARD + +#include "pcre2_internal.h" + +/* Compile time error code numbers. They are given names so that they can more +easily be tracked. When a new number is added, the tables called eint1 and +eint2 in pcre2posix.c may need to be updated, and a new error text must be +added to compile_error_texts in pcre2_error.c. Also, the error codes in +pcre2.h.in must be updated - their values are exactly 100 greater than these +values. */ + +enum { ERR0 = COMPILE_ERROR_BASE, + ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9, ERR10, + ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19, ERR20, + ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR28, ERR29, ERR30, + ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39, ERR40, + ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49, ERR50, + ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59, ERR60, + ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69, ERR70, + ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79, ERR80, + ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERR88, ERR89, ERR90, + ERR91, ERR92, ERR93, ERR94, ERR95, ERR96, ERR97, ERR98, ERR99, ERR100, + ERR101, ERR102, ERR103, ERR104, ERR105, ERR106, ERR107, ERR108, ERR109, ERR110, + ERR111, ERR112, ERR113, ERR114, ERR115, ERR116, ERR117, ERR118, ERR119, ERR120 }; + +/* Code values for parsed patterns, which are stored in a vector of 32-bit +unsigned ints. Values less than META_END are literal data values. The coding +for identifying the item is in the top 16-bits, leaving 16 bits for the +additional data that some of them need. The META_CODE, META_DATA, and META_DIFF +macros are used to manipulate parsed pattern elements. + +NOTE: When these definitions are changed, the table of extra lengths for each +code (meta_extra_lengths) must be updated to remain in step. */ + +#define META_END 0x80000000u /* End of pattern */ + +#define META_ALT 0x80010000u /* alternation */ +#define META_ATOMIC 0x80020000u /* atomic group */ +#define META_BACKREF 0x80030000u /* Back ref */ +#define META_BACKREF_BYNAME 0x80040000u /* \k'name' */ +#define META_BIGVALUE 0x80050000u /* Next is a literal > META_END */ +#define META_CALLOUT_NUMBER 0x80060000u /* (?C with numerical argument */ +#define META_CALLOUT_STRING 0x80070000u /* (?C with string argument */ +#define META_CAPTURE 0x80080000u /* Capturing parenthesis */ +#define META_CIRCUMFLEX 0x80090000u /* ^ metacharacter */ +#define META_CLASS 0x800a0000u /* start non-empty class */ +#define META_CLASS_EMPTY 0x800b0000u /* empty class */ +#define META_CLASS_EMPTY_NOT 0x800c0000u /* negative empty class */ +#define META_CLASS_END 0x800d0000u /* end of non-empty class */ +#define META_CLASS_NOT 0x800e0000u /* start non-empty negative class */ +#define META_COND_ASSERT 0x800f0000u /* (?(?assertion)... */ +#define META_COND_DEFINE 0x80100000u /* (?(DEFINE)... */ +#define META_COND_NAME 0x80110000u /* (?()... */ +#define META_COND_NUMBER 0x80120000u /* (?(digits)... */ +#define META_COND_RNAME 0x80130000u /* (?(R&name)... */ +#define META_COND_RNUMBER 0x80140000u /* (?(Rdigits)... */ +#define META_COND_VERSION 0x80150000u /* (?(VERSIONx.y)... */ +#define META_OFFSET 0x80160000u /* Setting offset for various META + codes (e.g. META_CAPTURE_NAME) */ +#define META_SCS 0x80170000u /* (*scan_substring:... */ +#define META_CAPTURE_NAME 0x80180000u /* Next in capture lists */ +#define META_CAPTURE_NUMBER 0x80190000u /* Next digits in capture lists */ +#define META_DOLLAR 0x801a0000u /* $ metacharacter */ +#define META_DOT 0x801b0000u /* . metacharacter */ +#define META_ESCAPE 0x801c0000u /* \d and friends */ +#define META_KET 0x801d0000u /* closing parenthesis */ +#define META_NOCAPTURE 0x801e0000u /* no capture parens */ +#define META_OPTIONS 0x801f0000u /* (?i) and friends */ +#define META_POSIX 0x80200000u /* POSIX class item */ +#define META_POSIX_NEG 0x80210000u /* negative POSIX class item */ +#define META_RANGE_ESCAPED 0x80220000u /* range with at least one escape */ +#define META_RANGE_LITERAL 0x80230000u /* range defined literally */ +#define META_RECURSE 0x80240000u /* Recursion */ +#define META_RECURSE_BYNAME 0x80250000u /* (?&name) */ +#define META_SCRIPT_RUN 0x80260000u /* (*script_run:...) */ + +/* These must be kept together to make it easy to check that an assertion +is present where expected in a conditional group. */ + +#define META_LOOKAHEAD 0x80270000u /* (?= */ +#define META_LOOKAHEADNOT 0x80280000u /* (?! */ +#define META_LOOKBEHIND 0x80290000u /* (?<= */ +#define META_LOOKBEHINDNOT 0x802a0000u /* (?>16) + +/* Macros to store and retrieve a PCRE2_SIZE value in the parsed pattern, which +consists of uint32_t elements. Assume that if uint32_t can't hold it, two of +them will be able to (i.e. assume a 64-bit world). */ + +#if PCRE2_SIZE_MAX <= UINT32_MAX +#define PUTOFFSET(s,p) *p++ = s +#define GETOFFSET(s,p) s = *p++ +#define GETPLUSOFFSET(s,p) s = *(++p) +#define READPLUSOFFSET(s,p) s = p[1] +#define SKIPOFFSET(p) p++ +#define SIZEOFFSET 1 +#else +#define PUTOFFSET(s,p) \ + { *p++ = (uint32_t)(s >> 32); *p++ = (uint32_t)(s & 0xffffffff); } +#define GETOFFSET(s,p) \ + { s = ((PCRE2_SIZE)p[0] << 32) | (PCRE2_SIZE)p[1]; p += 2; } +#define GETPLUSOFFSET(s,p) \ + { s = ((PCRE2_SIZE)p[1] << 32) | (PCRE2_SIZE)p[2]; p += 2; } +#define READPLUSOFFSET(s,p) \ + { s = ((PCRE2_SIZE)p[1] << 32) | (PCRE2_SIZE)p[2]; } +#define SKIPOFFSET(p) p += 2 +#define SIZEOFFSET 2 +#endif + +#ifdef PCRE2_DEBUG +/* Compile data types. */ +#define CDATA_RECURSE_ARGS 0 /* Argument list for recurse */ +#define CDATA_CRANGE 1 /* Character range list */ +#endif + +/* Extended class management flags. */ + +#define CLASS_IS_ECLASS 0x1 + +/* Macro for the highest character value. */ + +#if PCRE2_CODE_UNIT_WIDTH == 8 +#define MAX_UCHAR_VALUE 0xffu +#elif PCRE2_CODE_UNIT_WIDTH == 16 +#define MAX_UCHAR_VALUE 0xffffu +#else +#define MAX_UCHAR_VALUE 0xffffffffu +#endif + +#define GET_MAX_CHAR_VALUE(utf) \ + ((utf) ? MAX_UTF_CODE_POINT : MAX_UCHAR_VALUE) + +/* Macro for setting individual bits in class bitmaps. */ + +#define SETBIT(a,b) a[(b) >> 3] |= (uint8_t)(1u << ((b) & 0x7)) + +/* Macro for 8 bit specific checks. */ +#if PCRE2_CODE_UNIT_WIDTH == 8 +#define SELECT_VALUE8(value8, value) (value8) +#else +#define SELECT_VALUE8(value8, value) (value) +#endif + +/* Macro for aligning data. */ +#define CLIST_ALIGN_TO(base, align) \ + ((base + ((size_t)(align) - 1)) & ~((size_t)(align) - 1)) + +/* Structure for holding information about an OP_ECLASS internal operand. +An "operand" here could be just a single OP_[X]CLASS, or it could be some +complex expression; but it's some sequence of ECL_* codes which pushes one +value to the stack. */ +typedef struct { + /* The position of the operand - or NULL if (lengthptr != NULL). */ + PCRE2_UCHAR *code_start; + PCRE2_SIZE length; + /* The operand's type if it is a single code (ECL_XCLASS, ECL_ANY, ECL_NONE); + otherwise zero if the operand is not atomic. */ + uint8_t op_single_type; + /* Regardless of whether it's a single code or not, we fully constant-fold + the bitmap for code points < 256. */ + class_bits_storage bits; +} eclass_op_info; + +/* Macros for the definitions below, to prevent name collisions. */ + +#define _pcre2_posix_class_maps PCRE2_SUFFIX(_pcre2_posix_class_maps) +#define _pcre2_update_classbits PCRE2_SUFFIX(_pcre2_update_classbits_) +#define _pcre2_compile_class_nested PCRE2_SUFFIX(_pcre2_compile_class_nested_) +#define _pcre2_compile_class_not_nested PCRE2_SUFFIX(_pcre2_compile_class_not_nested_) +#define _pcre2_compile_get_hash_from_name PCRE2_SUFFIX(_pcre2_compile_get_hash_from_name) +#define _pcre2_compile_find_named_group PCRE2_SUFFIX(_pcre2_compile_find_named_group) +#define _pcre2_compile_find_dupname_details PCRE2_SUFFIX(_pcre2_compile_find_dupname_details) +#define _pcre2_compile_add_name_to_table PCRE2_SUFFIX(_pcre2_compile_add_name_to_table) +#define _pcre2_compile_parse_scan_substr_args PCRE2_SUFFIX(_pcre2_compile_parse_scan_substr_args) +#define _pcre2_compile_parse_recurse_args PCRE2_SUFFIX(_pcre2_compile_parse_recurse_args) + + +/* Indices of the POSIX classes in posix_names, posix_name_lengths, +posix_class_maps, and posix_substitutes. They must be kept in sync. */ + +#define PC_DIGIT 7 +#define PC_GRAPH 8 +#define PC_PRINT 9 +#define PC_PUNCT 10 +#define PC_XDIGIT 13 + +extern const int PRIV(posix_class_maps)[]; + +/* Defines for hash_dup member in named_group structure. */ + +#define NAMED_GROUP_HASH_MASK ((uint16_t)0x7fff) +#define NAMED_GROUP_IS_DUPNAME ((uint16_t)0x8000) + +#define NAMED_GROUP_GET_HASH(ng) ((ng)->hash_dup & NAMED_GROUP_HASH_MASK) + +/* Exported functions from pcre2_compile_class.c file: */ + +/* Set bits in classbits according to the property type */ + +void PRIV(update_classbits)(uint32_t ptype, uint32_t pdata, BOOL negated, + uint8_t *classbits); + +/* Compile the META codes from start_ptr...end_ptr, writing a single OP_CLASS +OP_CLASS, OP_NCLASS, OP_XCLASS, or OP_ALLANY into pcode. */ + +uint32_t *PRIV(compile_class_not_nested)(uint32_t options, uint32_t xoptions, + uint32_t *start_ptr, PCRE2_UCHAR **pcode, BOOL negate_class, BOOL* has_bitmap, + int *errorcodeptr, compile_block *cb, PCRE2_SIZE *lengthptr); + +/* Compile the META codes in pptr into opcodes written to pcode. The pptr must +start at a META_CLASS or META_CLASS_NOT. + +The pptr will be left pointing at the matching META_CLASS_END. */ + +BOOL PRIV(compile_class_nested)(uint32_t options, uint32_t xoptions, + uint32_t **pptr, PCRE2_UCHAR **pcode, int *errorcodeptr, + compile_block *cb, PCRE2_SIZE *lengthptr); + +/* Exported functions from pcre2_compile_cgroup.c file: */ + +/* Compute hash from a capture name. */ + +uint16_t PRIV(compile_get_hash_from_name)(PCRE2_SPTR name, uint32_t length); + +/* Get the descriptor of a known named capture. */ + +named_group *PRIV(compile_find_named_group)(PCRE2_SPTR name, + uint32_t length, compile_block *cb); + +/* Add entires to name table in alphabetical order. */ + +uint32_t PRIV(compile_add_name_to_table)(compile_block *cb, + named_group *ng, uint32_t tablecount); + +/* Searches the properties of duplicated names, and returns them +in indexptr and countptr. */ + +BOOL PRIV(compile_find_dupname_details)(PCRE2_SPTR name, uint32_t length, + int *indexptr, int *countptr, int *errorcodeptr, compile_block *cb); + +/* Parse the arguments of recurse operations. */ + +uint32_t * PRIV(compile_parse_scan_substr_args)(uint32_t *pptr, + int *errorcodeptr, compile_block *cb, PCRE2_SIZE *lengthptr); + +/* Parse the arguments of recurse operations. */ + +BOOL PRIV(compile_parse_recurse_args)(uint32_t *pptr_start, + PCRE2_SIZE offset, int *errorcodeptr, compile_block *cb); + +#endif /* PCRE2_COMPILE_H_IDEMPOTENT_GUARD */ + +/* End of pcre2_compile.h */ diff --git a/std/regex/pcre2/pcre2_compile_cgroup.c b/std/regex/pcre2/pcre2_compile_cgroup.c new file mode 100644 index 000000000..ee0cd06b7 --- /dev/null +++ b/std/regex/pcre2/pcre2_compile_cgroup.c @@ -0,0 +1,632 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE 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. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge + +----------------------------------------------------------------------------- +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 its + 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. +----------------------------------------------------------------------------- +*/ + + +#include "pcre2_compile.h" + +/************************************************* +* Compute the hash code from a capture name * +*************************************************/ + +/* This function returns with a simple hash code +computed from the name of a capture group. + +Arguments: + name name of the capture group + length the length of the name + +Returns: hash code +*/ + +uint16_t +PRIV(compile_get_hash_from_name)(PCRE2_SPTR name, uint32_t length) +{ +uint16_t hash; + +PCRE2_ASSERT(length > 0); + +hash = (uint16_t)((name[0] & 0x7f) | ((name[length - 1] & 0xff) << 7)); +PCRE2_ASSERT(hash <= NAMED_GROUP_HASH_MASK); +return hash; +} + + +/************************************************* +* Get the descriptor of a known named capture * +*************************************************/ + +/* This function returns the descriptor in the +named group list of a known capture group. + +Arguments: + name name of the capture group + length the length of the name + +Returns: pointer to the descriptor when found, + NULL otherwise + */ + +named_group * +PRIV(compile_find_named_group)(PCRE2_SPTR name, + uint32_t length, compile_block *cb) +{ +uint16_t hash = PRIV(compile_get_hash_from_name)(name, length); +named_group *ng; +named_group *end = cb->named_groups + cb->names_found; + +for (ng = cb->named_groups; ng < end; ng++) + if (length == ng->length && hash == NAMED_GROUP_GET_HASH(ng) && + PRIV(strncmp)(name, ng->name, length) == 0) return ng; + +return NULL; +} + + +/************************************************* +* Add an entry to the name/number table * +*************************************************/ + +/* This function is called between compiling passes to add an entry to the +name/number table, maintaining alphabetical order. Checking for permitted +and forbidden duplicates has already been done. + +Arguments: + cb the compile data block + nb named group entry + tablecount the count of names in the table so far + +Returns: new tablecount +*/ + +uint32_t +PRIV(compile_add_name_to_table)(compile_block *cb, + named_group *ng, uint32_t tablecount) +{ +uint32_t i; +PCRE2_SPTR name = ng->name; +int length = ng->length; +uint32_t duplicate_count = 1; + +PCRE2_UCHAR *slot = cb->name_table; + +PCRE2_ASSERT(length > 0); + +if ((ng->hash_dup & NAMED_GROUP_IS_DUPNAME) != 0) + { + named_group *ng_it; + named_group *end = cb->named_groups + cb->names_found; + + for (ng_it = ng + 1; ng_it < end; ng_it++) + if (ng_it->name == name) duplicate_count++; + } + +for (i = 0; i < tablecount; i++) + { + int crc = memcmp(name, slot + IMM2_SIZE, CU2BYTES(length)); + if (crc == 0 && slot[IMM2_SIZE + length] != 0) + crc = -1; /* Current name is a substring */ + + /* Make space in the table and break the loop for an earlier name. For a + duplicate or later name, carry on. We do this for duplicates so that in the + simple case (when ?(| is not used) they are in order of their numbers. In all + cases they are in the order in which they appear in the pattern. */ + + if (crc < 0) + { + (void)memmove(slot + cb->name_entry_size * duplicate_count, slot, + CU2BYTES((tablecount - i) * cb->name_entry_size)); + break; + } + + /* Continue the loop for a later or duplicate name */ + + slot += cb->name_entry_size; + } + +tablecount += duplicate_count; + +while (TRUE) + { + PUT2(slot, 0, ng->number); + memcpy(slot + IMM2_SIZE, name, CU2BYTES(length)); + + /* Add a terminating zero and fill the rest of the slot with zeroes so that + the memory is all initialized. Otherwise valgrind moans about uninitialized + memory when saving serialized compiled patterns. */ + + memset(slot + IMM2_SIZE + length, 0, + CU2BYTES(cb->name_entry_size - length - IMM2_SIZE)); + + if (--duplicate_count == 0) break; + + while (TRUE) + { + ++ng; + if (ng->name == name) break; + } + + slot += cb->name_entry_size; + } + +return tablecount; +} + + +/************************************************* +* Find details of duplicate group names * +*************************************************/ + +/* This is called from compile_branch() when it needs to know the index and +count of duplicates in the names table when processing named backreferences, +either directly, or as conditions. + +Arguments: + name points to the name + length the length of the name + indexptr where to put the index + countptr where to put the count of duplicates + errorcodeptr where to put an error code + cb the compile block + +Returns: TRUE if OK, FALSE if not, error code set +*/ + +BOOL +PRIV(compile_find_dupname_details)(PCRE2_SPTR name, uint32_t length, + int *indexptr, int *countptr, int *errorcodeptr, compile_block *cb) +{ +uint32_t i, groupnumber; +int count; +PCRE2_UCHAR *slot = cb->name_table; + +/* Find the first entry in the table */ + +for (i = 0; i < cb->names_found; i++) + { + if (PRIV(strncmp)(name, slot + IMM2_SIZE, length) == 0 && + slot[IMM2_SIZE + length] == 0) break; + slot += cb->name_entry_size; + } + +/* This should not occur, because this function is called only when we know we +have duplicate names. Give an internal error. */ + +/* LCOV_EXCL_START */ +if (i >= cb->names_found) + { + PCRE2_DEBUG_UNREACHABLE(); + *errorcodeptr = ERR53; + cb->erroroffset = name - cb->start_pattern; + return FALSE; + } +/* LCOV_EXCL_STOP */ + +/* Record the index and then see how many duplicates there are, updating the +backref map and maximum back reference as we do. */ + +*indexptr = i; +count = 0; + +for (;;) + { + count++; + groupnumber = GET2(slot, 0); + cb->backref_map |= (groupnumber < 32)? (1u << groupnumber) : 1; + if (groupnumber > cb->top_backref) cb->top_backref = groupnumber; + if (++i >= cb->names_found) break; + slot += cb->name_entry_size; + if (PRIV(strncmp)(name, slot + IMM2_SIZE, length) != 0 || + (slot + IMM2_SIZE)[length] != 0) break; + } + +*countptr = count; +return TRUE; +} + + +/* Process the capture list of scan substring and recurse +operations. Since at least one argument must be present, +a 0 return value represents error. */ + +static size_t +PRIV(compile_process_capture_list)(uint32_t *pptr, PCRE2_SIZE offset, + int *errorcodeptr, compile_block *cb) +{ +size_t i, size = 0; +named_group *ng; +PCRE2_SPTR name; +uint32_t length; +named_group *end = cb->named_groups + cb->names_found; + +while (TRUE) + { + ++pptr; + + switch (META_CODE(*pptr)) + { + case META_OFFSET: + GETPLUSOFFSET(offset, pptr); + continue; + + case META_CAPTURE_NAME: + offset += META_DATA(*pptr); + length = *(++pptr); + name = cb->start_pattern + offset; + + ng = PRIV(compile_find_named_group)(name, length, cb); + + if (ng == NULL) + { + *errorcodeptr = ERR15; + cb->erroroffset = offset; + return 0; + } + + if ((ng->hash_dup & NAMED_GROUP_IS_DUPNAME) == 0) + { + pptr[-1] = META_CAPTURE_NUMBER; + pptr[0] = ng->number; + size++; + continue; + } + + /* Remains only for duplicated names. */ + pptr[-1] = META_CAPTURE_NAME; + pptr[0] = (uint32_t)(ng - cb->named_groups); + size++; + name = ng->name; + + while (++ng < end) + if (ng->name == name) size++; + continue; + + case META_CAPTURE_NUMBER: + offset += META_DATA(*pptr); + + i = *(++pptr); + if (i > cb->bracount) + { + *errorcodeptr = ERR15; + cb->erroroffset = offset; + return 0; + } + if (i > cb->top_backref) cb->top_backref = (uint16_t)i; + size++; + continue; + + default: + break; + } + + PCRE2_ASSERT(size > 0); + return size; + } +} + + +/******************************************************* +* Parse the arguments of scan substring operations * +********************************************************/ + +/* This function parses the arguments of scan substring operations. + +Arguments: + pptr_start points to the current parsed pattern pointer + offset argument starting offset in the pattern + errorcodeptr where to put an error code + cb the compile block + lengthptr NULL during the real compile phase + points to length accumulator during pre-compile phase + +Returns: TRUE if OK, FALSE if not, error code set +*/ + +uint32_t * +PRIV(compile_parse_scan_substr_args)(uint32_t *pptr, + int *errorcodeptr, compile_block *cb, PCRE2_SIZE *lengthptr) +{ +uint8_t *captures; +uint8_t *capture_ptr; +uint8_t bit; +PCRE2_SPTR name; +named_group *ng; +named_group *end = cb->named_groups + cb->names_found; +BOOL all_found; +size_t size; + +PCRE2_ASSERT(*pptr == META_OFFSET); +if (PRIV(compile_process_capture_list)(pptr - 1, 0, errorcodeptr, cb) == 0) + return NULL; + +/* Align to bytes. Since the highest capture can +be equal to bracount, +1 is added before the aligning. */ +size = (cb->bracount + 1 + 7) >> 3; +captures = (uint8_t*)cb->cx->memctl.malloc(size, cb->cx->memctl.memory_data); +if (captures == NULL) + { + *errorcodeptr = ERR21; + READPLUSOFFSET(cb->erroroffset, pptr); + return NULL; + } + +memset(captures, 0, size); + +while (TRUE) + { + switch (META_CODE(*pptr)) + { + case META_OFFSET: + pptr++; + SKIPOFFSET(pptr); + continue; + + case META_CAPTURE_NAME: + ng = cb->named_groups + pptr[1]; + PCRE2_ASSERT((ng->hash_dup & NAMED_GROUP_IS_DUPNAME) != 0); + pptr += 2; + name = ng->name; + + all_found = TRUE; + do + { + if (ng->name != name) continue; + + capture_ptr = captures + (ng->number >> 3); + PCRE2_ASSERT(capture_ptr < captures + size); + bit = (uint8_t)(1 << (ng->number & 0x7)); + + if ((*capture_ptr & bit) == 0) + { + *capture_ptr |= bit; + all_found = FALSE; + } + } + while (++ng < end); + + if (!all_found) + { + *lengthptr += 1 + 2 * IMM2_SIZE; + continue; + } + + pptr[-2] = META_CAPTURE_NUMBER; + pptr[-1] = 0; + continue; + + case META_CAPTURE_NUMBER: + pptr += 2; + + capture_ptr = captures + (pptr[-1] >> 3); + PCRE2_ASSERT(capture_ptr < captures + size); + bit = (uint8_t)(1 << (pptr[-1] & 0x7)); + + if ((*capture_ptr & bit) != 0) + { + pptr[-1] = 0; + continue; + } + + *capture_ptr |= bit; + *lengthptr += 1 + IMM2_SIZE; + continue; + + default: + break; + } + + break; + } + +cb->cx->memctl.free(captures, cb->cx->memctl.memory_data); +return pptr - 1; +} + + +/* Implement heapsort heapify algorithm. */ + +static void do_heapify_u16(uint16_t *captures, size_t size, size_t i) +{ +size_t max; +size_t left; +size_t right; +uint16_t tmp; + +while (TRUE) + { + max = i; + left = (i << 1) + 1; + right = left + 1; + + if (left < size && captures[left] > captures[max]) max = left; + if (right < size && captures[right] > captures[max]) max = right; + if (i == max) return; + + tmp = captures[i]; + captures[i] = captures[max]; + captures[max] = tmp; + i = max; + } +} + + +/************************************************* +* Parse the arguments of recurse operations * +*************************************************/ + +/* This function parses the arguments of recurse operations. + +Arguments: + pptr_start the current parsed pattern pointer + offset argument starting offset in the pattern + errorcodeptr where to put an error code + cb the compile block + lengthptr NULL during the real compile phase + points to length accumulator during pre-compile phase + +Returns: TRUE if OK, FALSE if not, error code set +*/ + +BOOL +PRIV(compile_parse_recurse_args)(uint32_t *pptr_start, + PCRE2_SIZE offset, int *errorcodeptr, compile_block *cb) +{ +uint32_t *pptr = pptr_start; +size_t i, size; +PCRE2_SPTR name; +named_group *ng; +named_group *end = cb->named_groups + cb->names_found; +recurse_arguments *args; +uint16_t *captures; +uint16_t *current; +uint16_t *captures_end; +uint16_t tmp; + +/* Process all arguments, compute the required size. */ + +size = PRIV(compile_process_capture_list)(pptr, offset, errorcodeptr, cb); +if (size == 0) return FALSE; + +args = cb->cx->memctl.malloc( + sizeof(recurse_arguments) + size * sizeof(uint16_t), cb->cx->memctl.memory_data); + +if (args == NULL) + { + *errorcodeptr = ERR21; + cb->erroroffset = offset; + return FALSE; + } + +args->header.next = NULL; +#ifdef PCRE2_DEBUG +args->header.type = CDATA_RECURSE_ARGS; +#endif +args->size = size; + +/* Caching the pre-processed capture list. */ +if (cb->last_data != NULL) + cb->last_data->next = &args->header; +else + cb->first_data = &args->header; + +cb->last_data = &args->header; + +/* Create the capture list size. */ + +captures = (uint16_t*)(args + 1); + +while (TRUE) + { + ++pptr; + + switch (META_CODE(*pptr)) + { + case META_OFFSET: + SKIPOFFSET(pptr); + continue; + + case META_CAPTURE_NAME: + ng = cb->named_groups + *(++pptr); + PCRE2_ASSERT((ng->hash_dup & NAMED_GROUP_IS_DUPNAME) != 0); + *captures++ = (uint16_t)(ng->number); + + name = ng->name; + + while (++ng < end) + if (ng->name == name) *captures++ = (uint16_t)(ng->number); + continue; + + case META_CAPTURE_NUMBER: + *captures++ = *(++pptr); + continue; + + default: + break; + } + + break; + } + +PCRE2_ASSERT(size == (size_t)(captures - (uint16_t*)(args + 1))); +args->skip_size = (size_t)(pptr - pptr_start) - 1; + +if (size == 1) return TRUE; + +/* Sort captures. */ + +captures = (uint16_t*)(args + 1); +i = (size >> 1) - 1; +while (TRUE) + { + do_heapify_u16(captures, size, i); + if (i == 0) break; + i--; + } + +for (i = size - 1; i > 0; i--) + { + tmp = captures[0]; + captures[0] = captures[i]; + captures[i] = tmp; + + do_heapify_u16(captures, i, 0); + } + +/* Remove duplicates. */ + +captures_end = captures + size; +tmp = *captures++; +current = captures; + +while (current < captures_end) + { + if (*current != tmp) + { + tmp = *current; + *captures++ = tmp; + } + + current++; + } + +args->size = (size_t)(captures - (uint16_t*)(args + 1)); +return TRUE; +} + +/* End of pcre2_compile_cgroup.c */ diff --git a/std/regex/pcre2/pcre2_compile_class.c b/std/regex/pcre2/pcre2_compile_class.c new file mode 100644 index 000000000..c06066436 --- /dev/null +++ b/std/regex/pcre2/pcre2_compile_class.c @@ -0,0 +1,2779 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE 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. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge + +----------------------------------------------------------------------------- +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 its + 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. +----------------------------------------------------------------------------- +*/ + + +#include "pcre2_compile.h" + + + +typedef struct { + /* Option bits for eclass. */ + uint32_t options; + uint32_t xoptions; + /* Rarely used members. */ + int *errorcodeptr; + compile_block *cb; + /* Bitmap is needed. */ + BOOL needs_bitmap; +} eclass_context; + +/* Checks the allowed tokens at the end of a class structure in debug mode. +When a new token is not processed by all loops, and the token is equals to +a) one of the cases here: + the compiler will complain about a duplicated case value. +b) none of the cases here: + the loop without the handler will stop with an assertion failure. */ + +#ifdef PCRE2_DEBUG +#define CLASS_END_CASES(meta) \ + default: \ + PCRE2_ASSERT((meta) <= META_END); \ + PCRE2_FALLTHROUGH /* Fall through */ \ + case META_CLASS: \ + case META_CLASS_NOT: \ + case META_CLASS_EMPTY: \ + case META_CLASS_EMPTY_NOT: \ + case META_CLASS_END: \ + case META_ECLASS_AND: \ + case META_ECLASS_OR: \ + case META_ECLASS_SUB: \ + case META_ECLASS_XOR: \ + case META_ECLASS_NOT: +#else +#define CLASS_END_CASES(meta) \ + default: +#endif + +#ifdef SUPPORT_WIDE_CHARS + +/* Heapsort algorithm. */ + +static void do_heapify(uint32_t *buffer, size_t size, size_t i) +{ +size_t max; +size_t left; +size_t right; +uint32_t tmp1, tmp2; + +while (TRUE) + { + max = i; + left = (i << 1) + 2; + right = left + 2; + + if (left < size && buffer[left] > buffer[max]) max = left; + if (right < size && buffer[right] > buffer[max]) max = right; + if (i == max) return; + + /* Swap items. */ + tmp1 = buffer[i]; + tmp2 = buffer[i + 1]; + buffer[i] = buffer[max]; + buffer[i + 1] = buffer[max + 1]; + buffer[max] = tmp1; + buffer[max + 1] = tmp2; + i = max; + } +} + +#ifdef SUPPORT_UNICODE + +#define PARSE_CLASS_UTF 0x1 +#define PARSE_CLASS_CASELESS_UTF 0x2 +#define PARSE_CLASS_RESTRICTED_UTF 0x4 +#define PARSE_CLASS_TURKISH_UTF 0x8 + +/* Get the range of nocase characters which includes the +'c' character passed as argument, or directly follows 'c'. */ + +static const uint32_t* +get_nocase_range(uint32_t c) +{ +uint32_t left = 0; +uint32_t right = PRIV(ucd_nocase_ranges_size); +uint32_t middle; + +if (c > MAX_UTF_CODE_POINT) return PRIV(ucd_nocase_ranges) + right; + +while (TRUE) + { + /* Range end of the middle element. */ + middle = ((left + right) >> 1) | 0x1; + + if (PRIV(ucd_nocase_ranges)[middle] <= c) + left = middle + 1; + else if (middle > 1 && PRIV(ucd_nocase_ranges)[middle - 2] > c) + right = middle - 1; + else + return PRIV(ucd_nocase_ranges) + (middle - 1); + } +} + +/* Get the list of othercase characters, which belongs to the passed range. +Create ranges from these characters, and append them to the buffer argument. */ + +static size_t +utf_caseless_extend(uint32_t start, uint32_t end, uint32_t options, + uint32_t *buffer) +{ +uint32_t new_start = start; +uint32_t new_end = end; +uint32_t c = start; +const uint32_t *list; +uint32_t tmp[3]; +size_t result = 2; +const uint32_t *skip_range = get_nocase_range(c); +uint32_t skip_start = skip_range[0]; + +#if PCRE2_CODE_UNIT_WIDTH == 8 +PCRE2_ASSERT(options & PARSE_CLASS_UTF); +#endif + +#if PCRE2_CODE_UNIT_WIDTH == 32 +if (end > MAX_UTF_CODE_POINT) end = MAX_UTF_CODE_POINT; +#endif + +while (c <= end) + { + uint32_t co; + + if (c > skip_start) + { + c = skip_range[1]; + skip_range += 2; + skip_start = skip_range[0]; + continue; + } + + /* Compute caseless set. */ + + if ((options & (PARSE_CLASS_TURKISH_UTF|PARSE_CLASS_RESTRICTED_UTF)) == + PARSE_CLASS_TURKISH_UTF && + UCD_ANY_I(c)) + { + co = PRIV(ucd_turkish_dotted_i_caseset) + (UCD_DOTTED_I(c)? 0 : 3); + } + else if ((co = UCD_CASESET(c)) != 0 && + (options & PARSE_CLASS_RESTRICTED_UTF) != 0 && + PRIV(ucd_caseless_sets)[co] < 128) + { + co = 0; /* Ignore the caseless set if it's restricted. */ + } + + if (co != 0) + list = PRIV(ucd_caseless_sets) + co; + else + { + co = UCD_OTHERCASE(c); + list = tmp; + tmp[0] = c; + tmp[1] = NOTACHAR; + + if (co != c) + { + tmp[1] = co; + tmp[2] = NOTACHAR; + } + } + c++; + + /* Add characters. */ + do + { +#if PCRE2_CODE_UNIT_WIDTH == 16 + if (!(options & PARSE_CLASS_UTF) && *list > 0xffff) continue; +#endif + + if (*list < new_start) + { + if (*list + 1 == new_start) + { + new_start--; + continue; + } + } + else if (*list > new_end) + { + if (*list - 1 == new_end) + { + new_end++; + continue; + } + } + else continue; + + result += 2; + if (buffer != NULL) + { + buffer[0] = *list; + buffer[1] = *list; + buffer += 2; + } + } + while (*(++list) != NOTACHAR); + } + + if (buffer != NULL) + { + buffer[0] = new_start; + buffer[1] = new_end; + buffer += 2; + (void)buffer; + } + return result; +} + +#endif + +/* Add a character list to a buffer. */ + +static size_t +append_char_list(const uint32_t *p, uint32_t *buffer) +{ +const uint32_t *n; +size_t result = 0; + +while (*p != NOTACHAR) + { + n = p; + while (n[0] == n[1] - 1) n++; + + PCRE2_ASSERT(*p < 0xffff); + + if (buffer != NULL) + { + buffer[0] = *p; + buffer[1] = *n; + buffer += 2; + } + + result += 2; + p = n + 1; + } + + return result; +} + +static uint32_t +get_highest_char(uint32_t options) +{ +(void)options; /* Avoid compiler warning. */ + +#if PCRE2_CODE_UNIT_WIDTH == 8 +return MAX_UTF_CODE_POINT; +#else +#ifdef SUPPORT_UNICODE +return GET_MAX_CHAR_VALUE((options & PARSE_CLASS_UTF) != 0); +#else +return MAX_UCHAR_VALUE; +#endif +#endif +} + +/* Add a negated character list to a buffer. */ +static size_t +append_negated_char_list(const uint32_t *p, uint32_t options, uint32_t *buffer) +{ +const uint32_t *n; +uint32_t start = 0; +size_t result = 2; + +PCRE2_ASSERT(*p > 0); + +while (*p != NOTACHAR) + { + n = p; + while (n[0] == n[1] - 1) n++; + + PCRE2_ASSERT(*p < 0xffff); + + if (buffer != NULL) + { + buffer[0] = start; + buffer[1] = *p - 1; + buffer += 2; + } + + result += 2; + start = *n + 1; + p = n + 1; + } + + if (buffer != NULL) + { + buffer[0] = start; + buffer[1] = get_highest_char(options); + buffer += 2; + (void)buffer; + } + + return result; +} + +static uint32_t * +append_non_ascii_range(uint32_t options, uint32_t *buffer) +{ + if (buffer == NULL) return NULL; + + buffer[0] = 0x100; + buffer[1] = get_highest_char(options); + return buffer + 2; +} + +static size_t +parse_class(uint32_t *ptr, uint32_t options, uint32_t *buffer) +{ +size_t total_size = 0; +size_t size; +uint32_t meta_arg; +uint32_t start_char; + +while (TRUE) + { + switch (META_CODE(*ptr)) + { + case META_ESCAPE: + meta_arg = META_DATA(*ptr); + switch (meta_arg) + { + case ESC_D: + case ESC_W: + case ESC_S: + buffer = append_non_ascii_range(options, buffer); + total_size += 2; + break; + + case ESC_h: + size = append_char_list(PRIV(hspace_list), buffer); + total_size += size; + if (buffer != NULL) buffer += size; + break; + + case ESC_H: + size = append_negated_char_list(PRIV(hspace_list), options, buffer); + total_size += size; + if (buffer != NULL) buffer += size; + break; + + case ESC_v: + size = append_char_list(PRIV(vspace_list), buffer); + total_size += size; + if (buffer != NULL) buffer += size; + break; + + case ESC_V: + size = append_negated_char_list(PRIV(vspace_list), options, buffer); + total_size += size; + if (buffer != NULL) buffer += size; + break; + + case ESC_p: + case ESC_P: + ptr++; + if (meta_arg == ESC_p && (*ptr >> 16) == PT_ANY) + { + if (buffer != NULL) + { + buffer[0] = 0; + buffer[1] = get_highest_char(options); + buffer += 2; + } + total_size += 2; + } + break; + } + ptr++; + continue; + case META_POSIX_NEG: + buffer = append_non_ascii_range(options, buffer); + total_size += 2; + ptr += 2; + continue; + case META_POSIX: + ptr += 2; + continue; + case META_BIGVALUE: + /* Character literal */ + ptr++; + break; + CLASS_END_CASES(*ptr) + if (*ptr >= META_END) return total_size; + break; + } + + start_char = *ptr; + + if (ptr[1] == META_RANGE_LITERAL || ptr[1] == META_RANGE_ESCAPED) + { + ptr += 2; + PCRE2_ASSERT(*ptr < META_END || *ptr == META_BIGVALUE); + + if (*ptr == META_BIGVALUE) ptr++; + +#ifdef EBCDIC +#error "Missing EBCDIC support" +#endif + } + +#ifdef SUPPORT_UNICODE + if (options & PARSE_CLASS_CASELESS_UTF) + { + size = utf_caseless_extend(start_char, *ptr++, options, buffer); + if (buffer != NULL) buffer += size; + total_size += size; + continue; + } +#endif + + if (buffer != NULL) + { + buffer[0] = start_char; + buffer[1] = *ptr; + buffer += 2; + } + + ptr++; + total_size += 2; + } + + return total_size; +} + +/* Extra uint32_t values for storing the lengths of range lists in +the worst case. Two uint32_t lengths and a range end for a range +starting before 255 */ +#define CHAR_LIST_EXTRA_SIZE 3 + +/* Starting character values for each character list. */ + +static const uint32_t char_list_starts[] = { +#if PCRE2_CODE_UNIT_WIDTH == 32 + XCL_CHAR_LIST_HIGH_32_START, +#endif +#if PCRE2_CODE_UNIT_WIDTH == 32 || defined SUPPORT_UNICODE + XCL_CHAR_LIST_LOW_32_START, +#endif + XCL_CHAR_LIST_HIGH_16_START, + /* Must be terminated by XCL_CHAR_LIST_LOW_16_START, + which also represents the end of the bitset. */ + XCL_CHAR_LIST_LOW_16_START, +}; + +static class_ranges * +compile_optimize_class(uint32_t *start_ptr, uint32_t options, + uint32_t xoptions, int *errorcodeptr, compile_block *cb) +{ +class_ranges* cranges; +uint32_t *ptr; +uint32_t *buffer; +uint32_t *dst; +uint32_t class_options = 0; +size_t range_list_size = 0, total_size, i; +uint32_t tmp1, tmp2; +const uint32_t *char_list_next; +uint16_t *next_char; +uint32_t char_list_start, char_list_end; +uint32_t range_start, range_end; + +#ifdef SUPPORT_UNICODE +if (options & PCRE2_UTF) + class_options |= PARSE_CLASS_UTF; + +if ((options & PCRE2_CASELESS) && (options & (PCRE2_UTF|PCRE2_UCP))) + class_options |= PARSE_CLASS_CASELESS_UTF; + +if (xoptions & PCRE2_EXTRA_CASELESS_RESTRICT) + class_options |= PARSE_CLASS_RESTRICTED_UTF; + +if (xoptions & PCRE2_EXTRA_TURKISH_CASING) + class_options |= PARSE_CLASS_TURKISH_UTF; +#else +(void)options; /* Avoid compiler warning. */ +(void)xoptions; /* Avoid compiler warning. */ +#endif + +/* Compute required space for the range. */ + +range_list_size = parse_class(start_ptr, class_options, NULL); +PCRE2_ASSERT((range_list_size & 0x1) == 0); + +/* Allocate buffer. The total_size also represents the end of the buffer. */ + +total_size = range_list_size + + ((range_list_size >= 2) ? CHAR_LIST_EXTRA_SIZE : 0); +if (total_size > (PCRE2_SIZE_MAX - sizeof(class_ranges)) / sizeof(uint32_t)) + { + *errorcodeptr = ERR20; + cb->erroroffset = 0; + return NULL; + } + +cranges = cb->cx->memctl.malloc( + sizeof(class_ranges) + total_size * sizeof(uint32_t), + cb->cx->memctl.memory_data); + +if (cranges == NULL) + { + *errorcodeptr = ERR21; + cb->erroroffset = 0; + return NULL; + } + +cranges->header.next = NULL; +#ifdef PCRE2_DEBUG +cranges->header.type = CDATA_CRANGE; +#endif +cranges->range_list_size = (uint16_t)range_list_size; +cranges->char_lists_types = 0; +cranges->char_lists_size = 0; +cranges->char_lists_start = 0; + +if (range_list_size == 0) return cranges; + +buffer = (uint32_t*)(cranges + 1); +parse_class(start_ptr, class_options, buffer); + +/* Using <= instead of == to help static analysis. */ +if (range_list_size <= 2) return cranges; + +/* In-place sorting of ranges. */ + +i = (((range_list_size >> 2) - 1) << 1); +while (TRUE) + { + do_heapify(buffer, range_list_size, i); + if (i == 0) break; + i -= 2; + } + +i = range_list_size - 2; +while (TRUE) + { + tmp1 = buffer[i]; + tmp2 = buffer[i + 1]; + buffer[i] = buffer[0]; + buffer[i + 1] = buffer[1]; + buffer[0] = tmp1; + buffer[1] = tmp2; + + do_heapify(buffer, i, 0); + if (i == 0) break; + i -= 2; + } + +/* Merge ranges whenever possible. */ +dst = buffer; +ptr = buffer + 2; +range_list_size -= 2; + +/* The second condition is a very rare corner case, where the end of the last +range is the maximum character. This range cannot be extended further. */ + +while (range_list_size > 0 && dst[1] != ~(uint32_t)0) + { + if (dst[1] + 1 < ptr[0]) + { + dst += 2; + dst[0] = ptr[0]; + dst[1] = ptr[1]; + } + else if (dst[1] < ptr[1]) dst[1] = ptr[1]; + + ptr += 2; + range_list_size -= 2; + } + +PCRE2_ASSERT(dst[1] <= get_highest_char(class_options)); + +/* When the number of ranges are less than six, +they are not converted to range lists. */ + +ptr = buffer; +while (ptr < dst && ptr[1] < 0x100) ptr += 2; +if (dst - ptr < (2 * (6 - 1))) + { + cranges->range_list_size = (uint16_t)(dst + 2 - buffer); + return cranges; + } + +/* Compute character lists structures. */ + +char_list_next = char_list_starts; +char_list_start = *char_list_next++; +#if PCRE2_CODE_UNIT_WIDTH == 32 +char_list_end = XCL_CHAR_LIST_HIGH_32_END; +#elif defined SUPPORT_UNICODE +char_list_end = XCL_CHAR_LIST_LOW_32_END; +#else +char_list_end = XCL_CHAR_LIST_HIGH_16_END; +#endif +next_char = (uint16_t*)(buffer + total_size); + +tmp1 = 0; +tmp2 = ((sizeof(char_list_starts) / sizeof(uint32_t)) - 1) * XCL_TYPE_BIT_LEN; +PCRE2_ASSERT(tmp2 <= 3 * XCL_TYPE_BIT_LEN && tmp2 >= XCL_TYPE_BIT_LEN); +range_start = dst[0]; +range_end = dst[1]; + +while (TRUE) + { + if (range_start >= char_list_start) + { + if (range_start == range_end || range_end < char_list_end) + { + tmp1++; + next_char--; + + if (char_list_start < XCL_CHAR_LIST_LOW_32_START) + *next_char = (uint16_t)((range_end << XCL_CHAR_SHIFT) | XCL_CHAR_END); + else + *(uint32_t*)(--next_char) = + (range_end << XCL_CHAR_SHIFT) | XCL_CHAR_END; + } + + if (range_start < range_end) + { + if (range_start > char_list_start) + { + tmp1++; + next_char--; + + if (char_list_start < XCL_CHAR_LIST_LOW_32_START) + *next_char = (uint16_t)(range_start << XCL_CHAR_SHIFT); + else + *(uint32_t*)(--next_char) = (range_start << XCL_CHAR_SHIFT); + } + else + cranges->char_lists_types |= XCL_BEGIN_WITH_RANGE << tmp2; + } + + PCRE2_ASSERT((uint32_t*)next_char >= dst + 2); + + if (dst > buffer) + { + dst -= 2; + range_start = dst[0]; + range_end = dst[1]; + continue; + } + + range_start = 0; + range_end = 0; + } + + if (range_end >= char_list_start) + { + PCRE2_ASSERT(range_start < char_list_start); + + if (range_end < char_list_end) + { + tmp1++; + next_char--; + + if (char_list_start < XCL_CHAR_LIST_LOW_32_START) + *next_char = (uint16_t)((range_end << XCL_CHAR_SHIFT) | XCL_CHAR_END); + else + *(uint32_t*)(--next_char) = + (range_end << XCL_CHAR_SHIFT) | XCL_CHAR_END; + + PCRE2_ASSERT((uint32_t*)next_char >= dst + 2); + } + + cranges->char_lists_types |= XCL_BEGIN_WITH_RANGE << tmp2; + } + + if (tmp1 >= XCL_ITEM_COUNT_MASK) + { + cranges->char_lists_types |= XCL_ITEM_COUNT_MASK << tmp2; + next_char--; + + if (char_list_start < XCL_CHAR_LIST_LOW_32_START) + *next_char = (uint16_t)tmp1; + else + *(uint32_t*)(--next_char) = tmp1; + } + else + cranges->char_lists_types |= tmp1 << tmp2; + + if (range_end < XCL_CHAR_LIST_LOW_16_START || tmp2 == 0) + { + PCRE2_ASSERT(range_start < XCL_CHAR_LIST_LOW_16_START); + break; + } + + PCRE2_ASSERT((tmp2 % XCL_TYPE_BIT_LEN) == 0); + char_list_end = char_list_start - 1; + char_list_start = *char_list_next++; + tmp1 = 0; + tmp2 -= XCL_TYPE_BIT_LEN; + } + +if (dst[0] < XCL_CHAR_LIST_LOW_16_START) dst += 2; +PCRE2_ASSERT((uint16_t*)dst <= next_char); + +cranges->char_lists_size = + (size_t)((uint8_t*)(buffer + total_size) - (uint8_t*)next_char); +cranges->char_lists_start = (size_t)((uint8_t*)next_char - (uint8_t*)buffer); +cranges->range_list_size = (uint16_t)(dst - buffer); +return cranges; +} + +#endif /* SUPPORT_WIDE_CHARS */ + +#ifdef SUPPORT_UNICODE + +void PRIV(update_classbits)(uint32_t ptype, uint32_t pdata, BOOL negated, + uint8_t *classbits) +{ +/* Update PRIV(xclass) when this function is changed. */ +int c, chartype; +const ucd_record *prop; +uint32_t gentype; +BOOL set_bit; + +if (ptype == PT_ANY) + { + if (!negated) memset(classbits, 0xff, 32); + return; + } + +for (c = 0; c < 256; c++) + { + prop = GET_UCD(c); + set_bit = FALSE; + (void)set_bit; + + switch (ptype) + { + case PT_LAMP: + chartype = prop->chartype; + set_bit = (chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt); + break; + + case PT_GC: + set_bit = (PRIV(ucp_gentype)[prop->chartype] == pdata); + break; + + case PT_PC: + set_bit = (prop->chartype == pdata); + break; + + case PT_SC: + set_bit = (prop->script == pdata); + break; + + case PT_SCX: + set_bit = (prop->script == pdata || + MAPBIT(PRIV(ucd_script_sets) + UCD_SCRIPTX_PROP(prop), pdata) != 0); + break; + + case PT_ALNUM: + gentype = PRIV(ucp_gentype)[prop->chartype]; + set_bit = (gentype == ucp_L || gentype == ucp_N); + break; + + case PT_SPACE: /* Perl space */ + case PT_PXSPACE: /* POSIX space */ + switch(c) + { + HSPACE_BYTE_CASES: + VSPACE_BYTE_CASES: + set_bit = TRUE; + break; + + default: + set_bit = (PRIV(ucp_gentype)[prop->chartype] == ucp_Z); + break; + } + break; + + case PT_WORD: + chartype = prop->chartype; + gentype = PRIV(ucp_gentype)[chartype]; + set_bit = (gentype == ucp_L || gentype == ucp_N || + chartype == ucp_Mn || chartype == ucp_Pc); + break; + + case PT_UCNC: + set_bit = (c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT || + c == CHAR_GRAVE_ACCENT || c >= 0xa0); + break; + + case PT_BIDICL: + set_bit = (UCD_BIDICLASS_PROP(prop) == pdata); + break; + + case PT_BOOL: + set_bit = MAPBIT(PRIV(ucd_boolprop_sets) + + UCD_BPROPS_PROP(prop), pdata) != 0; + break; + + case PT_PXGRAPH: + chartype = prop->chartype; + gentype = PRIV(ucp_gentype)[chartype]; + set_bit = (gentype != ucp_Z && (gentype != ucp_C || chartype == ucp_Cf)); + break; + + case PT_PXPRINT: + chartype = prop->chartype; + set_bit = (chartype != ucp_Zl && chartype != ucp_Zp && + (PRIV(ucp_gentype)[chartype] != ucp_C || chartype == ucp_Cf)); + break; + + case PT_PXPUNCT: + gentype = PRIV(ucp_gentype)[prop->chartype]; + set_bit = (gentype == ucp_P || (c < 128 && gentype == ucp_S)); + break; + + default: + PCRE2_ASSERT(ptype == PT_PXXDIGIT); + set_bit = (c >= CHAR_0 && c <= CHAR_9) || + (c >= CHAR_A && c <= CHAR_F) || + (c >= CHAR_a && c <= CHAR_f); + break; + } + + if (negated) set_bit = !set_bit; + if (set_bit) *classbits |= (uint8_t)(1 << (c & 0x7)); + if ((c & 0x7) == 0x7) classbits++; + } +} + +#endif /* SUPPORT_UNICODE */ + + + +#ifdef SUPPORT_WIDE_CHARS + +/************************************************* +* XClass related properties * +*************************************************/ + +/* XClass needs to be generated. */ +#define XCLASS_REQUIRED 0x1 +/* XClass has 8 bit character. */ +#define XCLASS_HAS_8BIT_CHARS 0x2 +/* XClass has properties. */ +#define XCLASS_HAS_PROPS 0x4 +/* XClass has character lists. */ +#define XCLASS_HAS_CHAR_LISTS 0x8 +/* XClass matches to all >= 256 characters. */ +#define XCLASS_HIGH_ANY 0x10 + +#endif + + +/************************************************* +* Internal entry point for add range to class * +*************************************************/ + +/* This function sets the overall range for characters < 256. +It also handles non-utf case folding. + +Arguments: + options the options bits + xoptions the extra options bits + cb compile data + start start of range character + end end of range character + +Returns: cb->classbits is updated +*/ + +static void +add_to_class(uint32_t options, uint32_t xoptions, compile_block *cb, + uint32_t start, uint32_t end) +{ +uint8_t *classbits = cb->classbits.classbits; +uint32_t c, byte_start, byte_end; +uint32_t classbits_end = (end <= 0xff ? end : 0xff); + +#ifndef SUPPORT_UNICODE +(void)xoptions; /* Avoid compiler warning. */ +#endif + +/* If caseless matching is required, scan the range and process alternate +cases. In Unicode, there are 8-bit characters that have alternate cases that +are greater than 255 and vice-versa (though these may be ignored if caseless +restriction is in force). Sometimes we can just extend the original range. */ + +if ((options & PCRE2_CASELESS) != 0) + { +#ifdef SUPPORT_UNICODE + /* UTF mode. This branch is taken if we don't support wide characters (e.g. + 8-bit library, without UTF), but we do treat those characters as Unicode + (if UCP flag is set). In this case, we only need to expand the character class + set to include the case pairs which are in the 0-255 codepoint range. */ + if ((options & (PCRE2_UTF|PCRE2_UCP)) != 0) + { + BOOL turkish_i = (xoptions & (PCRE2_EXTRA_TURKISH_CASING|PCRE2_EXTRA_CASELESS_RESTRICT)) == + PCRE2_EXTRA_TURKISH_CASING; + if (start < 128) + { + uint32_t lo_end = (classbits_end < 127 ? classbits_end : 127); + for (c = start; c <= lo_end; c++) + { + if (turkish_i && UCD_ANY_I(c)) continue; + SETBIT(classbits, cb->fcc[c]); + } + } + if (classbits_end >= 128) + { + uint32_t hi_start = (start > 128 ? start : 128); + for (c = hi_start; c <= classbits_end; c++) + { + uint32_t co = UCD_OTHERCASE(c); + if (co <= 0xff) SETBIT(classbits, co); + } + } + } + + else +#endif /* SUPPORT_UNICODE */ + + /* Not UTF mode */ + { + for (c = start; c <= classbits_end; c++) + SETBIT(classbits, cb->fcc[c]); + } + } + +/* Use the bitmap for characters < 256. Otherwise use extra data. */ + +byte_start = (start + 7) >> 3; +byte_end = (classbits_end + 1) >> 3; + +if (byte_start >= byte_end) + { + for (c = start; c <= classbits_end; c++) + /* Regardless of start, c will always be <= 255. */ + SETBIT(classbits, c); + return; + } + +for (c = byte_start; c < byte_end; c++) + classbits[c] = 0xff; + +byte_start <<= 3; +byte_end <<= 3; + +for (c = start; c < byte_start; c++) + SETBIT(classbits, c); + +for (c = byte_end; c <= classbits_end; c++) + SETBIT(classbits, c); +} + + +#if PCRE2_CODE_UNIT_WIDTH == 8 +/************************************************* +* Internal entry point for add list to class * +*************************************************/ + +/* This function is used for adding a list of horizontal or vertical whitespace +characters to a class. The list must be in order so that ranges of characters +can be detected and handled appropriately. This function sets the overall range +so that the internal functions can try to avoid duplication when handling +case-independence. + +Arguments: + options the options bits + xoptions the extra options bits + cb contains pointers to tables etc. + p points to row of 32-bit values, terminated by NOTACHAR + +Returns: cb->classbits is updated +*/ + +static void +add_list_to_class(uint32_t options, uint32_t xoptions, compile_block *cb, + const uint32_t *p) +{ +while (p[0] < 256) + { + unsigned int n = 0; + + while(p[n+1] == p[0] + n + 1) n++; + add_to_class(options, xoptions, cb, p[0], p[n]); + + p += n + 1; + } +} + + + +/************************************************* +* Add characters not in a list to a class * +*************************************************/ + +/* This function is used for adding the complement of a list of horizontal or +vertical whitespace to a class. The list must be in order. + +Arguments: + options the options bits + xoptions the extra options bits + cb contains pointers to tables etc. + p points to row of 32-bit values, terminated by NOTACHAR + +Returns: cb->classbits is updated +*/ + +static void +add_not_list_to_class(uint32_t options, uint32_t xoptions, compile_block *cb, + const uint32_t *p) +{ +if (p[0] > 0) + add_to_class(options, xoptions, cb, 0, p[0] - 1); +while (p[0] < 256) + { + while (p[1] == p[0] + 1) p++; + add_to_class(options, xoptions, cb, p[0] + 1, (p[1] > 255) ? 255 : p[1] - 1); + p++; + } +} +#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ + + + +/************************************************* +* Main entry-point to compile a character class * +*************************************************/ + +/* This function consumes a "leaf", which is a set of characters that will +become a single OP_CLASS OP_NCLASS, OP_XCLASS, or OP_ALLANY. */ + +uint32_t * +PRIV(compile_class_not_nested)(uint32_t options, uint32_t xoptions, + uint32_t *start_ptr, PCRE2_UCHAR **pcode, BOOL negate_class, BOOL* has_bitmap, + int *errorcodeptr, compile_block *cb, PCRE2_SIZE *lengthptr) +{ +uint32_t *pptr = start_ptr; +PCRE2_UCHAR *code = *pcode; +BOOL should_flip_negation; +const uint8_t *cbits = cb->cbits; +/* Some functions such as add_to_class() or eclass processing +expects that the bitset is stored in cb->classbits.classbits. */ +uint8_t *const classbits = cb->classbits.classbits; + +#ifdef SUPPORT_UNICODE +BOOL utf = (options & PCRE2_UTF) != 0; +#else /* No Unicode support */ +BOOL utf = FALSE; +#endif + +/* Helper variables for OP_XCLASS opcode (for characters > 255). */ + +#ifdef SUPPORT_WIDE_CHARS +uint32_t xclass_props; +PCRE2_UCHAR *class_uchardata; +class_ranges* cranges; +#else +(void)has_bitmap; /* Avoid compiler warning. */ +(void)errorcodeptr; /* Avoid compiler warning. */ +(void)lengthptr; /* Avoid compiler warning. */ +#endif + +/* If an XClass contains a negative special such as \S, we need to flip the +negation flag at the end, so that support for characters > 255 works correctly +(they are all included in the class). An XClass may need to insert specific +matching or non-matching code for wide characters. +*/ + +should_flip_negation = FALSE; + +/* XClass will be used when characters > 255 might match. */ + +#ifdef SUPPORT_WIDE_CHARS +xclass_props = 0; + +#if PCRE2_CODE_UNIT_WIDTH == 8 +cranges = NULL; + +if (utf) +#endif + { + if (lengthptr != NULL) + { + cranges = compile_optimize_class(pptr, options, xoptions, errorcodeptr, cb); + + if (cranges == NULL) + return NULL; + + /* Caching the pre-processed character ranges. */ + if (cb->last_data != NULL) + cb->last_data->next = &cranges->header; + else + cb->first_data = &cranges->header; + + cb->last_data = &cranges->header; + } + else + { + /* Reuse the pre-processed character ranges. */ + cranges = (class_ranges*)cb->first_data; + PCRE2_ASSERT(cranges != NULL && cranges->header.type == CDATA_CRANGE); + cb->first_data = cranges->header.next; + } + + if (cranges->range_list_size > 0) + { + const uint32_t *ranges = (const uint32_t*)(cranges + 1); + + if (ranges[0] <= 255) + xclass_props |= XCLASS_HAS_8BIT_CHARS; + + if (ranges[cranges->range_list_size - 1] == GET_MAX_CHAR_VALUE(utf) && + ranges[cranges->range_list_size - 2] <= 256) + xclass_props |= XCLASS_HIGH_ANY; + } + } + +class_uchardata = code + LINK_SIZE + 2; /* For XCLASS items */ +#endif /* SUPPORT_WIDE_CHARS */ + +/* Initialize the 256-bit (32-byte) bit map to all zeros. We build the map +in a temporary bit of memory, in case the class contains fewer than two +8-bit characters because in that case the compiled code doesn't use the bit +map. */ + +memset(classbits, 0, 32); + +/* Process items until end_ptr is reached. */ + +while (TRUE) + { + uint32_t meta = *(pptr++); + BOOL local_negate; + int posix_class; + int taboffset, tabopt; + class_bits_storage pbits; + uint32_t escape, c; + + /* Handle POSIX classes such as [:alpha:] etc. */ + switch (META_CODE(meta)) + { + case META_POSIX: + case META_POSIX_NEG: + + local_negate = (meta == META_POSIX_NEG); + posix_class = *(pptr++); + + if (local_negate) should_flip_negation = TRUE; /* Note negative special */ + + /* If matching is caseless, upper and lower are converted to alpha. + This relies on the fact that the class table starts with alpha, + lower, upper as the first 3 entries. */ + + if ((options & PCRE2_CASELESS) != 0 && posix_class <= 2) + posix_class = 0; + + /* When PCRE2_UCP is set, some of the POSIX classes are converted to + different escape sequences that use Unicode properties \p or \P. + Others that are not available via \p or \P have to generate + XCL_PROP/XCL_NOTPROP directly, which is done here. */ + +#ifdef SUPPORT_UNICODE + /* TODO This entire block of code here appears to be unreachable!? I simply + can't see how it can be hit, given that the frontend parser doesn't emit + META_POSIX for GRAPH/PRINT/PUNCT when UCP is set. */ + if ((options & PCRE2_UCP) != 0 && + (xoptions & PCRE2_EXTRA_ASCII_POSIX) == 0) + { + uint32_t ptype; + + switch(posix_class) + { + case PC_GRAPH: + case PC_PRINT: + case PC_PUNCT: + ptype = (posix_class == PC_GRAPH)? PT_PXGRAPH : + (posix_class == PC_PRINT)? PT_PXPRINT : PT_PXPUNCT; + + PRIV(update_classbits)(ptype, 0, local_negate, classbits); + + if ((xclass_props & XCLASS_HIGH_ANY) == 0) + { + if (lengthptr != NULL) + *lengthptr += 3; + else + { + *class_uchardata++ = local_negate? XCL_NOTPROP : XCL_PROP; + *class_uchardata++ = (PCRE2_UCHAR)ptype; + *class_uchardata++ = 0; + } + xclass_props |= XCLASS_REQUIRED | XCLASS_HAS_PROPS; + } + continue; + + /* For the other POSIX classes (ex: ascii) we are going to + fall through to the non-UCP case and build a bit map for + characters with code points less than 256. However, if we are in + a negated POSIX class, characters with code points greater than + 255 must either all match or all not match, depending on whether + the whole class is not or is negated. For example, for + [[:^ascii:]... they must all match, whereas for [^[:^ascii:]... + they must not. + + In the special case where there are no xclass items, this is + automatically handled by the use of OP_CLASS or OP_NCLASS, but an + explicit range is needed for OP_XCLASS. Setting a flag here + causes the range to be generated later when it is known that + OP_XCLASS is required. In the 8-bit library this is relevant only in + utf mode, since no wide characters can exist otherwise. */ + + default: + break; + } + } +#endif /* SUPPORT_UNICODE */ + + /* In the non-UCP case, or when UCP makes no difference, we build the + bit map for the POSIX class in a chunk of local store because we may + be adding and subtracting from it, and we don't want to subtract bits + that may be in the main map already. At the end we or the result into + the bit map that is being built. */ + + posix_class *= 3; + + /* Copy in the first table (always present) */ + + memcpy(pbits.classbits, cbits + PRIV(posix_class_maps)[posix_class], 32); + + /* If there is a second table, add or remove it as required. */ + + taboffset = PRIV(posix_class_maps)[posix_class + 1]; + tabopt = PRIV(posix_class_maps)[posix_class + 2]; + + if (taboffset >= 0) + { + if (tabopt >= 0) + for (int i = 0; i < 32; i++) + pbits.classbits[i] |= cbits[i + taboffset]; + else + for (int i = 0; i < 32; i++) + pbits.classbits[i] &= (uint8_t)(~cbits[i + taboffset]); + } + + /* Now see if we need to remove any special characters. An option + value of 1 removes vertical space and 2 removes underscore. */ + + if (tabopt < 0) tabopt = -tabopt; +#ifdef EBCDIC + { + uint8_t posix_vertical[4] = { CHAR_LF, CHAR_VT, CHAR_FF, CHAR_CR }; + uint8_t posix_underscore = CHAR_UNDERSCORE; + uint8_t *chars = NULL; + int n = 0; + + if (tabopt == 1) { chars = posix_vertical; n = 4; } + else if (tabopt == 2) { chars = &posix_underscore; n = 1; } + + for (; n > 0; ++chars, --n) + pbits.classbits[*chars/8] &= ~(1u << (*chars&7)); + } +#else + if (tabopt == 1) pbits.classbits[1] &= ~0x3c; + else if (tabopt == 2) pbits.classbits[11] &= 0x7f; +#endif + + /* Add the POSIX table or its complement into the main table that is + being built and we are done. */ + + { + uint32_t *classwords = cb->classbits.classwords; + + if (local_negate) + for (int i = 0; i < 8; i++) + classwords[i] |= (uint32_t)(~pbits.classwords[i]); + else + for (int i = 0; i < 8; i++) + classwords[i] |= pbits.classwords[i]; + } + +#ifdef SUPPORT_WIDE_CHARS + /* Every class contains at least one < 256 character. */ + xclass_props |= XCLASS_HAS_8BIT_CHARS; +#endif + continue; /* End of POSIX handling */ + + /* Other than POSIX classes, the only items we should encounter are + \d-type escapes and literal characters (possibly as ranges). */ + case META_BIGVALUE: + meta = *(pptr++); + break; + + case META_ESCAPE: + escape = META_DATA(meta); + + switch(escape) + { + case ESC_d: + for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_digit]; + break; + + case ESC_D: + should_flip_negation = TRUE; + for (int i = 0; i < 32; i++) + classbits[i] |= (uint8_t)(~cbits[i+cbit_digit]); + break; + + case ESC_w: + for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_word]; + break; + + case ESC_W: + should_flip_negation = TRUE; + for (int i = 0; i < 32; i++) + classbits[i] |= (uint8_t)(~cbits[i+cbit_word]); + break; + + /* Perl 5.004 onwards omitted VT from \s, but restored it at Perl + 5.18. Before PCRE 8.34, we had to preserve the VT bit if it was + previously set by something earlier in the character class. + Luckily, the value of CHAR_VT is 0x0b in both ASCII and EBCDIC, so + we could just adjust the appropriate bit. From PCRE 8.34 we no + longer treat \s and \S specially. */ + + case ESC_s: + for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_space]; + break; + + case ESC_S: + should_flip_negation = TRUE; + for (int i = 0; i < 32; i++) + classbits[i] |= (uint8_t)(~cbits[i+cbit_space]); + break; + + /* When adding the horizontal or vertical space lists to a class, or + their complements, disable PCRE2_CASELESS, because it justs wastes + time, and in the "not-x" UTF cases can create unwanted duplicates in + the XCLASS list (provoked by characters that have more than one other + case and by both cases being in the same "not-x" sublist). */ + + case ESC_h: +#if PCRE2_CODE_UNIT_WIDTH == 8 +#ifdef SUPPORT_UNICODE + if (cranges != NULL) break; +#endif + add_list_to_class(options & ~PCRE2_CASELESS, xoptions, + cb, PRIV(hspace_list)); +#else + PCRE2_ASSERT(cranges != NULL); +#endif + break; + + case ESC_H: +#if PCRE2_CODE_UNIT_WIDTH == 8 +#ifdef SUPPORT_UNICODE + if (cranges != NULL) break; +#endif + add_not_list_to_class(options & ~PCRE2_CASELESS, xoptions, + cb, PRIV(hspace_list)); +#else + PCRE2_ASSERT(cranges != NULL); +#endif + break; + + case ESC_v: +#if PCRE2_CODE_UNIT_WIDTH == 8 +#ifdef SUPPORT_UNICODE + if (cranges != NULL) break; +#endif + add_list_to_class(options & ~PCRE2_CASELESS, xoptions, + cb, PRIV(vspace_list)); +#else + PCRE2_ASSERT(cranges != NULL); +#endif + break; + + case ESC_V: +#if PCRE2_CODE_UNIT_WIDTH == 8 +#ifdef SUPPORT_UNICODE + if (cranges != NULL) break; +#endif + add_not_list_to_class(options & ~PCRE2_CASELESS, xoptions, + cb, PRIV(vspace_list)); +#else + PCRE2_ASSERT(cranges != NULL); +#endif + break; + + /* If Unicode is not supported, \P and \p are not allowed and are + faulted at parse time, so will never appear here. */ + +#ifdef SUPPORT_UNICODE + case ESC_p: + case ESC_P: + { + uint32_t ptype = *pptr >> 16; + uint32_t pdata = *(pptr++) & 0xffff; + + /* The "Any" is processed by PRIV(update_classbits)(). */ + if (ptype == PT_ANY) + { +#if PCRE2_CODE_UNIT_WIDTH == 8 + if (!utf && escape == ESC_p) memset(classbits, 0xff, 32); +#endif + continue; + } + + PRIV(update_classbits)(ptype, pdata, (escape == ESC_P), classbits); + + if ((xclass_props & XCLASS_HIGH_ANY) == 0) + { + if (lengthptr != NULL) + *lengthptr += 3; + else + { + *class_uchardata++ = (escape == ESC_p)? XCL_PROP : XCL_NOTPROP; + *class_uchardata++ = ptype; + *class_uchardata++ = pdata; + } + xclass_props |= XCLASS_REQUIRED | XCLASS_HAS_PROPS; + } + } + continue; +#endif + } + +#ifdef SUPPORT_WIDE_CHARS + /* Every non-property class contains at least one < 256 character. */ + xclass_props |= XCLASS_HAS_8BIT_CHARS; +#endif + /* End handling \d-type escapes */ + continue; + + CLASS_END_CASES(meta) + /* Literals. */ + if (meta < META_END) break; + /* Non-literals: end of class contents. */ + goto END_PROCESSING; + } + + /* A literal character may be followed by a range meta. At parse time + there are checks for out-of-order characters, for ranges where the two + characters are equal, and for hyphens that cannot indicate a range. At + this point, therefore, no checking is needed. */ + + c = meta; + + /* Remember if \r or \n were explicitly used */ + + if (c == CHAR_CR || c == CHAR_NL) cb->external_flags |= PCRE2_HASCRORLF; + + /* Process a character range */ + + if (*pptr == META_RANGE_LITERAL || *pptr == META_RANGE_ESCAPED) + { + uint32_t d; + +#ifdef EBCDIC + BOOL range_is_literal = (*pptr == META_RANGE_LITERAL); +#endif + ++pptr; + d = *(pptr++); + if (d == META_BIGVALUE) d = *(pptr++); + + /* Remember an explicit \r or \n, and add the range to the class. */ + + if (d == CHAR_CR || d == CHAR_NL) cb->external_flags |= PCRE2_HASCRORLF; + +#if PCRE2_CODE_UNIT_WIDTH == 8 +#ifdef SUPPORT_UNICODE + if (cranges != NULL) continue; + xclass_props |= XCLASS_HAS_8BIT_CHARS; +#endif + + /* In an EBCDIC environment, Perl treats alphabetic ranges specially + because there are holes in the encoding, and simply using the range + A-Z (for example) would include the characters in the holes. This + applies only to literal ranges; [\xC1-\xE9] is different to [A-Z]. */ + +#ifdef EBCDIC + if (range_is_literal && + (cb->ctypes[c] & ctype_letter) != 0 && + (cb->ctypes[d] & ctype_letter) != 0 && + (c <= CHAR_z) == (d <= CHAR_z)) + { + uint32_t uc = (d <= CHAR_z)? 0 : 64; + uint32_t C = c - uc; + uint32_t D = d - uc; + + if (C <= CHAR_i) + { + add_to_class(options, xoptions, cb, C + uc, + ((D < CHAR_i)? D : CHAR_i) + uc); + C = CHAR_j; + } + + if (C <= D && C <= CHAR_r) + { + add_to_class(options, xoptions, cb, C + uc, + ((D < CHAR_r)? D : CHAR_r) + uc); + C = CHAR_s; + } + + if (C <= D) + add_to_class(options, xoptions, cb, C + uc, D + uc); + } + else +#endif + /* Not an EBCDIC special range */ + + add_to_class(options, xoptions, cb, c, d); +#else + PCRE2_ASSERT(cranges != NULL); +#endif + continue; + } /* End of range handling */ + + /* Character ranges are ignored when class_ranges is present. */ +#if PCRE2_CODE_UNIT_WIDTH == 8 +#ifdef SUPPORT_UNICODE + if (cranges != NULL) continue; + xclass_props |= XCLASS_HAS_8BIT_CHARS; +#endif + /* Handle a single character. */ + + add_to_class(options, xoptions, cb, meta, meta); +#else + PCRE2_ASSERT(cranges != NULL); +#endif + } /* End of main class-processing loop */ + +END_PROCESSING: + +#ifdef SUPPORT_WIDE_CHARS +PCRE2_ASSERT((xclass_props & XCLASS_HAS_PROPS) == 0 || + (xclass_props & XCLASS_HIGH_ANY) == 0); + +if (cranges != NULL) + { + uint32_t *range = (uint32_t*)(cranges + 1); + uint32_t *end = range + cranges->range_list_size; + + while (range < end && range[0] < 256) + { + PCRE2_ASSERT((xclass_props & XCLASS_HAS_8BIT_CHARS) != 0); + /* Add range to bitset. If we are in UTF or UCP mode, then clear the + caseless bit, because the cranges handle caselessness (only) in this + condition; see the condition for PARSE_CLASS_CASELESS_UTF in + compile_optimize_class(). */ + add_to_class(((options & (PCRE2_UTF|PCRE2_UCP)) != 0)? + (options & ~PCRE2_CASELESS) : options, xoptions, cb, range[0], range[1]); + + if (range[1] > 255) break; + range += 2; + } + + if (cranges->char_lists_size > 0) + { + /* The cranges structure is still used and freed later. */ + PCRE2_ASSERT((xclass_props & XCLASS_HIGH_ANY) == 0); + xclass_props |= XCLASS_REQUIRED | XCLASS_HAS_CHAR_LISTS; + } + else + { + if ((xclass_props & XCLASS_HIGH_ANY) != 0) + { + PCRE2_ASSERT(range + 2 == end && range[0] <= 256 && + range[1] >= GET_MAX_CHAR_VALUE(utf)); + should_flip_negation = TRUE; + range = end; + } + + while (range < end) + { + uint32_t range_start = range[0]; + uint32_t range_end = range[1]; + + range += 2; + xclass_props |= XCLASS_REQUIRED; + + if (range_start < 256) range_start = 256; + + if (lengthptr != NULL) + { +#ifdef SUPPORT_UNICODE + if (utf) + { + *lengthptr += 1; + + if (range_start < range_end) + *lengthptr += PRIV(ord2utf)(range_start, class_uchardata); + + *lengthptr += PRIV(ord2utf)(range_end, class_uchardata); + continue; + } +#endif /* SUPPORT_UNICODE */ + + *lengthptr += range_start < range_end ? 3 : 2; + continue; + } + +#ifdef SUPPORT_UNICODE + if (utf) + { + if (range_start < range_end) + { + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(range_start, class_uchardata); + } + else + *class_uchardata++ = XCL_SINGLE; + + class_uchardata += PRIV(ord2utf)(range_end, class_uchardata); + continue; + } +#endif /* SUPPORT_UNICODE */ + + /* Without UTF support, character values are constrained + by the bit length, and can only be > 256 for 16-bit and + 32-bit libraries. */ +#if PCRE2_CODE_UNIT_WIDTH != 8 + if (range_start < range_end) + { + *class_uchardata++ = XCL_RANGE; + *class_uchardata++ = range_start; + } + else + *class_uchardata++ = XCL_SINGLE; + + *class_uchardata++ = range_end; +#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ + } + + if (lengthptr == NULL) + cb->cx->memctl.free(cranges, cb->cx->memctl.memory_data); + } + } +#endif /* SUPPORT_WIDE_CHARS */ + +/* If there are characters with values > 255, or Unicode property settings +(\p or \P), we have to compile an extended class, with its own opcode, +unless there were no property settings and there was a negated special such +as \S in the class, and PCRE2_UCP is not set, because in that case all +characters > 255 are in or not in the class, so any that were explicitly +given as well can be ignored. + +In the UCP case, if certain negated POSIX classes (ex: [:^ascii:]) were +were present in a class, we either have to match or not match all wide +characters (depending on whether the whole class is or is not negated). +This requirement is indicated by match_all_or_no_wide_chars being true. +We do this by including an explicit range, which works in both cases. +This applies only in UTF and 16-bit and 32-bit non-UTF modes, since there +cannot be any wide characters in 8-bit non-UTF mode. + +When there *are* properties in a positive UTF-8 or any 16-bit or 32_bit +class where \S etc is present without PCRE2_UCP, causing an extended class +to be compiled, we make sure that all characters > 255 are included by +forcing match_all_or_no_wide_chars to be true. + +If, when generating an xclass, there are no characters < 256, we can omit +the bitmap in the actual compiled code. */ + +#ifdef SUPPORT_WIDE_CHARS /* Defined for 16/32 bits, or 8-bit with Unicode */ +if ((xclass_props & XCLASS_REQUIRED) != 0) + { + PCRE2_UCHAR *previous = code; + + if ((xclass_props & XCLASS_HAS_CHAR_LISTS) == 0) + *class_uchardata++ = XCL_END; /* Marks the end of extra data */ + *code++ = OP_XCLASS; + code += LINK_SIZE; + *code = negate_class? XCL_NOT:0; + if ((xclass_props & XCLASS_HAS_PROPS) != 0) *code |= XCL_HASPROP; + + /* If the map is required, move up the extra data to make room for it; + otherwise just move the code pointer to the end of the extra data. */ + + if ((xclass_props & XCLASS_HAS_8BIT_CHARS) != 0 || has_bitmap != NULL) + { + if (negate_class) + { + uint32_t *classwords = cb->classbits.classwords; + for (int i = 0; i < 8; i++) classwords[i] = ~classwords[i]; + } + + if (has_bitmap == NULL) + { + *code++ |= XCL_MAP; + (void)memmove(code + (32 / sizeof(PCRE2_UCHAR)), code, + CU2BYTES(class_uchardata - code)); + memcpy(code, classbits, 32); + code = class_uchardata + (32 / sizeof(PCRE2_UCHAR)); + } + else + { + code = class_uchardata; + if ((xclass_props & XCLASS_HAS_8BIT_CHARS) != 0) + *has_bitmap = TRUE; + } + } + else code = class_uchardata; + + if ((xclass_props & XCLASS_HAS_CHAR_LISTS) != 0) + { + /* Char lists size is an even number, because all items are 16 or 32 + bit values. The character list data is always aligned to 32 bits. */ + size_t char_lists_size = cranges->char_lists_size; + PCRE2_ASSERT((char_lists_size & 0x1) == 0 && + (cb->char_lists_size & 0x3) == 0); + + if (lengthptr != NULL) + { + char_lists_size = CLIST_ALIGN_TO(char_lists_size, sizeof(uint32_t)); + +#if PCRE2_CODE_UNIT_WIDTH == 8 + *lengthptr += 2 + LINK_SIZE; +#else + *lengthptr += 1 + LINK_SIZE; +#endif + + PCRE2_ASSERT(BYTES2CU(cb->char_lists_size) <= MAX_PATTERN_SIZE); + + if (char_lists_size > PCRE2_SIZE_MAX - cb->char_lists_size || + BYTES2CU(char_lists_size) > MAX_PATTERN_SIZE || + BYTES2CU(cb->char_lists_size) > MAX_PATTERN_SIZE - BYTES2CU(char_lists_size)) + { + *errorcodeptr = ERR20; /* Pattern is too large */ + return NULL; + } + + cb->char_lists_size += char_lists_size; + } + else + { + uint8_t *data; + + PCRE2_ASSERT(cranges->char_lists_types <= XCL_TYPE_MASK); +#if PCRE2_CODE_UNIT_WIDTH == 8 + /* Encode as high / low bytes. */ + code[0] = (uint8_t)(XCL_LIST | + (cranges->char_lists_types >> 8)); + code[1] = (uint8_t)cranges->char_lists_types; + code += 2; +#else + *code++ = (PCRE2_UCHAR)(XCL_LIST | cranges->char_lists_types); +#endif + + /* Character lists are stored in backwards direction from + byte code start. The non-dfa/dfa matchers can access these + lists using the byte code start stored in match blocks. + Each list is aligned to 32 bit with an optional unused + 16 bit value at the beginning of the character list. */ + + PCRE2_ASSERT(char_lists_size <= PCRE2_SIZE_MAX - cb->char_lists_size); + + cb->char_lists_size += char_lists_size; + data = (uint8_t*)cb->start_code - cb->char_lists_size; + + memcpy(data, (uint8_t*)(cranges + 1) + cranges->char_lists_start, + char_lists_size); + + /* Since character lists total size is less than MAX_PATTERN_SIZE, + their starting offset fits into a value which size is LINK_SIZE. */ + + char_lists_size = cb->char_lists_size; + PUT(code, 0, (uint32_t)(char_lists_size >> 1)); + code += LINK_SIZE; + + /* If we added padding to align the list, initialize the bytes to + defined values, so the library is valgrind-clean. It could also + be a security concern for clients calling into PCRE2 via bindings + from a memory-safe language, if pcre2_serialize_encode() exposes + uninitialized memory that may contain sensitive information. */ + + if ((char_lists_size & 0x2) != 0) + ((uint16_t*)data)[-1] = 0xdead; + + cb->char_lists_size = + CLIST_ALIGN_TO(char_lists_size, sizeof(uint32_t)); + + cb->cx->memctl.free(cranges, cb->cx->memctl.memory_data); + } + } + + /* Now fill in the complete length of the item */ + + PUT(previous, 1, (int)(code - previous)); + goto DONE; /* End of class handling */ + } +#endif /* SUPPORT_WIDE_CHARS */ + +/* If there are no characters > 255, or they are all to be included or +excluded, set the opcode to OP_CLASS or OP_NCLASS, depending on whether the +whole class was negated and whether there were negative specials such as \S +(non-UCP) in the class. Then copy the 32-byte map into the code vector, +negating it if necessary. */ + +if (negate_class) + { + uint32_t *classwords = cb->classbits.classwords; + + for (int i = 0; i < 8; i++) classwords[i] = ~classwords[i]; + } + +if ((SELECT_VALUE8(!utf, 0) || negate_class != should_flip_negation) && + cb->classbits.classwords[0] == ~(uint32_t)0) + { + const uint32_t *classwords = cb->classbits.classwords; + int i; + + for (i = 0; i < 8; i++) + if (classwords[i] != ~(uint32_t)0) break; + + if (i == 8) + { + *code++ = OP_ALLANY; + goto DONE; /* End of class handling */ + } + } + +*code++ = (negate_class == should_flip_negation) ? OP_CLASS : OP_NCLASS; +memcpy(code, classbits, 32); +code += 32 / sizeof(PCRE2_UCHAR); + +DONE: +*pcode = code; +return pptr - 1; +} + + + +/* ===================================================================*/ +/* Here follows a block of ECLASS-compiling functions. You may well want to +read them from top to bottom; they are ordered from leafmost (at the top) to +outermost parser (at the bottom of the file). */ + +/* This function folds one operand using the negation operator. +The new, combined chunk of stack code is written out to *pop_info. */ + +static void +fold_negation(eclass_op_info *pop_info, PCRE2_SIZE *lengthptr, + BOOL preserve_classbits) +{ +/* If the chunk of stack code is already composed of multiple ops, we won't +descend in and try and propagate the negation down the tree. (That would lead +to O(n^2) compile-time, which could be exploitable with a malicious regex - +although maybe that's not really too much of a worry in a library that offers +an exponential-time matching function!) */ + +if (pop_info->op_single_type == 0) + { + if (lengthptr != NULL) + *lengthptr += 1; + else + pop_info->code_start[pop_info->length] = ECL_NOT; + pop_info->length += 1; + } + +/* Otherwise, it's a nice single-op item, so we can easily fold in the negation +without needing to produce an ECL_NOT. */ + +else if (pop_info->op_single_type == ECL_ANY || + pop_info->op_single_type == ECL_NONE) + { + pop_info->op_single_type = (pop_info->op_single_type == ECL_NONE)? + ECL_ANY : ECL_NONE; + if (lengthptr == NULL) + *(pop_info->code_start) = pop_info->op_single_type; + } +else + { + PCRE2_ASSERT(pop_info->op_single_type == ECL_XCLASS && + pop_info->length >= 1 + LINK_SIZE + 1); + if (lengthptr == NULL) + pop_info->code_start[1 + LINK_SIZE] ^= XCL_NOT; + } + +if (!preserve_classbits) + { + for (int i = 0; i < 8; i++) + pop_info->bits.classwords[i] = ~pop_info->bits.classwords[i]; + } +} + + + +/* This function folds together two operands using a binary operator. +The new, combined chunk of stack code is written out to *lhs_op_info. */ + +static void +fold_binary(int op, eclass_op_info *lhs_op_info, eclass_op_info *rhs_op_info, + PCRE2_SIZE *lengthptr) +{ +switch (op) + { + /* ECL_AND truth table: + + LHS RHS RESULT + ---------------- + ANY * RHS + * ANY LHS + NONE * NONE + * NONE NONE + X Y X & Y + */ + + case ECL_AND: + if (rhs_op_info->op_single_type == ECL_ANY) + { + /* no-op: drop the RHS */ + } + else if (lhs_op_info->op_single_type == ECL_ANY) + { + /* no-op: drop the LHS, and memmove the RHS into its place */ + if (lengthptr == NULL) + memmove(lhs_op_info->code_start, rhs_op_info->code_start, + CU2BYTES(rhs_op_info->length)); + lhs_op_info->length = rhs_op_info->length; + lhs_op_info->op_single_type = rhs_op_info->op_single_type; + } + else if (rhs_op_info->op_single_type == ECL_NONE) + { + /* the result is ECL_NONE: write into the LHS */ + if (lengthptr == NULL) + lhs_op_info->code_start[0] = ECL_NONE; + lhs_op_info->length = 1; + lhs_op_info->op_single_type = ECL_NONE; + } + else if (lhs_op_info->op_single_type == ECL_NONE) + { + /* the result is ECL_NONE: drop the RHS */ + } + else + { + /* Both of LHS & RHS are either ECL_XCLASS, or compound operations. */ + if (lengthptr != NULL) + *lengthptr += 1; + else + { + PCRE2_ASSERT(rhs_op_info->code_start == + lhs_op_info->code_start + lhs_op_info->length); + rhs_op_info->code_start[rhs_op_info->length] = ECL_AND; + } + lhs_op_info->length += rhs_op_info->length + 1; + lhs_op_info->op_single_type = 0; + } + + for (int i = 0; i < 8; i++) + lhs_op_info->bits.classwords[i] &= rhs_op_info->bits.classwords[i]; + break; + + /* ECL_OR truth table: + + LHS RHS RESULT + ---------------- + ANY * ANY + * ANY ANY + NONE * RHS + * NONE LHS + X Y X | Y + */ + + case ECL_OR: + if (rhs_op_info->op_single_type == ECL_NONE) + { + /* no-op: drop the RHS */ + } + else if (lhs_op_info->op_single_type == ECL_NONE) + { + /* no-op: drop the LHS, and memmove the RHS into its place */ + if (lengthptr == NULL) + memmove(lhs_op_info->code_start, rhs_op_info->code_start, + CU2BYTES(rhs_op_info->length)); + lhs_op_info->length = rhs_op_info->length; + lhs_op_info->op_single_type = rhs_op_info->op_single_type; + } + else if (rhs_op_info->op_single_type == ECL_ANY) + { + /* the result is ECL_ANY: write into the LHS */ + if (lengthptr == NULL) + lhs_op_info->code_start[0] = ECL_ANY; + lhs_op_info->length = 1; + lhs_op_info->op_single_type = ECL_ANY; + } + else if (lhs_op_info->op_single_type == ECL_ANY) + { + /* the result is ECL_ANY: drop the RHS */ + } + else + { + /* Both of LHS & RHS are either ECL_XCLASS, or compound operations. */ + if (lengthptr != NULL) + *lengthptr += 1; + else + { + PCRE2_ASSERT(rhs_op_info->code_start == + lhs_op_info->code_start + lhs_op_info->length); + rhs_op_info->code_start[rhs_op_info->length] = ECL_OR; + } + lhs_op_info->length += rhs_op_info->length + 1; + lhs_op_info->op_single_type = 0; + } + + for (int i = 0; i < 8; i++) + lhs_op_info->bits.classwords[i] |= rhs_op_info->bits.classwords[i]; + break; + + /* ECL_XOR truth table: + + LHS RHS RESULT + ---------------- + ANY * !RHS + * ANY !LHS + NONE * RHS + * NONE LHS + X Y X ^ Y + */ + + case ECL_XOR: + if (rhs_op_info->op_single_type == ECL_NONE) + { + /* no-op: drop the RHS */ + } + else if (lhs_op_info->op_single_type == ECL_NONE) + { + /* no-op: drop the LHS, and memmove the RHS into its place */ + if (lengthptr == NULL) + memmove(lhs_op_info->code_start, rhs_op_info->code_start, + CU2BYTES(rhs_op_info->length)); + lhs_op_info->length = rhs_op_info->length; + lhs_op_info->op_single_type = rhs_op_info->op_single_type; + } + else if (rhs_op_info->op_single_type == ECL_ANY) + { + /* the result is !LHS: fold in the negation, and drop the RHS */ + /* Preserve the classbits, because we promise to deal with them later. */ + fold_negation(lhs_op_info, lengthptr, TRUE); + } + else if (lhs_op_info->op_single_type == ECL_ANY) + { + /* the result is !RHS: drop the LHS, memmove the RHS into its place, and + fold in the negation */ + if (lengthptr == NULL) + memmove(lhs_op_info->code_start, rhs_op_info->code_start, + CU2BYTES(rhs_op_info->length)); + lhs_op_info->length = rhs_op_info->length; + lhs_op_info->op_single_type = rhs_op_info->op_single_type; + + /* Preserve the classbits, because we promise to deal with them later. */ + fold_negation(lhs_op_info, lengthptr, TRUE); + } + else + { + /* Both of LHS & RHS are either ECL_XCLASS, or compound operations. */ + if (lengthptr != NULL) + *lengthptr += 1; + else + { + PCRE2_ASSERT(rhs_op_info->code_start == + lhs_op_info->code_start + lhs_op_info->length); + rhs_op_info->code_start[rhs_op_info->length] = ECL_XOR; + } + lhs_op_info->length += rhs_op_info->length + 1; + lhs_op_info->op_single_type = 0; + } + + for (int i = 0; i < 8; i++) + lhs_op_info->bits.classwords[i] ^= rhs_op_info->bits.classwords[i]; + break; + + /* LCOV_EXCL_START */ + default: + PCRE2_DEBUG_UNREACHABLE(); + break; + /* LCOV_EXCL_STOP */ + } +} + + + +static BOOL +compile_eclass_nested(eclass_context *context, BOOL negated, + uint32_t **pptr, PCRE2_UCHAR **pcode, + eclass_op_info *pop_info, PCRE2_SIZE *lengthptr); + +/* This function consumes a group of implicitly-unioned class elements. +These can be characters, ranges, properties, or nested classes, as long +as they are all joined by being placed adjacently. */ + +static BOOL +compile_class_operand(eclass_context *context, BOOL negated, + uint32_t **pptr, PCRE2_UCHAR **pcode, eclass_op_info *pop_info, + PCRE2_SIZE *lengthptr) +{ +uint32_t *ptr = *pptr; +uint32_t *prev_ptr; +PCRE2_UCHAR *code = *pcode; +PCRE2_UCHAR *code_start = code; +PCRE2_SIZE prev_length = (lengthptr != NULL)? *lengthptr : 0; +PCRE2_SIZE extra_length; +uint32_t meta = META_CODE(*ptr); + +switch (meta) + { + case META_CLASS_EMPTY_NOT: + case META_CLASS_EMPTY: + ++ptr; + pop_info->length = 1; + if ((meta == META_CLASS_EMPTY) == negated) + { + *code++ = pop_info->op_single_type = ECL_ANY; + memset(pop_info->bits.classbits, 0xff, 32); + } + else + { + *code++ = pop_info->op_single_type = ECL_NONE; + memset(pop_info->bits.classbits, 0, 32); + } + break; + + case META_CLASS: + case META_CLASS_NOT: + if ((*ptr & CLASS_IS_ECLASS) != 0) + { + if (!compile_eclass_nested(context, negated, &ptr, &code, + pop_info, lengthptr)) + return FALSE; + + PCRE2_ASSERT(*ptr == META_CLASS_END); + ptr++; + goto DONE; + } + + ptr++; + PCRE2_FALLTHROUGH /* Fall through */ + + default: + /* Scan forward characters, ranges, and properties. + For example: inside [a-z_ -- m] we don't have brackets around "a-z_" but + we still need to collect that fragment up into a "leaf" OP_CLASS. */ + + prev_ptr = ptr; + ptr = PRIV(compile_class_not_nested)( + context->options, context->xoptions, ptr, &code, + (meta != META_CLASS_NOT) == negated, &context->needs_bitmap, + context->errorcodeptr, context->cb, lengthptr); + if (ptr == NULL) return FALSE; + + /* We must have a 100% guarantee that ptr increases when + compile_class_operand() returns, even on Release builds, so that we can + statically prove our loops terminate. */ + /* LCOV_EXCL_START */ + if (ptr <= prev_ptr) + { + PCRE2_DEBUG_UNREACHABLE(); + return FALSE; + } + /* LCOV_EXCL_STOP */ + + /* If we fell through above, consume the closing ']'. */ + if (meta == META_CLASS || meta == META_CLASS_NOT) + { + PCRE2_ASSERT(*ptr == META_CLASS_END); + ptr++; + } + + /* Regardless of whether (lengthptr == NULL), some data will still be written + out to *pcode, which we need: we have to peek at it, to transform the opcode + into the ECLASS version (since we need to hoist up the bitmaps). */ + PCRE2_ASSERT(code > code_start); + extra_length = (lengthptr != NULL)? *lengthptr - prev_length : 0; + + /* Easiest case: convert OP_ALLANY to ECL_ANY */ + + if (*code_start == OP_ALLANY) + { + PCRE2_ASSERT(code - code_start == 1 && extra_length == 0); + pop_info->length = 1; + *code_start = pop_info->op_single_type = ECL_ANY; + memset(pop_info->bits.classbits, 0xff, 32); + } + + /* For OP_CLASS and OP_NCLASS, we hoist out the bitmap and convert to + ECL_NONE / ECL_ANY respectively. */ + + else if (*code_start == OP_CLASS || *code_start == OP_NCLASS) + { + PCRE2_ASSERT(code - code_start == 1 + 32 / sizeof(PCRE2_UCHAR) && + extra_length == 0); + pop_info->length = 1; + *code_start = pop_info->op_single_type = + (*code_start == OP_CLASS)? ECL_NONE : ECL_ANY; + memcpy(pop_info->bits.classbits, code_start + 1, 32); + /* Rewind the code pointer, but make sure we adjust *lengthptr, because we + do need to reserve that space (even though we only use it temporarily). */ + if (lengthptr != NULL) + *lengthptr += code - (code_start + 1); + code = code_start + 1; + + if (!context->needs_bitmap && *code_start == ECL_NONE) + { + uint32_t *classwords = pop_info->bits.classwords; + + for (int i = 0; i < 8; i++) + if (classwords[i] != 0) + { + context->needs_bitmap = TRUE; + break; + } + } + else + context->needs_bitmap = TRUE; + } + + /* Finally, for OP_XCLASS we hoist out the bitmap (if any), and convert to + ECL_XCLASS. */ + + else + { + PCRE2_ASSERT(*code_start == OP_XCLASS); + *code_start = pop_info->op_single_type = ECL_XCLASS; + + PCRE2_ASSERT(code - code_start >= 1 + LINK_SIZE + 1); + + memcpy(pop_info->bits.classbits, context->cb->classbits.classbits, 32); + pop_info->length = (code - code_start) + extra_length; + } + + break; + } /* End of switch(meta) */ + +pop_info->code_start = (lengthptr == NULL)? code_start : NULL; + +if (lengthptr != NULL) + { + *lengthptr += code - code_start; + code = code_start; + } + +DONE: +PCRE2_ASSERT(lengthptr == NULL || (code == code_start)); + +*pptr = ptr; +*pcode = code; +return TRUE; +} + + + +/* This function consumes a group of implicitly-unioned class elements. +These can be characters, ranges, properties, or nested classes, as long +as they are all joined by being placed adjacently. */ + +static BOOL +compile_class_juxtaposition(eclass_context *context, BOOL negated, + uint32_t **pptr, PCRE2_UCHAR **pcode, eclass_op_info *pop_info, + PCRE2_SIZE *lengthptr) +{ +uint32_t *ptr = *pptr; +PCRE2_UCHAR *code = *pcode; +#ifdef PCRE2_DEBUG +PCRE2_UCHAR *start_code = *pcode; +#endif + +/* See compile_class_binary_loose() for comments on compile-time folding of +the "negated" flag. */ + +/* Because it's a non-empty class, there must be an operand at the start. */ +if (!compile_class_operand(context, negated, &ptr, &code, pop_info, lengthptr)) + return FALSE; + +while (*ptr != META_CLASS_END && + !(*ptr >= META_ECLASS_AND && *ptr <= META_ECLASS_NOT)) + { + uint32_t op; + BOOL rhs_negated; + eclass_op_info rhs_op_info; + + if (negated) + { + /* !(A juxtapose B) -> !A && !B */ + op = ECL_AND; + rhs_negated = TRUE; + } + else + { + /* A juxtapose B -> A || B */ + op = ECL_OR; + rhs_negated = FALSE; + } + + /* An operand must follow the operator. */ + if (!compile_class_operand(context, rhs_negated, &ptr, &code, + &rhs_op_info, lengthptr)) + return FALSE; + + /* Convert infix to postfix (RPN). */ + fold_binary(op, pop_info, &rhs_op_info, lengthptr); + if (lengthptr == NULL) + code = pop_info->code_start + pop_info->length; + } + +PCRE2_ASSERT(lengthptr == NULL || code == start_code); + +*pptr = ptr; +*pcode = code; +return TRUE; +} + + + +/* This function consumes unary prefix operators. */ + +static BOOL +compile_class_unary(eclass_context *context, BOOL negated, + uint32_t **pptr, PCRE2_UCHAR **pcode, eclass_op_info *pop_info, + PCRE2_SIZE *lengthptr) +{ +uint32_t *ptr = *pptr; +#ifdef PCRE2_DEBUG +PCRE2_UCHAR *start_code = *pcode; +#endif + +while (*ptr == META_ECLASS_NOT) + { + ++ptr; + negated = !negated; + } + +*pptr = ptr; +/* Because it's a non-empty class, there must be an operand. */ +if (!compile_class_juxtaposition(context, negated, pptr, pcode, + pop_info, lengthptr)) + return FALSE; + +PCRE2_ASSERT(lengthptr == NULL || *pcode == start_code); +return TRUE; +} + + + +/* This function consumes tightly-binding binary operators. */ + +static BOOL +compile_class_binary_tight(eclass_context *context, BOOL negated, + uint32_t **pptr, PCRE2_UCHAR **pcode, eclass_op_info *pop_info, + PCRE2_SIZE *lengthptr) +{ +uint32_t *ptr = *pptr; +PCRE2_UCHAR *code = *pcode; +#ifdef PCRE2_DEBUG +PCRE2_UCHAR *start_code = *pcode; +#endif + +/* See compile_class_binary_loose() for comments on compile-time folding of +the "negated" flag. */ + +/* Because it's a non-empty class, there must be an operand at the start. */ +if (!compile_class_unary(context, negated, &ptr, &code, pop_info, lengthptr)) + return FALSE; + +while (*ptr == META_ECLASS_AND) + { + uint32_t op; + BOOL rhs_negated; + eclass_op_info rhs_op_info; + + if (negated) + { + /* !(A && B) -> !A || !B */ + op = ECL_OR; + rhs_negated = TRUE; + } + else + { + /* A && B -> A && B */ + op = ECL_AND; + rhs_negated = FALSE; + } + + ++ptr; + + /* An operand must follow the operator. */ + if (!compile_class_unary(context, rhs_negated, &ptr, &code, + &rhs_op_info, lengthptr)) + return FALSE; + + /* Convert infix to postfix (RPN). */ + fold_binary(op, pop_info, &rhs_op_info, lengthptr); + if (lengthptr == NULL) + code = pop_info->code_start + pop_info->length; + } + +PCRE2_ASSERT(lengthptr == NULL || code == start_code); + +*pptr = ptr; +*pcode = code; +return TRUE; +} + + + +/* This function consumes loosely-binding binary operators. */ + +static BOOL +compile_class_binary_loose(eclass_context *context, BOOL negated, + uint32_t **pptr, PCRE2_UCHAR **pcode, eclass_op_info *pop_info, + PCRE2_SIZE *lengthptr) +{ +uint32_t *ptr = *pptr; +PCRE2_UCHAR *code = *pcode; +#ifdef PCRE2_DEBUG +PCRE2_UCHAR *start_code = *pcode; +#endif + +/* We really want to fold the negation operator, if at all possible, so that +simple cases can be reduced down. In particular, in 8-bit no-UTF mode, we want +to produce a fully-folded expression, so that we can guarantee not to emit any +OP_ECLASS codes (in the same way that we never emit OP_XCLASS in this mode). + +This has the consequence that with a little ingenuity, we can in fact avoid +emitting (nearly...) all cases of the "NOT" operator. Imagine that we have: + !(A ... +We have parsed the preceding "!", and we are about to parse the "A" operand. We +don't know yet whether there will even be a following binary operand! Both of +these are possibilities for what follows: + !(A && B) + !(A) +However, we can still fold the "!" into the "A" operand, because no matter what +the following binary operator will be, we can produce an expression which is +equivalent. */ + +/* Because it's a non-empty class, there must be an operand at the start. */ +if (!compile_class_binary_tight(context, negated, &ptr, &code, + pop_info, lengthptr)) + return FALSE; + +while (*ptr >= META_ECLASS_OR && *ptr <= META_ECLASS_XOR) + { + uint32_t op; + BOOL op_neg; + BOOL rhs_negated; + eclass_op_info rhs_op_info; + + if (negated) + { + /* The whole expression is being negated; we respond by unconditionally + negating the LHS A, before seeing what follows. And hooray! We can recover, + no matter what follows. */ + /* !(A || B) -> !A && !B */ + /* !(A -- B) -> !(A && !B) -> !A || B */ + /* !(A XOR B) -> !(!A XOR !B) -> !A XNOR !B */ + op = (*ptr == META_ECLASS_OR )? ECL_AND : + (*ptr == META_ECLASS_SUB)? ECL_OR : + /*ptr == META_ECLASS_XOR*/ ECL_XOR; + op_neg = (*ptr == META_ECLASS_XOR); + rhs_negated = *ptr != META_ECLASS_SUB; + } + else + { + /* A || B -> A || B */ + /* A -- B -> A && !B */ + /* A XOR B -> A XOR B */ + op = (*ptr == META_ECLASS_OR )? ECL_OR : + (*ptr == META_ECLASS_SUB)? ECL_AND : + /*ptr == META_ECLASS_XOR*/ ECL_XOR; + op_neg = FALSE; + rhs_negated = *ptr == META_ECLASS_SUB; + } + + ++ptr; + + /* An operand must follow the operator. */ + if (!compile_class_binary_tight(context, rhs_negated, &ptr, &code, + &rhs_op_info, lengthptr)) + return FALSE; + + /* Convert infix to postfix (RPN). */ + fold_binary(op, pop_info, &rhs_op_info, lengthptr); + if (op_neg) fold_negation(pop_info, lengthptr, FALSE); + if (lengthptr == NULL) + code = pop_info->code_start + pop_info->length; + } + +PCRE2_ASSERT(lengthptr == NULL || code == start_code); + +*pptr = ptr; +*pcode = code; +return TRUE; +} + + + +/* This function converts the META codes in pptr into opcodes written to +pcode. The pptr must start at a META_CLASS or META_CLASS_NOT. + +The class is compiled as a left-associative sequence of operator +applications. + +The pptr will be left pointing at the matching META_CLASS_END. */ + +static BOOL +compile_eclass_nested(eclass_context *context, BOOL negated, + uint32_t **pptr, PCRE2_UCHAR **pcode, + eclass_op_info *pop_info, PCRE2_SIZE *lengthptr) +{ +uint32_t *ptr = *pptr; +#ifdef PCRE2_DEBUG +PCRE2_UCHAR *start_code = *pcode; +#endif + +/* The CLASS_IS_ECLASS bit must be set since it is a nested class. */ +PCRE2_ASSERT(*ptr == (META_CLASS | CLASS_IS_ECLASS) || + *ptr == (META_CLASS_NOT | CLASS_IS_ECLASS)); + +if (*ptr++ == (META_CLASS_NOT | CLASS_IS_ECLASS)) + negated = !negated; + +(*pptr)++; + +/* Because it's a non-empty class, there must be an operand at the start. */ +if (!compile_class_binary_loose(context, negated, pptr, pcode, + pop_info, lengthptr)) + return FALSE; + +PCRE2_ASSERT(**pptr == META_CLASS_END); +PCRE2_ASSERT(lengthptr == NULL || *pcode == start_code); +return TRUE; +} + +BOOL +PRIV(compile_class_nested)(uint32_t options, uint32_t xoptions, + uint32_t **pptr, PCRE2_UCHAR **pcode, int *errorcodeptr, + compile_block *cb, PCRE2_SIZE *lengthptr) +{ +eclass_context context; +eclass_op_info op_info; +PCRE2_SIZE previous_length = (lengthptr != NULL)? *lengthptr : 0; +PCRE2_UCHAR *code = *pcode; +PCRE2_UCHAR *previous; +BOOL allbitsone = TRUE; + +context.needs_bitmap = FALSE; +context.options = options; +context.xoptions = xoptions; +context.errorcodeptr = errorcodeptr; +context.cb = cb; + +previous = code; +*code++ = OP_ECLASS; +code += LINK_SIZE; +*code++ = 0; /* Flags, currently zero. */ +if (!compile_eclass_nested(&context, FALSE, pptr, &code, &op_info, lengthptr)) + return FALSE; + +if (lengthptr != NULL) + { + *lengthptr += code - previous; + code = previous; + /* (*lengthptr - previous_length) now holds the amount of buffer that + we require to make the call to compile_class_nested() with + lengthptr = NULL, and including the (1+LINK_SIZE+1) that we write out + before that call. */ + } + +/* Do some useful counting of what's in the bitmap. */ +for (int i = 0; i < 8; i++) + if (op_info.bits.classwords[i] != 0xffffffff) + { + allbitsone = FALSE; + break; + } + +/* After constant-folding the extended class syntax, it may turn out to be +a simple class after all. In that case, we can unwrap it from the +OP_ECLASS container - and in fact, we must do so, because in 8-bit +no-Unicode mode the matcher is compiled without support for OP_ECLASS. */ + +#ifndef SUPPORT_WIDE_CHARS +PCRE2_ASSERT(op_info.op_single_type != 0); +#else +if (op_info.op_single_type != 0) +#endif + { + /* Rewind back over the OP_ECLASS. */ + code = previous; + + /* If the bits are all ones, and the "high characters" are all matched + too, we use a special-cased encoding of OP_ALLANY. */ + + if (op_info.op_single_type == ECL_ANY && allbitsone) + { + /* Advancing code means rewinding lengthptr, at this point. */ + if (lengthptr != NULL) *lengthptr -= 1; + *code++ = OP_ALLANY; + } + + /* If the high bits are all matched / all not-matched, then we emit an + OP_NCLASS/OP_CLASS respectively. */ + + else if (op_info.op_single_type == ECL_ANY || + op_info.op_single_type == ECL_NONE) + { + PCRE2_SIZE required_len = 1 + (32 / sizeof(PCRE2_UCHAR)); + + if (lengthptr != NULL) + { + if (required_len > (*lengthptr - previous_length)) + *lengthptr = previous_length + required_len; + } + + /* Advancing code means rewinding lengthptr, at this point. */ + if (lengthptr != NULL) *lengthptr -= required_len; + *code++ = (op_info.op_single_type == ECL_ANY)? OP_NCLASS : OP_CLASS; + memcpy(code, op_info.bits.classbits, 32); + code += 32 / sizeof(PCRE2_UCHAR); + } + + /* Otherwise, we have an ECL_XCLASS, so we have the OP_XCLASS data + there, but, we pulled out its bitmap into op_info, so now we have to + put that back into the OP_XCLASS. */ + + else + { +#ifndef SUPPORT_WIDE_CHARS + PCRE2_DEBUG_UNREACHABLE(); +#else + BOOL need_map = context.needs_bitmap; + PCRE2_SIZE required_len; + + PCRE2_ASSERT(op_info.op_single_type == ECL_XCLASS); + required_len = op_info.length + (need_map? 32/sizeof(PCRE2_UCHAR) : 0); + + if (lengthptr != NULL) + { + /* Don't unconditionally request all the space we need - we may + already have asked for more during processing of the ECLASS. */ + if (required_len > (*lengthptr - previous_length)) + *lengthptr = previous_length + required_len; + + /* The code we write out here won't be ignored, even during the + (lengthptr != NULL) phase, because if there's a following quantifier + it will peek backwards. So we do have to write out a (truncated) + OP_XCLASS, even on this branch. */ + *lengthptr -= 1 + LINK_SIZE + 1; + *code++ = OP_XCLASS; + PUT(code, 0, 1 + LINK_SIZE + 1); + code += LINK_SIZE; + *code++ = 0; + } + else + { + PCRE2_UCHAR *rest; + PCRE2_SIZE rest_len; + PCRE2_UCHAR flags; + + /* 1 unit: OP_XCLASS | LINK_SIZE units | 1 unit: flags | ...rest */ + PCRE2_ASSERT(op_info.length >= 1 + LINK_SIZE + 1); + rest = op_info.code_start + 1 + LINK_SIZE + 1; + rest_len = (op_info.code_start + op_info.length) - rest; + + /* First read any data we use, before memmove splats it. */ + flags = op_info.code_start[1 + LINK_SIZE]; + PCRE2_ASSERT((flags & XCL_MAP) == 0); + + /* Next do the memmove before any writes. */ + memmove(code + 1 + LINK_SIZE + 1 + (need_map? 32/sizeof(PCRE2_UCHAR) : 0), + rest, CU2BYTES(rest_len)); + + /* Finally write the header data. */ + *code++ = OP_XCLASS; + PUT(code, 0, (int)required_len); + code += LINK_SIZE; + *code++ = flags | (need_map? XCL_MAP : 0); + if (need_map) + { + memcpy(code, op_info.bits.classbits, 32); + code += 32 / sizeof(PCRE2_UCHAR); + } + code += rest_len; + } +#endif /* SUPPORT_WIDE_CHARS */ + } + } + +/* Otherwise, we're going to keep the OP_ECLASS. However, again we need +to do some adjustment to insert the bitmap if we have one. */ + +#ifdef SUPPORT_WIDE_CHARS +else + { + BOOL need_map = context.needs_bitmap; + PCRE2_SIZE required_len = + 1 + LINK_SIZE + 1 + (need_map? 32/sizeof(PCRE2_UCHAR) : 0) + op_info.length; + + if (lengthptr != NULL) + { + if (required_len > (*lengthptr - previous_length)) + *lengthptr = previous_length + required_len; + + /* As for the XCLASS branch above, we do have to write out a dummy + OP_ECLASS, because of the backwards peek by the quantifier code. Write + out a (truncated) OP_ECLASS, even on this branch. */ + *lengthptr -= 1 + LINK_SIZE + 1; + *code++ = OP_ECLASS; + PUT(code, 0, 1 + LINK_SIZE + 1); + code += LINK_SIZE; + *code++ = 0; + } + else + { + if (need_map) + { + PCRE2_UCHAR *map_start = previous + 1 + LINK_SIZE + 1; + previous[1 + LINK_SIZE] |= ECL_MAP; + memmove(map_start + 32/sizeof(PCRE2_UCHAR), map_start, + CU2BYTES(code - map_start)); + memcpy(map_start, op_info.bits.classbits, 32); + code += 32 / sizeof(PCRE2_UCHAR); + } + PUT(previous, 1, (int)(code - previous)); + } + } +#endif /* SUPPORT_WIDE_CHARS */ + +*pcode = code; +return TRUE; +} + +/* End of pcre2_compile_class.c */ diff --git a/std/regex/pcre2/pcre2_config.c b/std/regex/pcre2/pcre2_config.c index 5ef103caf..045f6e78d 100644 --- a/std/regex/pcre2/pcre2_config.c +++ b/std/regex/pcre2/pcre2_config.c @@ -38,17 +38,10 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -/* Save the configured link size, which is in bytes. In 16-bit and 32-bit modes -its value gets changed by pcre2_intmodedep.h (included by pcre2_internal.h) to -be in code units. */ +#include "pcre2_internal.h" -static int configured_link_size = LINK_SIZE; -#include "pcre2_internal.h" /* These macros are the standard way of turning unquoted text into C strings. They allow macros like PCRE2_MAJOR to be defined without quotes, which is @@ -79,7 +72,7 @@ pcre2_config(uint32_t what, void *where) { if (where == NULL) /* Requests a length */ { - switch(what) + switch (what) { default: return PCRE2_ERROR_BADOPTION; @@ -87,6 +80,7 @@ if (where == NULL) /* Requests a length */ case PCRE2_CONFIG_BSR: case PCRE2_CONFIG_COMPILED_WIDTHS: case PCRE2_CONFIG_DEPTHLIMIT: + case PCRE2_CONFIG_EFFECTIVE_LINKSIZE: case PCRE2_CONFIG_HEAPLIMIT: case PCRE2_CONFIG_JIT: case PCRE2_CONFIG_LINKSIZE: @@ -124,13 +118,13 @@ switch (what) case PCRE2_CONFIG_COMPILED_WIDTHS: *((uint32_t *)where) = 0 #ifdef SUPPORT_PCRE2_8 - + 1 + + (1 << 0) #endif #ifdef SUPPORT_PCRE2_16 - + 2 + + (1 << 1) #endif #ifdef SUPPORT_PCRE2_32 - + 4 + + (1 << 2) #endif ; break; @@ -139,6 +133,10 @@ switch (what) *((uint32_t *)where) = MATCH_LIMIT_DEPTH; break; + case PCRE2_CONFIG_EFFECTIVE_LINKSIZE: + *((uint32_t *)where) = LINK_SIZE * sizeof(PCRE2_UCHAR); + break; + case PCRE2_CONFIG_HEAPLIMIT: *((uint32_t *)where) = HEAP_LIMIT; break; @@ -163,7 +161,7 @@ switch (what) #endif case PCRE2_CONFIG_LINKSIZE: - *((uint32_t *)where) = (uint32_t)configured_link_size; + *((uint32_t *)where) = (uint32_t)CONFIGURED_LINK_SIZE; break; case PCRE2_CONFIG_MATCHLIMIT: @@ -206,8 +204,7 @@ switch (what) #endif return (int)(1 + ((where == NULL)? strlen(v) : PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v))); - } - break; + } case PCRE2_CONFIG_UNICODE: #if defined SUPPORT_UNICODE @@ -224,8 +221,8 @@ switch (what) XSTRING when PCRE2_PRERELEASE is not empty, an unwanted space is inserted. There are problems using an "obvious" approach like this: - XSTRING(PCRE2_MAJOR) "." XSTRING(PCRE_MINOR) - XSTRING(PCRE2_PRERELEASE) " " XSTRING(PCRE_DATE) + XSTRING(PCRE2_MAJOR) "." XSTRING(PCRE2_MINOR) + XSTRING(PCRE2_PRERELEASE) " " XSTRING(PCRE2_DATE) because, when PCRE2_PRERELEASE is empty, this leads to an attempted expansion of STRING(). The C standard states: "If (before argument substitution) any @@ -244,6 +241,7 @@ switch (what) return (int)(1 + ((where == NULL)? strlen(v) : PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v))); } + } return 0; diff --git a/std/regex/pcre2/pcre2_context.c b/std/regex/pcre2/pcre2_context.c index 9edbd1b2a..6246683df 100644 --- a/std/regex/pcre2/pcre2_context.c +++ b/std/regex/pcre2/pcre2_context.c @@ -39,10 +39,6 @@ POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" @@ -130,7 +126,7 @@ return gcontext; /* A default compile context is set up to save having to initialize at run time when no context is supplied to the compile function. */ -const pcre2_compile_context PRIV(default_compile_context) = { +pcre2_compile_context PRIV(default_compile_context) = { { default_malloc, default_free, NULL }, /* Default memory handling */ NULL, /* Stack guard */ NULL, /* Stack guard data */ @@ -141,7 +137,8 @@ const pcre2_compile_context PRIV(default_compile_context) = { NEWLINE_DEFAULT, /* Newline convention */ PARENS_NEST_LIMIT, /* As it says */ 0, /* Extra options */ - MAX_VARLOOKBEHIND /* As it says */ + MAX_VARLOOKBEHIND, /* As it says */ + PCRE2_OPTIMIZATION_ALL /* All optimizations enabled */ }; /* The create function copies the default into the new memory, but must @@ -163,7 +160,7 @@ return ccontext; /* A default match context is set up to save having to initialize at run time when no context is supplied to a match function. */ -const pcre2_match_context PRIV(default_match_context) = { +pcre2_match_context PRIV(default_match_context) = { { default_malloc, default_free, NULL }, #ifdef SUPPORT_JIT NULL, /* JIT callback */ @@ -173,6 +170,8 @@ const pcre2_match_context PRIV(default_match_context) = { NULL, /* Callout data */ NULL, /* Substitute callout function */ NULL, /* Substitute callout data */ + NULL, /* Substitute case callout function */ + NULL, /* Substitute case callout data */ PCRE2_UNSET, /* Offset limit */ HEAP_LIMIT, MATCH_LIMIT, @@ -197,7 +196,7 @@ return mcontext; /* A default convert context is set up to save having to initialize at run time when no context is supplied to the convert function. */ -const pcre2_convert_context PRIV(default_convert_context) = { +pcre2_convert_context PRIV(default_convert_context) = { { default_malloc, default_free, NULL }, /* Default memory handling */ #ifdef _WIN32 CHAR_BACKSLASH, /* Default path separator */ @@ -409,6 +408,38 @@ ccontext->stack_guard_data = user_data; return 0; } +PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION +pcre2_set_optimize(pcre2_compile_context *ccontext, uint32_t directive) +{ +if (ccontext == NULL) + return PCRE2_ERROR_NULL; + +switch (directive) + { + case PCRE2_OPTIMIZATION_NONE: + ccontext->optimization_flags = 0; + break; + + case PCRE2_OPTIMIZATION_FULL: + ccontext->optimization_flags = PCRE2_OPTIMIZATION_ALL; + break; + + default: + if (directive >= PCRE2_AUTO_POSSESS && directive <= PCRE2_START_OPTIMIZE_OFF) + { + /* Even directive numbers starting from 64 switch a bit on; + * Odd directive numbers starting from 65 switch a bit off */ + if ((directive & 1) != 0) + ccontext->optimization_flags &= ~(1u << ((directive >> 1) - 32)); + else + ccontext->optimization_flags |= 1u << ((directive >> 1) - 32); + return 0; + } + return PCRE2_ERROR_BADOPTION; + } + +return 0; +} /* ------------ Match context ------------ */ @@ -424,13 +455,24 @@ return 0; PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION pcre2_set_substitute_callout(pcre2_match_context *mcontext, int (*substitute_callout)(pcre2_substitute_callout_block *, void *), - void *substitute_callout_data) + void *substitute_callout_data) { mcontext->substitute_callout = substitute_callout; mcontext->substitute_callout_data = substitute_callout_data; return 0; } +PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION +pcre2_set_substitute_case_callout(pcre2_match_context *mcontext, + PCRE2_SIZE (*substitute_case_callout)(PCRE2_SPTR, PCRE2_SIZE, PCRE2_UCHAR *, + PCRE2_SIZE, int, void *), + void *substitute_case_callout_data) +{ +mcontext->substitute_case_callout = substitute_case_callout; +mcontext->substitute_case_callout_data = substitute_case_callout_data; +return 0; +} + PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION pcre2_set_heap_limit(pcre2_match_context *mcontext, uint32_t limit) { @@ -460,10 +502,7 @@ return 0; } /* These functions became obsolete at release 10.30. The first is kept as a -synonym for backwards compatibility. The second now does nothing. Exclude both -from coverage reports. */ - -/* LCOV_EXCL_START */ +synonym for backwards compatibility. The second now does nothing. */ PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION pcre2_set_recursion_limit(pcre2_match_context *mcontext, uint32_t limit) @@ -483,8 +522,6 @@ pcre2_set_recursion_memory_management(pcre2_match_context *mcontext, return 0; } -/* LCOV_EXCL_STOP */ - /* ------------ Convert context ------------ */ @@ -497,10 +534,20 @@ ccontext->glob_separator = separator; return 0; } +static const char *globpunct = + STR_EXCLAMATION_MARK STR_QUOTATION_MARK STR_NUMBER_SIGN STR_DOLLAR_SIGN + STR_PERCENT_SIGN STR_AMPERSAND STR_APOSTROPHE STR_LEFT_PARENTHESIS + STR_RIGHT_PARENTHESIS STR_ASTERISK STR_PLUS STR_COMMA STR_MINUS STR_DOT + STR_SLASH STR_COLON STR_SEMICOLON STR_LESS_THAN_SIGN STR_EQUALS_SIGN + STR_GREATER_THAN_SIGN STR_QUESTION_MARK STR_COMMERCIAL_AT + STR_LEFT_SQUARE_BRACKET STR_BACKSLASH STR_RIGHT_SQUARE_BRACKET + STR_CIRCUMFLEX_ACCENT STR_UNDERSCORE STR_GRAVE_ACCENT STR_LEFT_CURLY_BRACKET + STR_VERTICAL_LINE STR_RIGHT_CURLY_BRACKET STR_TILDE; + PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION pcre2_set_glob_escape(pcre2_convert_context *ccontext, uint32_t escape) { -if (escape > 255 || (escape != 0 && !ispunct(escape))) +if (escape > 255 || (escape != 0 && strchr(globpunct, escape) == NULL)) return PCRE2_ERROR_BADDATA; ccontext->glob_escape = escape; return 0; diff --git a/std/regex/pcre2/pcre2_convert.c b/std/regex/pcre2/pcre2_convert.c index fe396ae4f..8a2b293d5 100644 --- a/std/regex/pcre2/pcre2_convert.c +++ b/std/regex/pcre2/pcre2_convert.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2022 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -39,12 +39,10 @@ POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" + + #define TYPE_OPTIONS (PCRE2_CONVERT_GLOB| \ PCRE2_CONVERT_POSIX_BASIC|PCRE2_CONVERT_POSIX_EXTENDED) @@ -74,13 +72,23 @@ enum { POSIX_START_REGEX, POSIX_ANCHORED, POSIX_NOT_BRACKET, #define PUTCHARS(string) \ { \ - for (s = (char *)(string); *s != 0; s++) \ + for (const char *s = string; *s != 0; s++) \ { \ if (p >= endp) return PCRE2_ERROR_NOMEMORY; \ *p++ = *s; \ } \ } +/* Macro to check for lowercase characters. */ + +#ifdef EBCDIC +#define ISLOWER(c) (((c) >= CHAR_a && (c) <= CHAR_i) || \ + ((c) >= CHAR_j && (c) <= CHAR_r) || \ + ((c) >= CHAR_s && (c) <= CHAR_z)) +#else +#define ISLOWER(c) ((c) >= CHAR_a && (c) <= CHAR_z) +#endif + /* Literals that must be escaped: \ ? * + | . ^ $ { } [ ] ( ) */ static const char *pcre2_escaped_literals = @@ -97,6 +105,24 @@ static const char *posix_meta_escapes = STR_LEFT_CURLY_BRACKET STR_RIGHT_CURLY_BRACKET STR_1 STR_2 STR_3 STR_4 STR_5 STR_6 STR_7 STR_8 STR_9; +/* Recognized POSIX classes, colon-separated. */ + +static const char *posix_classes = + STR_a STR_l STR_p STR_h STR_a STR_COLON + STR_l STR_o STR_w STR_e STR_r STR_COLON + STR_u STR_p STR_p STR_e STR_r STR_COLON + STR_a STR_l STR_n STR_u STR_m STR_COLON + STR_a STR_s STR_c STR_i STR_i STR_COLON + STR_b STR_l STR_a STR_n STR_k STR_COLON + STR_c STR_n STR_t STR_r STR_l STR_COLON + STR_d STR_i STR_g STR_i STR_t STR_COLON + STR_g STR_r STR_a STR_p STR_h STR_COLON + STR_p STR_r STR_i STR_n STR_t STR_COLON + STR_p STR_u STR_n STR_c STR_t STR_COLON + STR_s STR_p STR_a STR_c STR_e STR_COLON + STR_w STR_o STR_r STR_d STR_COLON + STR_x STR_d STR_i STR_g STR_i STR_t STR_COLON; + /************************************************* @@ -125,7 +151,6 @@ convert_posix(uint32_t pattype, PCRE2_SPTR pattern, PCRE2_SIZE plength, BOOL utf, PCRE2_UCHAR *use_buffer, PCRE2_SIZE use_length, PCRE2_SIZE *bufflenptr, BOOL dummyrun, pcre2_convert_context *ccontext) { -char *s; PCRE2_SPTR posix = pattern; PCRE2_UCHAR *p = use_buffer; PCRE2_UCHAR *pp = p; @@ -191,7 +216,7 @@ while (plength > 0) switch (posix_state) { case POSIX_CLASS_STARTED: - if (c <= 127 && islower(c)) break; /* Remain in started state */ + if (ISLOWER(c)) break; /* Remain in started state */ posix_state = POSIX_CLASS_NOT_STARTED; if (c == CHAR_COLON && plength > 0 && *posix == CHAR_RIGHT_SQUARE_BRACKET) @@ -201,7 +226,7 @@ while (plength > 0) posix++; continue; /* With next character after :] */ } - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case POSIX_CLASS_NOT_STARTED: if (c == CHAR_LEFT_SQUARE_BRACKET) @@ -278,9 +303,9 @@ while (plength > 0) if (plength == 0) return PCRE2_ERROR_END_BACKSLASH; if (extended) nextisliteral = TRUE; else { - if (*posix < 127 && strchr(posix_meta_escapes, *posix) != NULL) + if (*posix < 255 && strchr(posix_meta_escapes, *posix) != NULL) { - if (isdigit(*posix)) PUTCHARS(STR_BACKSLASH); + if (*posix >= CHAR_0 && *posix <= CHAR_9) PUTCHARS(STR_BACKSLASH); if (p + 1 > endp) return PCRE2_ERROR_NOMEMORY; lastspecial = *p++ = *posix++; plength--; @@ -296,7 +321,7 @@ while (plength > 0) case CHAR_LEFT_PARENTHESIS: bracount++; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case CHAR_QUESTION_MARK: case CHAR_PLUS: @@ -304,7 +329,7 @@ while (plength > 0) case CHAR_RIGHT_CURLY_BRACKET: case CHAR_VERTICAL_LINE: if (!extended) goto ESCAPE_LITERAL; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case CHAR_DOT: case CHAR_DOLLAR_SIGN: @@ -333,10 +358,10 @@ while (plength > 0) posix_state = POSIX_ANCHORED; goto COPY_SPECIAL; } - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ default: - if (c < 128 && strchr(pcre2_escaped_literals, c) != NULL) + if (c < 255 && strchr(pcre2_escaped_literals, c) != NULL) { ESCAPE_LITERAL: PUTCHARS(STR_BACKSLASH); @@ -475,8 +500,6 @@ static int convert_glob_parse_class(PCRE2_SPTR *from, PCRE2_SPTR pattern_end, pcre2_output_context *out) { -static const char *posix_classes = "alnum:alpha:ascii:blank:cntrl:digit:" - "graph:lower:print:punct:space:upper:word:xdigit:"; PCRE2_SPTR start = *from + 1; PCRE2_SPTR pattern = start; const char *class_ptr; @@ -501,7 +524,7 @@ class_index = 1; while (TRUE) { - if (*class_ptr == CHAR_NUL) return 0; + if (*class_ptr == 0) return 0; pattern = start; @@ -540,31 +563,61 @@ Returns: !0 => character is found in the class static BOOL convert_glob_char_in_class(int class_index, PCRE2_UCHAR c) { +const uint8_t *cbits = PRIV(default_tables) + cbits_offset; +int cbit; + #if PCRE2_CODE_UNIT_WIDTH != 8 if (c > 0xff) { - /* ctype functions are not sane for c > 0xff */ - return 0; + /* Can't access the character tables for c > 0xff */ + return FALSE; } #endif +/* See posix_class_maps. This is a small local clone of that. +Note that we don't know exactly what character tables will be used at +match time, but, for the purposes of pattern conversion, it should be +sufficient to use PCRE2's built-in default tables. */ + switch (class_index) { - case 1: return isalnum(c); - case 2: return isalpha(c); - case 3: return 1; - case 4: return c == CHAR_HT || c == CHAR_SPACE; - case 5: return iscntrl(c); - case 6: return isdigit(c); - case 7: return isgraph(c); - case 8: return islower(c); - case 9: return isprint(c); - case 10: return ispunct(c); - case 11: return isspace(c); - case 12: return isupper(c); - case 13: return isalnum(c) || c == CHAR_UNDERSCORE; - default: return isxdigit(c); + case 1: /* alpha */ + if (c == CHAR_UNDERSCORE) return FALSE; + if (((cbits + cbit_digit)[c/8] & (1u << (c&7))) != 0) return FALSE; + cbit = cbit_word; + break; + + case 2: cbit = cbit_lower; break; /* lower */ + case 3: cbit = cbit_upper; break; /* upper */ + + case 4: /* alnum */ + if (c == CHAR_UNDERSCORE) return FALSE; + cbit = cbit_word; + break; + + case 5: /* ascii */ + if (((cbits + cbit_cntrl)[c/8] & (1u << (c&7))) != 0) return TRUE; + cbit = cbit_print; + break; + + case 6: /* blank */ + if (c == CHAR_LF || c == CHAR_VT || c == CHAR_FF || c == CHAR_CR) + return FALSE; + cbit = cbit_space; + break; + + case 7: cbit = cbit_cntrl; break; /* cntrl */ + case 8: cbit = cbit_digit; break; /* digit */ + case 9: cbit = cbit_graph; break; /* graph */ + case 10: cbit = cbit_print; break; /* print */ + case 11: cbit = cbit_punct; break; /* punct */ + case 12: cbit = cbit_space; break; /* space */ + case 13: cbit = cbit_word; break; /* word */ + case 14: cbit = cbit_xdigit; break; /* xdigit */ + default: return FALSE; } + +return ((cbits + cbit)[c/8] & (1u << (c&7))) != 0; } /* Parse a range of characters. @@ -1006,7 +1059,7 @@ while (pattern < pattern_end) c = *pattern++; } - if (c < 128 && strchr(pcre2_escaped_literals, c) != NULL) + if (c < 255 && strchr(pcre2_escaped_literals, c) != NULL) convert_glob_write(&out, CHAR_BACKSLASH); convert_glob_write(&out, c); @@ -1065,14 +1118,22 @@ pcre2_pattern_convert(PCRE2_SPTR pattern, PCRE2_SIZE plength, uint32_t options, PCRE2_UCHAR **buffptr, PCRE2_SIZE *bufflenptr, pcre2_convert_context *ccontext) { -int i, rc; +int rc; +PCRE2_UCHAR null_str[1] = { 0xcd }; PCRE2_UCHAR dummy_buffer[DUMMY_BUFFER_SIZE]; PCRE2_UCHAR *use_buffer = dummy_buffer; PCRE2_SIZE use_length = DUMMY_BUFFER_SIZE; BOOL utf = (options & PCRE2_CONVERT_UTF) != 0; uint32_t pattype = options & TYPE_OPTIONS; -if (pattern == NULL || bufflenptr == NULL) return PCRE2_ERROR_NULL; +if (pattern == NULL && plength == 0) + pattern = null_str; + +if (pattern == NULL || bufflenptr == NULL) + { + if (bufflenptr != NULL) *bufflenptr = 0; /* Error offset */ + return PCRE2_ERROR_NULL; + } if ((options & ~ALL_OPTIONS) != 0 || /* Undefined bit set */ (pattype & (~pattype+1)) != pattype || /* More than one type set */ @@ -1119,7 +1180,7 @@ if (buffptr != NULL && *buffptr != NULL) /* Call an individual converter, either just once (if a buffer was provided or just the length is needed), or twice (if a memory allocation is required). */ -for (i = 0; i < 2; i++) +for (int i = 0; i < 2; i++) { PCRE2_UCHAR *allocated; BOOL dummyrun = buffptr == NULL || *buffptr == NULL; @@ -1137,9 +1198,13 @@ for (i = 0; i < 2; i++) bufflenptr, dummyrun, ccontext); break; + /* We have already validated pattype. */ + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); *bufflenptr = 0; /* Error offset */ return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } if (rc != 0 || /* Error */ @@ -1150,18 +1215,27 @@ for (i = 0; i < 2; i++) /* Allocate memory for the buffer, with hidden space for an allocator at the start. The next time round the loop runs the conversion for real. */ - allocated = PRIV(memctl_malloc)(sizeof(pcre2_memctl) + - (*bufflenptr + 1)*PCRE2_CODE_UNIT_WIDTH, (pcre2_memctl *)ccontext); - if (allocated == NULL) return PCRE2_ERROR_NOMEMORY; + if (*bufflenptr > ((PCRE2_SIZE_MAX - sizeof(pcre2_memctl)) / + CU2BYTES(1)) - 1 || + (allocated = PRIV(memctl_malloc)(sizeof(pcre2_memctl) + + CU2BYTES(*bufflenptr + 1), + (pcre2_memctl *)ccontext)) == NULL) + { + *bufflenptr = 0; /* Error offset */ + return PCRE2_ERROR_NOMEMORY; + } *buffptr = (PCRE2_UCHAR *)(((char *)allocated) + sizeof(pcre2_memctl)); use_buffer = *buffptr; use_length = *bufflenptr + 1; } -/* Control should never get here. */ - +/* Running the loop above ought to have succeeded the second time. */ +/* LCOV_EXCL_START */ +PCRE2_DEBUG_UNREACHABLE(); +*bufflenptr = 0; /* Error offset */ return PCRE2_ERROR_INTERNAL; +/* LCOV_EXCL_STOP */ } diff --git a/std/regex/pcre2/pcre2_dfa_match.c b/std/regex/pcre2/pcre2_dfa_match.c index caae65248..8e9512c4e 100644 --- a/std/regex/pcre2/pcre2_dfa_match.c +++ b/std/regex/pcre2/pcre2_dfa_match.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2023 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -72,16 +72,14 @@ Overall, I concluded that the gains in some cases did not outweigh the losses in others, so I abandoned this code. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "pcre2_internal.h" + + #define NLBLOCK mb /* Block containing newline information */ #define PSSTART start_subject /* Field containing processed string start */ #define PSEND end_subject /* Field containing processed string end */ -#include "pcre2_internal.h" - #define PUBLIC_DFA_MATCH_OPTIONS \ (PCRE2_ANCHORED|PCRE2_ENDANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \ PCRE2_NOTEMPTY_ATSTART|PCRE2_NO_UTF_CHECK|PCRE2_PARTIAL_HARD| \ @@ -156,6 +154,7 @@ static const uint8_t coptable[] = { 0, /* CLASS */ 0, /* NCLASS */ 0, /* XCLASS - variable length */ + 0, /* ECLASS - variable length */ 0, /* REF */ 0, /* REFI */ 0, /* DNREF */ @@ -175,6 +174,7 @@ static const uint8_t coptable[] = { 0, /* Assert behind not */ 0, /* NA assert */ 0, /* NA assert behind */ + 0, /* Assert scan substring */ 0, /* ONCE */ 0, /* SCRIPT_RUN */ 0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */ @@ -188,7 +188,7 @@ static const uint8_t coptable[] = { 0, 0, /* COMMIT, COMMIT_ARG */ 0, 0, 0, /* FAIL, ACCEPT, ASSERT_ACCEPT */ 0, 0, 0, /* CLOSE, SKIPZERO, DEFINE */ - 0, 0 /* \B and \b in UCP mode */ + 0, 0, /* \B and \b in UCP mode */ }; /* This table identifies those opcodes that inspect a character. It is used to @@ -234,6 +234,7 @@ static const uint8_t poptable[] = { 1, /* CLASS */ 1, /* NCLASS */ 1, /* XCLASS - variable length */ + 1, /* ECLASS - variable length */ 0, /* REF */ 0, /* REFI */ 0, /* DNREF */ @@ -253,6 +254,7 @@ static const uint8_t poptable[] = { 0, /* Assert behind not */ 0, /* NA assert */ 0, /* NA assert behind */ + 0, /* Assert scan substring */ 0, /* ONCE */ 0, /* SCRIPT_RUN */ 0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */ @@ -266,9 +268,13 @@ static const uint8_t poptable[] = { 0, 0, /* COMMIT, COMMIT_ARG */ 0, 0, 0, /* FAIL, ACCEPT, ASSERT_ACCEPT */ 0, 0, 0, /* CLOSE, SKIPZERO, DEFINE */ - 1, 1 /* \B and \b in UCP mode */ + 1, 1, /* \B and \b in UCP mode */ }; +/* Compile-time check that these tables have the correct size. */ +STATIC_ASSERT(sizeof(coptable) == OP_TABLE_LENGTH, coptable); +STATIC_ASSERT(sizeof(poptable) == OP_TABLE_LENGTH, poptable); + /* These 2 tables allow for compact code for testing for \D, \d, \S, \s, \W, and \w */ @@ -399,8 +405,8 @@ return (mb->callout)(cb, mb->callout_data); /* This function is called when internal_dfa_match() is about to be called recursively and there is insufficient working space left in the current -workspace block. If there's an existing next block, use it; otherwise get a new -block unless the heap limit is reached. +workspace block. If there's a sufficiently large next block, use it; get a new +block unless the heap limit is (or has been) reached. Arguments: rwsptr pointer to block pointer (updated) @@ -416,9 +422,18 @@ more_workspace(RWS_anchor **rwsptr, unsigned int ovecsize, dfa_match_block *mb) { RWS_anchor *rws = *rwsptr; RWS_anchor *new; +uint32_t requested; + +PCRE2_ASSERT(ovecsize <= UINT32_MAX - RWS_RSIZE - RWS_ANCHOR_SIZE); +requested = RWS_RSIZE + ovecsize + RWS_ANCHOR_SIZE; if (rws->next != NULL) { + /* Although the initial block is large, and subsequent ones try to double, the + heap limit may cause the last one to be smaller; in this case, we have already + hit the heap limit and allocating a larger block will not be possible. */ + if (rws->next->size < requested) + return PCRE2_ERROR_HEAPLIMIT; new = rws->next; } @@ -428,14 +443,30 @@ overflow. */ else { - uint32_t newsize = (rws->size >= UINT32_MAX/(sizeof(int)*2))? UINT32_MAX/sizeof(int) : rws->size * 2; + uint32_t newsize = (rws->size >= (UINT32_MAX/sizeof(int))/2)? + UINT32_MAX/sizeof(int) : rws->size * 2; uint32_t newsizeK = newsize/(1024/sizeof(int)); - if (newsizeK + mb->heap_used > mb->heap_limit) - newsizeK = (uint32_t)(mb->heap_limit - mb->heap_used); - newsize = newsizeK*(1024/sizeof(int)); + /* Clamp the allocation to the remaining heap allowance with care for overflows */ + + if (mb->heap_used >= mb->heap_limit) + { + newsize = 0; + newsizeK = 0; + } + else + { + PCRE2_SIZE availableK = mb->heap_limit - mb->heap_used; + /* newsize always capped at UINT32_MAX/sizeof(int), so newsizeK also capped; + and - if availableK is smaller - then multiplication to form newsize is safe */ + if (newsizeK > availableK) + { + newsize = (uint32_t)(availableK*(1024/sizeof(int))); + newsizeK = availableK; + } + } - if (newsize < RWS_RSIZE + ovecsize + RWS_ANCHOR_SIZE) + if (newsize < requested) return PCRE2_ERROR_HEAPLIMIT; new = mb->memctl.malloc(newsize*sizeof(int), mb->memctl.memory_data); if (new == NULL) return PCRE2_ERROR_NOMEMORY; @@ -695,7 +726,6 @@ for (;;) int i, j; int clen, dlen; uint32_t c, d; - int forced_fail = 0; BOOL partial_newline = FALSE; BOOL could_continue = reset_could_continue; reset_could_continue = FALSE; @@ -841,19 +871,6 @@ for (;;) switch (codevalue) { -/* ========================================================================== */ - /* These cases are never obeyed. This is a fudge that causes a compile- - time error if the vectors coptable or poptable, which are indexed by - opcode, are not the correct length. It seems to be the only way to do - such a check at compile time, as the sizeof() operator does not work - in the C preprocessor. */ - - case OP_TABLE_LENGTH: - case OP_TABLE_LENGTH + - ((sizeof(coptable) == OP_TABLE_LENGTH) && - (sizeof(poptable) == OP_TABLE_LENGTH)): - return 0; - /* ========================================================================== */ /* Reached a closing bracket. If not at the end of the pattern, carry on with the next opcode. For repeating opcodes, also add the repeat @@ -1179,10 +1196,6 @@ for (;;) const ucd_record * prop = GET_UCD(c); switch(code[1]) { - case PT_ANY: - OK = TRUE; - break; - case PT_LAMP: chartype = prop->chartype; OK = chartype == ucp_Lu || chartype == ucp_Ll || @@ -1462,10 +1475,6 @@ for (;;) const ucd_record * prop = GET_UCD(c); switch(code[2]) { - case PT_ANY: - OK = TRUE; - break; - case PT_LAMP: chartype = prop->chartype; OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt; @@ -1617,7 +1626,7 @@ for (;;) goto ANYNL01; case CHAR_CR: - if (ptr + 1 < end_subject && UCHAR21TEST(ptr + 1) == CHAR_LF) ncount = 1; + if (ptr + 1 < end_subject && ptr[1] == CHAR_LF) ncount = 1; /* Fall through */ ANYNL01: @@ -1727,10 +1736,6 @@ for (;;) const ucd_record * prop = GET_UCD(c); switch(code[2]) { - case PT_ANY: - OK = TRUE; - break; - case PT_LAMP: chartype = prop->chartype; OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt; @@ -1899,7 +1904,7 @@ for (;;) goto ANYNL02; case CHAR_CR: - if (ptr + 1 < end_subject && UCHAR21TEST(ptr + 1) == CHAR_LF) ncount = 1; + if (ptr + 1 < end_subject && ptr[1] == CHAR_LF) ncount = 1; /* Fall through */ ANYNL02: @@ -2017,10 +2022,6 @@ for (;;) const ucd_record * prop = GET_UCD(c); switch(code[1 + IMM2_SIZE + 1]) { - case PT_ANY: - OK = TRUE; - break; - case PT_LAMP: chartype = prop->chartype; OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt; @@ -2184,7 +2185,7 @@ for (;;) goto ANYNL03; case CHAR_CR: - if (ptr + 1 < end_subject && UCHAR21TEST(ptr + 1) == CHAR_LF) ncount = 1; + if (ptr + 1 < end_subject && ptr[1] == CHAR_LF) ncount = 1; /* Fall through */ ANYNL03: @@ -2352,7 +2353,7 @@ for (;;) case 0x2029: #endif /* Not EBCDIC */ if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) break; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case CHAR_LF: ADD_NEW(state_offset + 1, 0); @@ -2365,7 +2366,7 @@ for (;;) if ((mb->moptions & PCRE2_PARTIAL_HARD) != 0) reset_could_continue = TRUE; } - else if (UCHAR21TEST(ptr + 1) == CHAR_LF) + else if (ptr[1] == CHAR_LF) { ADD_NEW_DATA(-(state_offset + 1), 0, 1); } @@ -2464,7 +2465,7 @@ for (;;) caseless = TRUE; codevalue -= OP_STARI - OP_STAR; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_PLUS: case OP_MINPLUS: case OP_POSPLUS: @@ -2508,7 +2509,7 @@ for (;;) case OP_NOTPOSQUERYI: caseless = TRUE; codevalue -= OP_STARI - OP_STAR; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_QUERY: case OP_MINQUERY: case OP_POSQUERY: @@ -2549,7 +2550,7 @@ for (;;) case OP_NOTPOSSTARI: caseless = TRUE; codevalue -= OP_STARI - OP_STAR; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_STAR: case OP_MINSTAR: case OP_POSSTAR: @@ -2586,7 +2587,7 @@ for (;;) case OP_NOTEXACTI: caseless = TRUE; codevalue -= OP_STARI - OP_STAR; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_EXACT: case OP_NOTEXACT: count = current_state->count; /* Number already matched */ @@ -2621,7 +2622,7 @@ for (;;) case OP_NOTPOSUPTOI: caseless = TRUE; codevalue -= OP_STARI - OP_STAR; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_UPTO: case OP_MINUPTO: case OP_POSUPTO: @@ -2663,35 +2664,54 @@ for (;;) case OP_CLASS: case OP_NCLASS: +#ifdef SUPPORT_WIDE_CHARS case OP_XCLASS: + case OP_ECLASS: +#endif { BOOL isinclass = FALSE; int next_state_offset; PCRE2_SPTR ecode; +#ifdef SUPPORT_WIDE_CHARS + /* An extended class may have a table or a list of single characters, + ranges, or both, and it may be positive or negative. There's a + function that sorts all this out. */ + + if (codevalue == OP_XCLASS) + { + ecode = code + GET(code, 1); + if (clen > 0) + isinclass = PRIV(xclass)(c, code + 1 + LINK_SIZE, + (const uint8_t*)mb->start_code, utf); + } + + /* A nested set-based class has internal opcodes for performing + set operations. */ + + else if (codevalue == OP_ECLASS) + { + ecode = code + GET(code, 1); + if (clen > 0) + isinclass = PRIV(eclass)(c, code + 1 + LINK_SIZE, ecode, + (const uint8_t*)mb->start_code, utf); + } + + else +#endif /* SUPPORT_WIDE_CHARS */ + /* For a simple class, there is always just a 32-byte table, and we can set isinclass from it. */ - if (codevalue != OP_XCLASS) { ecode = code + 1 + (32 / sizeof(PCRE2_UCHAR)); if (clen > 0) { isinclass = (c > 255)? (codevalue == OP_NCLASS) : - ((((uint8_t *)(code + 1))[c/8] & (1u << (c&7))) != 0); + ((((const uint8_t *)(code + 1))[c/8] & (1u << (c&7))) != 0); } } - /* An extended class may have a table or a list of single characters, - ranges, or both, and it may be positive or negative. There's a - function that sorts all this out. */ - - else - { - ecode = code + GET(code, 1); - if (clen > 0) isinclass = PRIV(xclass)(c, code + 1 + LINK_SIZE, utf); - } - /* At this point, isinclass is set for all kinds of class, and ecode points to the byte after the end of the class. If there is a quantifier, this is where it will be. */ @@ -2784,7 +2804,6 @@ for (;;) though the other "backtracking verbs" are not supported. */ case OP_FAIL: - forced_fail++; /* Count FAILs for multiple states */ break; case OP_ASSERT: @@ -2807,6 +2826,7 @@ for (;;) local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); local_workspace = ((int *)local_offsets) + RWS_OVEC_OSIZE; + PCRE2_ASSERT(rws->free >= RWS_RSIZE + RWS_OVEC_OSIZE); rws->free -= RWS_RSIZE + RWS_OVEC_OSIZE; while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1); @@ -2906,6 +2926,7 @@ for (;;) local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); local_workspace = ((int *)local_offsets) + RWS_OVEC_OSIZE; + PCRE2_ASSERT(rws->free >= RWS_RSIZE + RWS_OVEC_OSIZE); rws->free -= RWS_RSIZE + RWS_OVEC_OSIZE; while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1); @@ -2945,6 +2966,9 @@ for (;;) uint32_t recno = (callpat == mb->start_code)? 0 : GET2(callpat, 1 + LINK_SIZE); + /* Argument list has not been supported yet. */ + if (code[1 + LINK_SIZE] == OP_CREF) return PCRE2_ERROR_DFA_UITEM; + if (rws->free < RWS_RSIZE + RWS_OVEC_RSIZE) { rc = more_workspace(&rws, RWS_OVEC_RSIZE, mb); @@ -2954,6 +2978,7 @@ for (;;) local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); local_workspace = ((int *)local_offsets) + RWS_OVEC_RSIZE; + PCRE2_ASSERT(rws->free >= RWS_RSIZE + RWS_OVEC_RSIZE); rws->free -= RWS_RSIZE + RWS_OVEC_RSIZE; /* Check for repeating a recursion without advancing the subject @@ -3053,12 +3078,13 @@ for (;;) local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); local_workspace = ((int *)local_offsets) + RWS_OVEC_OSIZE; + PCRE2_ASSERT(rws->free >= RWS_RSIZE + RWS_OVEC_OSIZE); rws->free -= RWS_RSIZE + RWS_OVEC_OSIZE; if (codevalue == OP_BRAPOSZERO) { allow_zero = TRUE; - codevalue = *(++code); /* Codevalue will be one of above BRAs */ + ++code; /* The following opcode will be one of the above BRAs */ } else allow_zero = FALSE; @@ -3152,6 +3178,7 @@ for (;;) local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); local_workspace = ((int *)local_offsets) + RWS_OVEC_OSIZE; + PCRE2_ASSERT(rws->free >= RWS_RSIZE + RWS_OVEC_OSIZE); rws->free -= RWS_RSIZE + RWS_OVEC_OSIZE; rc = internal_dfa_match( @@ -3271,18 +3298,12 @@ for (;;) matches that we are going to find. If partial matching has been requested, check for appropriate conditions. - The "forced_ fail" variable counts the number of (*F) encountered for the - character. If it is equal to the original active_count (saved in - workspace[1]) it means that (*F) was found on every active state. In this - case we don't want to give a partial match. - The "could_continue" variable is true if a state could have continued but for the fact that the end of the subject was reached. */ if (new_count <= 0) { if (could_continue && /* Some could go on, and */ - forced_fail != workspace[1] && /* Not all forced fail & */ ( /* either... */ (mb->moptions & PCRE2_PARTIAL_HARD) != 0 /* Hard partial */ || /* or... */ @@ -3351,10 +3372,12 @@ pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length, pcre2_match_context *mcontext, int *workspace, PCRE2_SIZE wscount) { int rc; -int was_zero_terminated = 0; const pcre2_real_code *re = (const pcre2_real_code *)code; +uint32_t original_options = options; +PCRE2_UCHAR null_str[1] = { 0xcd }; +PCRE2_SPTR original_subject = subject; PCRE2_SPTR start_match; PCRE2_SPTR end_subject; PCRE2_SPTR bumpalong_limit; @@ -3396,49 +3419,51 @@ rws->free = RWS_BASE_SIZE - RWS_ANCHOR_SIZE; /* Recognize NULL, length 0 as an empty string. */ -if (subject == NULL && length == 0) subject = (PCRE2_SPTR)""; +if (subject == NULL && length == 0) subject = null_str; /* Plausibility checks */ -if ((options & ~PUBLIC_DFA_MATCH_OPTIONS) != 0) return PCRE2_ERROR_BADOPTION; -if (re == NULL || subject == NULL || workspace == NULL || match_data == NULL) - return PCRE2_ERROR_NULL; +if (match_data == NULL) return PCRE2_ERROR_NULL; +if (re == NULL || subject == NULL || workspace == NULL) + { rc = PCRE2_ERROR_NULL; goto EXIT; } +if ((options & ~PUBLIC_DFA_MATCH_OPTIONS) != 0) + { rc = PCRE2_ERROR_BADOPTION; goto EXIT; } if (length == PCRE2_ZERO_TERMINATED) { length = PRIV(strlen)(subject); - was_zero_terminated = 1; } -if (wscount < 20) return PCRE2_ERROR_DFA_WSSIZE; -if (start_offset > length) return PCRE2_ERROR_BADOFFSET; +if (wscount < 20) { rc = PCRE2_ERROR_DFA_WSSIZE; goto EXIT; } +if (start_offset > length) { rc = PCRE2_ERROR_BADOFFSET; goto EXIT; } /* Partial matching and PCRE2_ENDANCHORED are currently not allowed at the same time. */ if ((options & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) != 0 && ((re->overall_options | options) & PCRE2_ENDANCHORED) != 0) - return PCRE2_ERROR_BADOPTION; + { rc = PCRE2_ERROR_BADOPTION; goto EXIT; } /* Invalid UTF support is not available for DFA matching. */ if ((re->overall_options & PCRE2_MATCH_INVALID_UTF) != 0) - return PCRE2_ERROR_DFA_UINVALID_UTF; + { rc = PCRE2_ERROR_DFA_UINVALID_UTF; goto EXIT; } /* Check that the first field in the block is the magic number. If it is not, return with PCRE2_ERROR_BADMAGIC. */ -if (re->magic_number != MAGIC_NUMBER) return PCRE2_ERROR_BADMAGIC; +if (re->magic_number != MAGIC_NUMBER) + { rc = PCRE2_ERROR_BADMAGIC; goto EXIT; } /* Check the code unit width. */ if ((re->flags & PCRE2_MODE_MASK) != PCRE2_CODE_UNIT_WIDTH/8) - return PCRE2_ERROR_BADMODE; + { rc = PCRE2_ERROR_BADMODE; goto EXIT; } /* PCRE2_NOTEMPTY and PCRE2_NOTEMPTY_ATSTART are match-time flags in the options variable for this function. Users of PCRE2 who are not calling the function directly would like to have a way of setting these flags, in the same -way that they can set pcre2_compile() flags like PCRE2_NO_AUTOPOSSESS with +way that they can set pcre2_compile() flags like PCRE2_NO_AUTO_POSSESS with constructions like (*NO_AUTOPOSSESS). To enable this, (*NOTEMPTY) and (*NOTEMPTY_ATSTART) set bits in the pattern's "flag" function which can now be transferred to the options for this function. The bits are guaranteed to be @@ -3459,8 +3484,8 @@ of the workspace. */ if ((options & PCRE2_DFA_RESTART) != 0) { if ((workspace[0] & (-2)) != 0 || workspace[1] < 1 || - workspace[1] > (int)((wscount - 2)/INTS_PER_STATEBLOCK)) - return PCRE2_ERROR_DFA_BADRESTART; + workspace[1] > (int)((wscount - 2)/INTS_PER_STATEBLOCK)) + { rc = PCRE2_ERROR_DFA_BADRESTART; goto EXIT; } } /* Set some local values */ @@ -3508,7 +3533,7 @@ else if (mcontext->offset_limit != PCRE2_UNSET) { if ((re->overall_options & PCRE2_USE_OFFSET_LIMIT) == 0) - return PCRE2_ERROR_BADOFFSETLIMIT; + { rc = PCRE2_ERROR_BADOFFSETLIMIT; goto EXIT; } bumpalong_limit = subject + mcontext->offset_limit; } mb->callout = mcontext->callout; @@ -3528,8 +3553,7 @@ if (mb->match_limit_depth > re->limit_depth) if (mb->heap_limit > re->limit_heap) mb->heap_limit = re->limit_heap; -mb->start_code = (PCRE2_UCHAR *)((uint8_t *)re + sizeof(pcre2_real_code)) + - re->name_count * re->name_entry_size; +mb->start_code = (PCRE2_SPTR)((const uint8_t *)re + re->code_start); mb->tables = re->tables; mb->start_subject = subject; mb->end_subject = end_subject; @@ -3576,7 +3600,12 @@ switch(re->newline_convention) mb->nltype = NLTYPE_ANYCRLF; break; - default: return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_START */ + default: + PCRE2_DEBUG_UNREACHABLE(); + rc = PCRE2_ERROR_INTERNAL; + goto EXIT; + /* LCOV_EXCL_STOP */ } /* Check a UTF string for validity if required. For 8-bit and 16-bit strings, @@ -3597,7 +3626,7 @@ if (utf && (options & PCRE2_NO_UTF_CHECK) == 0) #if PCRE2_CODE_UNIT_WIDTH != 32 unsigned int i; if (start_match < end_subject && NOT_FIRSTCU(*start_match)) - return PCRE2_ERROR_BADUTFOFFSET; + { rc = PCRE2_ERROR_BADUTFOFFSET; goto EXIT; } for (i = re->max_lookbehind; i > 0 && check_subject > subject; i--) { check_subject--; @@ -3618,12 +3647,12 @@ if (utf && (options & PCRE2_NO_UTF_CHECK) == 0) /* Validate the relevant portion of the subject. After an error, adjust the offset to be an absolute offset in the whole string. */ - match_data->rc = PRIV(valid_utf)(check_subject, + rc = PRIV(valid_utf)(check_subject, length - (PCRE2_SIZE)(check_subject - subject), &(match_data->startchar)); - if (match_data->rc != 0) + if (rc != 0) { match_data->startchar += (PCRE2_SIZE)(check_subject - subject); - return match_data->rc; + goto EXIT; } } #endif /* SUPPORT_UNICODE */ @@ -3687,9 +3716,10 @@ if ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0) /* Fill in fields that are always returned in the match data. */ match_data->code = re; -match_data->subject = NULL; /* Default for no match */ +match_data->subject = NULL; /* Default for match error */ match_data->mark = NULL; match_data->matchedby = PCRE2_MATCHEDBY_DFA_INTERPRETER; +match_data->options = original_options; /* Call the main matching function, looping for a non-anchored regex after a failed match. If not restarting, perform certain optimizations at the start of @@ -3705,7 +3735,7 @@ for (;;) these, for testing and for ensuring that all callouts do actually occur. The optimizations must also be avoided when restarting a DFA match. */ - if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0 && + if ((re->optimization_flags & PCRE2_OPTIM_START_OPTIMIZE) != 0 && (options & PCRE2_DFA_RESTART) == 0) { /* If firstline is TRUE, the start of the match is constrained to the first @@ -3745,7 +3775,7 @@ for (;;) BOOL ok = start_match < end_subject; if (ok) { - PCRE2_UCHAR c = UCHAR21TEST(start_match); + PCRE2_UCHAR c = *start_match; ok = has_first_cu && (c == first_cu || c == first_cu2); if (!ok && start_bits != NULL) { @@ -3773,7 +3803,7 @@ for (;;) #if PCRE2_CODE_UNIT_WIDTH != 8 PCRE2_UCHAR smc; while (start_match < end_subject && - (smc = UCHAR21TEST(start_match)) != first_cu && + (smc = *start_match) != first_cu && smc != first_cu2) start_match++; #else @@ -3833,7 +3863,7 @@ for (;;) else { #if PCRE2_CODE_UNIT_WIDTH != 8 - while (start_match < end_subject && UCHAR21TEST(start_match) != + while (start_match < end_subject && *start_match != first_cu) start_match++; #else /* 8-bit code units */ @@ -3885,7 +3915,7 @@ for (;;) if (start_match[-1] == CHAR_CR && (mb->nltype == NLTYPE_ANY || mb->nltype == NLTYPE_ANYCRLF) && start_match < end_subject && - UCHAR21TEST(start_match) == CHAR_NL) + *start_match == CHAR_NL) start_match++; } } @@ -3899,7 +3929,7 @@ for (;;) { while (start_match < end_subject) { - uint32_t c = UCHAR21TEST(start_match); + uint32_t c = *start_match; #if PCRE2_CODE_UNIT_WIDTH != 8 if (c > 255) c = 255; #endif @@ -3967,7 +3997,7 @@ for (;;) #if PCRE2_CODE_UNIT_WIDTH != 8 while (p < end_subject) { - uint32_t pp = UCHAR21INCTEST(p); + uint32_t pp = *p++; if (pp == req_cu || pp == req_cu2) { p--; break; } } #else /* 8-bit code units */ @@ -3988,7 +4018,7 @@ for (;;) #if PCRE2_CODE_UNIT_WIDTH != 8 while (p < end_subject) { - if (UCHAR21INCTEST(p) == req_cu) { p--; break; } + if (*p++ == req_cu) { p--; break; } } #else /* 8-bit code units */ @@ -4041,29 +4071,40 @@ for (;;) if (rc != PCRE2_ERROR_NOMATCH || anchored) { + if (rc == PCRE2_ERROR_NOMATCH) goto NOMATCH_EXIT; + if (rc == PCRE2_ERROR_PARTIAL && match_data->oveccount > 0) { match_data->ovector[0] = (PCRE2_SIZE)(start_match - subject); match_data->ovector[1] = (PCRE2_SIZE)(end_subject - subject); } - match_data->subject_length = length; - match_data->leftchar = (PCRE2_SIZE)(mb->start_used_ptr - subject); - match_data->rightchar = (PCRE2_SIZE)(mb->last_used_ptr - subject); - match_data->startchar = (PCRE2_SIZE)(start_match - subject); - match_data->rc = rc; - if (rc >= 0 &&(options & PCRE2_COPY_MATCHED_SUBJECT) != 0) + if (rc >= 0 || rc == PCRE2_ERROR_PARTIAL) + { + match_data->subject_length = length; + match_data->start_offset = start_offset; + match_data->leftchar = (PCRE2_SIZE)(mb->start_used_ptr - subject); + match_data->rightchar = (PCRE2_SIZE)(mb->last_used_ptr - subject); + match_data->startchar = (PCRE2_SIZE)(start_match - subject); + } + + if (rc >= 0 && (options & PCRE2_COPY_MATCHED_SUBJECT) != 0) { - length = CU2BYTES(length + was_zero_terminated); - match_data->subject = match_data->memctl.malloc(length, - match_data->memctl.memory_data); - if (match_data->subject == NULL) return PCRE2_ERROR_NOMEMORY; - memcpy((void *)match_data->subject, subject, length); + if (length != 0) + { + match_data->subject = match_data->memctl.malloc(CU2BYTES(length), + match_data->memctl.memory_data); + if (match_data->subject == NULL) + { rc = PCRE2_ERROR_NOMEMORY; goto EXIT; } + memcpy((void *)match_data->subject, subject, CU2BYTES(length)); + } + else + match_data->subject = NULL; match_data->flags |= PCRE2_MD_COPIED_SUBJECT; } - else + else if (rc >= 0 || rc == PCRE2_ERROR_PARTIAL) { - if (rc >= 0 || rc == PCRE2_ERROR_PARTIAL) match_data->subject = subject; + match_data->subject = original_subject; } goto EXIT; } @@ -4085,9 +4126,9 @@ for (;;) not contain any explicit matches for \r or \n, and the newline option is CRLF or ANY or ANYCRLF, advance the match position by one more character. */ - if (UCHAR21TEST(start_match - 1) == CHAR_CR && + if (start_match[-1] == CHAR_CR && start_match < end_subject && - UCHAR21TEST(start_match) == CHAR_NL && + *start_match == CHAR_NL && (re->flags & PCRE2_HASCRORLF) == 0 && (mb->nltype == NLTYPE_ANY || mb->nltype == NLTYPE_ANYCRLF || @@ -4097,6 +4138,9 @@ for (;;) } /* "Bumpalong" loop */ NOMATCH_EXIT: +match_data->subject = original_subject; +match_data->subject_length = length; +match_data->start_offset = start_offset; rc = PCRE2_ERROR_NOMATCH; EXIT: @@ -4107,6 +4151,7 @@ while (rws->next != NULL) mb->memctl.free(next, mb->memctl.memory_data); } +match_data->rc = rc; return rc; } diff --git a/std/regex/pcre2/pcre2_error.c b/std/regex/pcre2/pcre2_error.c index 7fa997aa9..46753f079 100644 --- a/std/regex/pcre2/pcre2_error.c +++ b/std/regex/pcre2/pcre2_error.c @@ -39,12 +39,10 @@ POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" + + #define STRING(a) # a #define XSTRING(s) STRING(s) @@ -96,8 +94,8 @@ static const unsigned char compile_error_texts[] = "length of lookbehind assertion is not limited\0" "a relative value of zero is not allowed\0" "conditional subpattern contains more than two branches\0" - "assertion expected after (?( or (?(?C)\0" - "digit expected after (?+ or (?-\0" + "atomic assertion expected after (?( or (?(?C)\0" + "digit expected after (?+\0" /* 30 */ "unknown POSIX class name\0" "internal error in pcre2_study(): should not occur\0" @@ -148,7 +146,7 @@ static const unsigned char compile_error_texts[] = #ifndef EBCDIC "\\c must be followed by a printable ASCII character\0" #else - "\\c must be followed by a letter or one of [\\]^_?\0" + "\\c must be followed by a letter or one of @[\\]^_?\0" #endif "\\k is not followed by a braced, angle-bracketed, or quoted name\0" /* 70 */ @@ -161,7 +159,7 @@ static const unsigned char compile_error_texts[] = "using UCP is disabled by the application\0" "name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)\0" "character code point value in \\u.... sequence is too large\0" - "digits missing in \\x{} or \\o{} or \\N{U+}\0" + "digits missing after \\x or in \\x{} or \\o{} or \\N{U+}\0" "syntax error or number too big in (?(VERSION condition\0" /* 80 */ "internal error: unknown opcode in auto_possessify()\0" @@ -185,11 +183,34 @@ static const unsigned char compile_error_texts[] = "(*alpha_assertion) not recognized\0" "script runs require Unicode support, which this version of PCRE2 does not have\0" "too many capturing groups (maximum 65535)\0" - "atomic assertion expected after (?( or (?(?C)\0" + "octal digit missing after \\0 (PCRE2_EXTRA_NO_BS0 is set)\0" "\\K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK)\0" /* 100 */ "branch too long in variable-length lookbehind assertion\0" "compiled pattern would be longer than the limit set by the application\0" + "octal value given by \\ddd is greater than \\377 (forbidden by PCRE2_EXTRA_PYTHON_OCTAL)\0" + "using callouts is disabled by the application\0" + "PCRE2_EXTRA_TURKISH_CASING require Unicode (UTF or UCP) mode\0" + /* 105 */ + "PCRE2_EXTRA_TURKISH_CASING requires UTF in 8-bit mode\0" + "PCRE2_EXTRA_TURKISH_CASING and PCRE2_EXTRA_CASELESS_RESTRICT are not compatible\0" + "extended character class nesting is too deep\0" + "invalid operator in extended character class\0" + "unexpected operator in extended character class (no preceding operand)\0" + /* 110 */ + "expected operand after operator in extended character class\0" + "square brackets needed to clarify operator precedence in extended character class\0" + "missing terminating ] for extended character class (note '[' must be escaped under PCRE2_ALT_EXTENDED_CLASS)\0" + "unexpected expression in extended character class (no preceding operator)\0" + "empty expression in extended character class\0" + /* 115 */ + "terminating ] with no following closing parenthesis in (?[...]\0" + "unexpected character in (?[...]) extended character class\0" + "expected capture group number or name\0" + "missing opening parenthesis\0" + "syntax error in subpattern number (missing terminator?)\0" + /* 120 */ + "erroroffset passed as NULL\0" ; /* Match-time and UTF error texts are in the same format. */ @@ -273,9 +294,20 @@ static const unsigned char match_error_texts[] = "heap limit exceeded\0" "invalid syntax\0" /* 65 */ - "internal error - duplicate substitution match\0" + "internal error: duplicate substitution match\0" "PCRE2_MATCH_INVALID_UTF is not supported for DFA matching\0" - "INTERNAL ERROR: invalid substring offset\0" + "internal error: invalid substring offset\0" + "feature is not supported by the JIT compiler\0" + "error performing replacement case transformation\0" + /* 70 */ + "replacement too large (longer than PCRE2_SIZE)\0" + "substitute pattern differs from prior match call\0" + "substitute subject differs from prior match call\0" + "substitute start offset differs from prior match call\0" + "substitute options differ from prior match call\0" + /* 75 */ + "disallowed use of \\K in lookaround\0" + "replacement $' or $_ not supported with partial match\0" ; @@ -302,7 +334,7 @@ pcre2_get_error_message(int enumber, PCRE2_UCHAR *buffer, PCRE2_SIZE size) { const unsigned char *message; PCRE2_SIZE i; -int n; +int n, rc = 0; if (size == 0) return PCRE2_ERROR_NOMEMORY; @@ -318,13 +350,13 @@ else if (enumber < 0) /* Match or UTF error */ } else /* Invalid error number */ { - message = (unsigned char *)"\0"; /* Empty message list */ + message = (const unsigned char *)"\0"; /* Empty message list */ n = 1; } for (; n > 0; n--) { - while (*message++ != CHAR_NUL) {}; + while (*message++ != CHAR_NUL) {} if (*message == CHAR_NUL) return PCRE2_ERROR_BADDATA; } @@ -332,14 +364,23 @@ for (i = 0; *message != 0; i++) { if (i >= size - 1) { - buffer[i] = 0; /* Terminate partial message */ - return PCRE2_ERROR_NOMEMORY; + rc = PCRE2_ERROR_NOMEMORY; + break; } buffer[i] = *message++; } -buffer[i] = 0; -return (int)i; +#if defined EBCDIC && 'a' != 0x81 +/* If compiling for EBCDIC, but the compiler's string literals are not EBCDIC, +then we are in the "force EBCDIC 1047" mode. I have chosen to add a few lines +here to translate the error strings on the fly, rather than require the string +literals above to be written out arduously using the "STR_XYZ" macros. */ +for (PCRE2_SIZE j = 0; j < i; ++j) + buffer[j] = PRIV(ascii_to_ebcdic_1047)[buffer[j]]; +#endif + +buffer[i] = 0; /* Terminate message, even if truncated. */ +return rc? rc : (int)i; } /* End of pcre2_error.c */ diff --git a/std/regex/pcre2/pcre2_extuni.c b/std/regex/pcre2/pcre2_extuni.c index 4ed9f00c5..fea098a76 100644 --- a/std/regex/pcre2/pcre2_extuni.c +++ b/std/regex/pcre2/pcre2_extuni.c @@ -38,31 +38,28 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ + /* This module contains an internal function that is used to match a Unicode extended grapheme sequence. It is used by both pcre2_match() and -pcre2_def_match(). However, it is called only when Unicode support is being +pcre2_dfa_match(). However, it is called only when Unicode support is being compiled. Nevertheless, we provide a dummy function when there is no Unicode support, because some compilers do not like functionless source files. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - - #include "pcre2_internal.h" + /* Dummy function */ #ifndef SUPPORT_UNICODE PCRE2_SPTR -PRIV(extuni)(uint32_t c, PCRE2_SPTR eptr, PCRE2_SPTR start_subject, +PRIV(extuni)(uint32_t c, PCRE2_SPTR eptr, PCRE2_SPTR check_subject, PCRE2_SPTR end_subject, BOOL utf, int *xcount) { (void)c; (void)eptr; -(void)start_subject; +(void)check_subject; (void)end_subject; (void)utf; (void)xcount; @@ -83,7 +80,7 @@ same behaviour. Arguments: c the first character eptr pointer to next character - start_subject pointer to start of subject + check_subject pointer to start of validated subject end_subject pointer to end of subject utf TRUE if in UTF mode xcount pointer to count of additional characters, @@ -93,7 +90,7 @@ Returns: pointer after the end of the sequence */ PCRE2_SPTR -PRIV(extuni)(uint32_t c, PCRE2_SPTR eptr, PCRE2_SPTR start_subject, +PRIV(extuni)(uint32_t c, PCRE2_SPTR eptr, PCRE2_SPTR check_subject, PCRE2_SPTR end_subject, BOOL utf, int *xcount) { BOOL was_ep_ZWJ = FALSE; @@ -124,7 +121,7 @@ while (eptr < end_subject) /* bptr is pointing to the left-hand character */ - while (bptr > start_subject) + while (bptr > check_subject) { bptr--; if (utf) diff --git a/std/regex/pcre2/pcre2_find_bracket.c b/std/regex/pcre2/pcre2_find_bracket.c index 1290c5e9d..e26ee9923 100644 --- a/std/regex/pcre2/pcre2_find_bracket.c +++ b/std/regex/pcre2/pcre2_find_bracket.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2023 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -46,13 +46,10 @@ function is called from pcre2_compile.c and also from pcre2_study.c when finding the minimum matching length. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" + /************************************************* * Scan compiled regex for specific bracket * *************************************************/ @@ -76,18 +73,19 @@ for (;;) if (c == OP_END) return NULL; /* XCLASS is used for classes that cannot be represented just by a bit map. - This includes negated single high-valued characters. CALLOUT_STR is used for - callouts with string arguments. In both cases the length in the table is + This includes negated single high-valued characters. ECLASS is used for + classes that use set operations internally. CALLOUT_STR is used for + callouts with string arguments. In each case the length in the table is zero; the actual length is stored in the compiled code. */ - if (c == OP_XCLASS) code += GET(code, 1); - else if (c == OP_CALLOUT_STR) code += GET(code, 1 + 2*LINK_SIZE); + if (c == OP_XCLASS || c == OP_ECLASS) code += GET(code, 1); + else if (c == OP_CALLOUT_STR) code += GET(code, 1 + 2*LINK_SIZE); /* Handle lookbehind */ else if (c == OP_REVERSE || c == OP_VREVERSE) { - if (number < 0) return (PCRE2_UCHAR *)code; + if (number < 0) return code; code += PRIV(OP_lengths)[c]; } @@ -97,7 +95,7 @@ for (;;) c == OP_CBRAPOS || c == OP_SCBRAPOS) { int n = (int)GET2(code, 1+LINK_SIZE); - if (n == number) return (PCRE2_UCHAR *)code; + if (n == number) return code; code += PRIV(OP_lengths)[c]; } diff --git a/std/regex/pcre2/pcre2_internal.h b/std/regex/pcre2/pcre2_internal.h index e5808182e..930c745b4 100644 --- a/std/regex/pcre2/pcre2_internal.h +++ b/std/regex/pcre2/pcre2_internal.h @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2023 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -41,6 +41,15 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef PCRE2_INTERNAL_H_IDEMPOTENT_GUARD #define PCRE2_INTERNAL_H_IDEMPOTENT_GUARD +/* We do not assume that the config.h file has an idempotent include guard, +since it may well be written by clients. The standard Autoheader config.h does +not have an include guard (although we could customise that). */ + +#if defined HAVE_CONFIG_H && !defined PCRE2_CONFIG_H_IDEMPOTENT_GUARD +#define PCRE2_CONFIG_H_IDEMPOTENT_GUARD +#include "config.h" +#endif + /* We do not support both EBCDIC and Unicode at the same time. The "configure" script prevents both being selected, but not everybody uses "configure". EBCDIC is only supported for the 8-bit library, but the check for this has to be later @@ -59,13 +68,12 @@ be including this file. There is no explicit way of forcing a compile to be abandoned, but trying to include a non-existent file seems cleanest. Otherwise there will be many irrelevant consequential errors. */ -#if (!defined PCRE2_BUILDING_PCRE2TEST && !defined PCRE2_DFTABLES) && \ +#if (!defined PCRE2_PCRE2TEST && !defined PCRE2_DFTABLES) && \ (!defined PCRE2_CODE_UNIT_WIDTH || \ (PCRE2_CODE_UNIT_WIDTH != 8 && \ PCRE2_CODE_UNIT_WIDTH != 16 && \ PCRE2_CODE_UNIT_WIDTH != 32)) #error PCRE2_CODE_UNIT_WIDTH must be defined as 8, 16, or 32. -#include #endif @@ -88,6 +96,12 @@ typedef int BOOL; #define TRUE 1 #endif +/* Helper macro for static (compile-time) assertions. Can be used inside +functions, or at the top-level of a file. */ +#define STATIC_ASSERT_JOIN(a,b) a ## b +#define STATIC_ASSERT(cond, msg) \ + typedef int STATIC_ASSERT_JOIN(static_assertion_,msg)[(cond)?1:-1] + /* Valgrind (memcheck) support */ #ifdef SUPPORT_VALGRIND @@ -114,13 +128,12 @@ MSVC 10/2010. Except for VC6 (which is missing some fundamentals and fails). */ #endif /* When compiling a DLL for Windows, the exported symbols have to be declared -using some MS magic. I found some useful information on this web page: -http://msdn2.microsoft.com/en-us/library/y4h7bcy6(VS.80).aspx. According to the -information there, using __declspec(dllexport) without "extern" we have a -definition; with "extern" we have a declaration. The settings here override the -setting in pcre2.h (which is included below); it defines only PCRE2_EXP_DECL, -which is all that is needed for applications (they just import the symbols). We -use: +using some MS magic, as documented here: +https://learn.microsoft.com/en-us/cpp/build/exporting-from-a-dll-using-declspec-dllexport + +In pcre2.h (which is included below), we define only PCRE2_EXP_DECL, +which is all that is needed for applications (they just import the symbols). To +compile the library, we use: PCRE2_EXP_DECL for declarations PCRE2_EXP_DEFN for definitions @@ -134,24 +147,23 @@ special-purpose environments) might want to stick other stuff in front of exported symbols. That's why, in the non-Windows case, we set PCRE2_EXP_DEFN only if it is not already set. */ +#if defined __cplusplus +#error This project uses C99. C++ is not supported. +#endif + #ifndef PCRE2_EXP_DECL -# ifdef _WIN32 -# ifndef PCRE2_STATIC -# define PCRE2_EXP_DECL extern __declspec(dllexport) -# define PCRE2_EXP_DEFN __declspec(dllexport) -# else -# define PCRE2_EXP_DECL extern PCRE2_EXPORT -# define PCRE2_EXP_DEFN -# endif +# if defined(_WIN32) && !defined(PCRE2_STATIC) +# define PCRE2_EXP_DECL extern __declspec(dllexport) # else -# ifdef __cplusplus -# define PCRE2_EXP_DECL extern "C" PCRE2_EXPORT -# else -# define PCRE2_EXP_DECL extern PCRE2_EXPORT -# endif -# ifndef PCRE2_EXP_DEFN -# define PCRE2_EXP_DEFN PCRE2_EXP_DECL -# endif +# define PCRE2_EXP_DECL extern PCRE2_EXPORT +# endif +#endif + +#ifndef PCRE2_EXP_DEFN +# if defined(_WIN32) && !defined(PCRE2_STATIC) +# define PCRE2_EXP_DEFN extern __declspec(dllexport) +# else +# define PCRE2_EXP_DEFN extern PCRE2_EXPORT # endif #endif @@ -161,19 +173,6 @@ property values. This must follow the setting of PCRE2_EXP_DECL above. */ #include "pcre2.h" #include "pcre2_ucp.h" -/* When PCRE2 is compiled as a C++ library, the subject pointer can be replaced -with a custom type. This makes it possible, for example, to allow pcre2_match() -to process subject strings that are discontinuous by using a smart pointer -class. It must always be possible to inspect all of the subject string in -pcre2_match() because of the way it backtracks. */ - -/* WARNING: This is as yet untested for PCRE2. */ - -#ifdef CUSTOM_SUBJECT_PTR -#undef PCRE2_SPTR -#define PCRE2_SPTR CUSTOM_SUBJECT_PTR -#endif - /* When checking for integer overflow, we need to handle large integers. If a 64-bit integer type is available, we can use that. Otherwise we have to cast to double, which of course requires floating point @@ -195,28 +194,6 @@ code that a non-static object is being referenced. */ #define PRIV(name) _pcre2_##name #endif -/* When compiling for use with the Virtual Pascal compiler, these functions -need to have their names changed. PCRE2 must be compiled with the -DVPCOMPAT -option on the command line. */ - -#ifdef VPCOMPAT -#define strlen(s) _strlen(s) -#define strncmp(s1,s2,m) _strncmp(s1,s2,m) -#define memcmp(s,c,n) _memcmp(s,c,n) -#define memcpy(d,s,n) _memcpy(d,s,n) -#define memmove(d,s,n) _memmove(d,s,n) -#define memset(s,c,n) _memset(s,c,n) -#else /* VPCOMPAT */ - -/* Otherwise, to cope with SunOS4 and other systems that lack memmove(), define -a macro that calls an emulating function. */ - -#ifndef HAVE_MEMMOVE -#undef memmove /* Some systems may have a macro */ -#define memmove(a, b, c) PRIV(memmove)(a, b, c) -#endif /* not HAVE_MEMMOVE */ -#endif /* not VPCOMPAT */ - /* This is an unsigned int value that no UTF character can ever have, as Unicode doesn't go beyond 0x0010ffff. */ @@ -400,7 +377,7 @@ PCRE (both APIs) for a long time. */ #define HSPACE_LIST \ CHAR_HT, CHAR_SPACE, CHAR_NBSP, \ 0x1680, 0x180e, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, \ - 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202f, 0x205f, 0x3000, \ + 0x2006, 0x2007, 0x2008, 0x2009, 0x200a, 0x202f, 0x205f, 0x3000, \ NOTACHAR #define HSPACE_MULTIBYTE_CASES \ @@ -416,7 +393,7 @@ PCRE (both APIs) for a long time. */ case 0x2007: /* FIGURE SPACE */ \ case 0x2008: /* PUNCTUATION SPACE */ \ case 0x2009: /* THIN SPACE */ \ - case 0x200A: /* HAIR SPACE */ \ + case 0x200a: /* HAIR SPACE */ \ case 0x202f: /* NARROW NO-BREAK SPACE */ \ case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ \ case 0x3000 /* IDEOGRAPHIC SPACE */ @@ -500,8 +477,8 @@ start/end of string field names are. */ &(NLBLOCK->nllen), utf)) \ : \ ((p) <= NLBLOCK->PSEND - NLBLOCK->nllen && \ - UCHAR21TEST(p) == NLBLOCK->nl[0] && \ - (NLBLOCK->nllen == 1 || UCHAR21TEST(p+1) == NLBLOCK->nl[1]) \ + *p == NLBLOCK->nl[0] && \ + (NLBLOCK->nllen == 1 || p[1] == NLBLOCK->nl[1]) \ ) \ ) @@ -514,8 +491,8 @@ start/end of string field names are. */ &(NLBLOCK->nllen), utf)) \ : \ ((p) >= NLBLOCK->PSSTART + NLBLOCK->nllen && \ - UCHAR21TEST(p - NLBLOCK->nllen) == NLBLOCK->nl[0] && \ - (NLBLOCK->nllen == 1 || UCHAR21TEST(p - NLBLOCK->nllen + 1) == NLBLOCK->nl[1]) \ + *(p - NLBLOCK->nllen) == NLBLOCK->nl[0] && \ + (NLBLOCK->nllen == 1 || *(p - NLBLOCK->nllen + 1) == NLBLOCK->nl[1]) \ ) \ ) @@ -523,29 +500,30 @@ start/end of string field names are. */ three must not be changed, because whichever is set is actually the number of bytes in a code unit in that mode. */ -#define PCRE2_MODE8 0x00000001 /* compiled in 8 bit mode */ -#define PCRE2_MODE16 0x00000002 /* compiled in 16 bit mode */ -#define PCRE2_MODE32 0x00000004 /* compiled in 32 bit mode */ -#define PCRE2_FIRSTSET 0x00000010 /* first_code unit is set */ -#define PCRE2_FIRSTCASELESS 0x00000020 /* caseless first code unit */ -#define PCRE2_FIRSTMAPSET 0x00000040 /* bitmap of first code units is set */ -#define PCRE2_LASTSET 0x00000080 /* last code unit is set */ -#define PCRE2_LASTCASELESS 0x00000100 /* caseless last code unit */ -#define PCRE2_STARTLINE 0x00000200 /* start after \n for multiline */ -#define PCRE2_JCHANGED 0x00000400 /* j option used in pattern */ -#define PCRE2_HASCRORLF 0x00000800 /* explicit \r or \n in pattern */ -#define PCRE2_HASTHEN 0x00001000 /* pattern contains (*THEN) */ -#define PCRE2_MATCH_EMPTY 0x00002000 /* pattern can match empty string */ -#define PCRE2_BSR_SET 0x00004000 /* BSR was set in the pattern */ -#define PCRE2_NL_SET 0x00008000 /* newline was set in the pattern */ -#define PCRE2_NOTEMPTY_SET 0x00010000 /* (*NOTEMPTY) used ) keep */ -#define PCRE2_NE_ATST_SET 0x00020000 /* (*NOTEMPTY_ATSTART) used) together */ -#define PCRE2_DEREF_TABLES 0x00040000 /* release character tables */ -#define PCRE2_NOJIT 0x00080000 /* (*NOJIT) used */ -#define PCRE2_HASBKPORX 0x00100000 /* contains \P, \p, or \X */ -#define PCRE2_DUPCAPUSED 0x00200000 /* contains (?| */ -#define PCRE2_HASBKC 0x00400000 /* contains \C */ -#define PCRE2_HASACCEPT 0x00800000 /* contains (*ACCEPT) */ +#define PCRE2_MODE8 0x00000001u /* compiled in 8 bit mode */ +#define PCRE2_MODE16 0x00000002u /* compiled in 16 bit mode */ +#define PCRE2_MODE32 0x00000004u /* compiled in 32 bit mode */ +#define PCRE2_FIRSTSET 0x00000010u /* first_code unit is set */ +#define PCRE2_FIRSTCASELESS 0x00000020u /* caseless first code unit */ +#define PCRE2_FIRSTMAPSET 0x00000040u /* bitmap of first code units is set */ +#define PCRE2_LASTSET 0x00000080u /* last code unit is set */ +#define PCRE2_LASTCASELESS 0x00000100u /* caseless last code unit */ +#define PCRE2_STARTLINE 0x00000200u /* start after \n for multiline */ +#define PCRE2_JCHANGED 0x00000400u /* j option used in pattern */ +#define PCRE2_HASCRORLF 0x00000800u /* explicit \r or \n in pattern */ +#define PCRE2_HASTHEN 0x00001000u /* pattern contains (*THEN) */ +#define PCRE2_MATCH_EMPTY 0x00002000u /* pattern can match empty string */ +#define PCRE2_BSR_SET 0x00004000u /* BSR was set in the pattern */ +#define PCRE2_NL_SET 0x00008000u /* newline was set in the pattern */ +#define PCRE2_NOTEMPTY_SET 0x00010000u /* (*NOTEMPTY) used ) keep */ +#define PCRE2_NE_ATST_SET 0x00020000u /* (*NOTEMPTY_ATSTART) used) together */ +#define PCRE2_DEREF_TABLES 0x00040000u /* release character tables */ +#define PCRE2_NOJIT 0x00080000u /* (*NOJIT) used */ +#define PCRE2_HASBKPORX 0x00100000u /* contains \P, \p, or \X */ +#define PCRE2_DUPCAPUSED 0x00200000u /* contains (?| */ +#define PCRE2_HASBKC 0x00400000u /* contains \C */ +#define PCRE2_HASACCEPT 0x00800000u /* contains (*ACCEPT) */ +#define PCRE2_HASBSK 0x01000000u /* contains \K */ #define PCRE2_MODE_MASK (PCRE2_MODE8 | PCRE2_MODE16 | PCRE2_MODE32) @@ -574,6 +552,16 @@ modes. */ #define REQ_CU_MAX 2000 #endif +/* The maximum nesting depth for Unicode character class sets. +Currently fixed. Warning: the interpreter relies on this so it can encode +the operand stack in a uint32_t. A nesting limit of 15 implies (15*2+1)=31 +stack operands required, due to the fact that we have two (and only two) +levels of operator precedence. In the UTS#18 syntax, you can write 'x&&y[z]' +and in Perl syntax you can write '(?[ x - y & (z) ])', both of which imply +pushing the match results for x & y to the stack. */ + +#define ECLASS_NEST_LIMIT 15 + /* Offsets for the bitmap tables in the cbits set of tables. Each table contains a set of bits for a class map. Some classes are built by combining these tables. */ @@ -609,6 +597,13 @@ total length of the tables. */ #define ctypes_offset (cbits_offset + cbit_length) /* Character types */ #define TABLES_LENGTH (ctypes_offset + 256) +/* Private flags used in compile_context.optimization_flags */ + +#define PCRE2_OPTIM_AUTO_POSSESS 0x00000001u +#define PCRE2_OPTIM_DOTSTAR_ANCHOR 0x00000002u +#define PCRE2_OPTIM_START_OPTIMIZE 0x00000004u + +#define PCRE2_OPTIMIZATION_ALL 0x00000007u /* -------------------- Character and string names ------------------------ */ @@ -675,6 +670,10 @@ same code point. */ compatibility. NEL is the Unicode newline character; make sure it is a positive value. */ +#if '\n' != 0x0a +#error "ASCII character '\n' is not 0x0a" +#endif + #define CHAR_LF '\n' #define CHAR_NL CHAR_LF #define CHAR_NEL ((unsigned char)'\x85') @@ -690,7 +689,232 @@ a positive value. */ #endif /* EBCDIC */ -/* The remaining definitions work in both environments. */ +/* When we want to use EBCDIC with an ASCII compiler, for testing EBCDIC on +ASCII platforms, then we can hardcode an EBCDIC codepage (IBM-1047). */ + +#ifdef EBCDIC_IGNORING_COMPILER + +#define CHAR_NUL '\000' +#define CHAR_HT '\005' +#define CHAR_VT '\013' +#define CHAR_FF '\014' +#define CHAR_CR '\015' +#define CHAR_BS '\026' +#define CHAR_BEL '\057' + +#define CHAR_SPACE '\100' +#define CHAR_EXCLAMATION_MARK '\132' +#define CHAR_QUOTATION_MARK '\177' +#define CHAR_NUMBER_SIGN '\173' +#define CHAR_DOLLAR_SIGN '\133' +#define CHAR_PERCENT_SIGN '\154' +#define CHAR_AMPERSAND '\120' +#define CHAR_APOSTROPHE '\175' +#define CHAR_LEFT_PARENTHESIS '\115' +#define CHAR_RIGHT_PARENTHESIS '\135' +#define CHAR_ASTERISK '\134' +#define CHAR_PLUS '\116' +#define CHAR_COMMA '\153' +#define CHAR_MINUS '\140' +#define CHAR_DOT '\113' +#define CHAR_SLASH '\141' +#define CHAR_0 ((unsigned char)'\xf0') +#define CHAR_1 ((unsigned char)'\xf1') +#define CHAR_2 ((unsigned char)'\xf2') +#define CHAR_3 ((unsigned char)'\xf3') +#define CHAR_4 ((unsigned char)'\xf4') +#define CHAR_5 ((unsigned char)'\xf5') +#define CHAR_6 ((unsigned char)'\xf6') +#define CHAR_7 ((unsigned char)'\xf7') +#define CHAR_8 ((unsigned char)'\xf8') +#define CHAR_9 ((unsigned char)'\xf9') +#define CHAR_COLON '\172' +#define CHAR_SEMICOLON '\136' +#define CHAR_LESS_THAN_SIGN '\114' +#define CHAR_EQUALS_SIGN '\176' +#define CHAR_GREATER_THAN_SIGN '\156' +#define CHAR_QUESTION_MARK '\157' +#define CHAR_COMMERCIAL_AT '\174' +#define CHAR_A ((unsigned char)'\xc1') +#define CHAR_B ((unsigned char)'\xc2') +#define CHAR_C ((unsigned char)'\xc3') +#define CHAR_D ((unsigned char)'\xc4') +#define CHAR_E ((unsigned char)'\xc5') +#define CHAR_F ((unsigned char)'\xc6') +#define CHAR_G ((unsigned char)'\xc7') +#define CHAR_H ((unsigned char)'\xc8') +#define CHAR_I ((unsigned char)'\xc9') +#define CHAR_J ((unsigned char)'\xd1') +#define CHAR_K ((unsigned char)'\xd2') +#define CHAR_L ((unsigned char)'\xd3') +#define CHAR_M ((unsigned char)'\xd4') +#define CHAR_N ((unsigned char)'\xd5') +#define CHAR_O ((unsigned char)'\xd6') +#define CHAR_P ((unsigned char)'\xd7') +#define CHAR_Q ((unsigned char)'\xd8') +#define CHAR_R ((unsigned char)'\xd9') +#define CHAR_S ((unsigned char)'\xe2') +#define CHAR_T ((unsigned char)'\xe3') +#define CHAR_U ((unsigned char)'\xe4') +#define CHAR_V ((unsigned char)'\xe5') +#define CHAR_W ((unsigned char)'\xe6') +#define CHAR_X ((unsigned char)'\xe7') +#define CHAR_Y ((unsigned char)'\xe8') +#define CHAR_Z ((unsigned char)'\xe9') +#define CHAR_LEFT_SQUARE_BRACKET ((unsigned char)'\xad') +#define CHAR_BACKSLASH ((unsigned char)'\xe0') +#define CHAR_RIGHT_SQUARE_BRACKET ((unsigned char)'\xbd') +#define CHAR_CIRCUMFLEX_ACCENT '\137' +#define CHAR_UNDERSCORE '\155' +#define CHAR_GRAVE_ACCENT '\171' +#define CHAR_a ((unsigned char)'\x81') +#define CHAR_b ((unsigned char)'\x82') +#define CHAR_c ((unsigned char)'\x83') +#define CHAR_d ((unsigned char)'\x84') +#define CHAR_e ((unsigned char)'\x85') +#define CHAR_f ((unsigned char)'\x86') +#define CHAR_g ((unsigned char)'\x87') +#define CHAR_h ((unsigned char)'\x88') +#define CHAR_i ((unsigned char)'\x89') +#define CHAR_j ((unsigned char)'\x91') +#define CHAR_k ((unsigned char)'\x92') +#define CHAR_l ((unsigned char)'\x93') +#define CHAR_m ((unsigned char)'\x94') +#define CHAR_n ((unsigned char)'\x95') +#define CHAR_o ((unsigned char)'\x96') +#define CHAR_p ((unsigned char)'\x97') +#define CHAR_q ((unsigned char)'\x98') +#define CHAR_r ((unsigned char)'\x99') +#define CHAR_s ((unsigned char)'\xa2') +#define CHAR_t ((unsigned char)'\xa3') +#define CHAR_u ((unsigned char)'\xa4') +#define CHAR_v ((unsigned char)'\xa5') +#define CHAR_w ((unsigned char)'\xa6') +#define CHAR_x ((unsigned char)'\xa7') +#define CHAR_y ((unsigned char)'\xa8') +#define CHAR_z ((unsigned char)'\xa9') +#define CHAR_LEFT_CURLY_BRACKET ((unsigned char)'\xc0') +#define CHAR_VERTICAL_LINE '\117' +#define CHAR_RIGHT_CURLY_BRACKET ((unsigned char)'\xd0') +#define CHAR_TILDE ((unsigned char)'\xa1') + +#define STR_HT "\005" +#define STR_VT "\013" +#define STR_FF "\014" +#define STR_CR "\015" +#define STR_BS "\026" +#define STR_BEL "\057" + +#define STR_SPACE "\100" +#define STR_EXCLAMATION_MARK "\132" +#define STR_QUOTATION_MARK "\177" +#define STR_NUMBER_SIGN "\173" +#define STR_DOLLAR_SIGN "\133" +#define STR_PERCENT_SIGN "\154" +#define STR_AMPERSAND "\120" +#define STR_APOSTROPHE "\175" +#define STR_LEFT_PARENTHESIS "\115" +#define STR_RIGHT_PARENTHESIS "\135" +#define STR_ASTERISK "\134" +#define STR_PLUS "\116" +#define STR_COMMA "\153" +#define STR_MINUS "\140" +#define STR_DOT "\113" +#define STR_SLASH "\141" +#define STR_0 "\360" +#define STR_1 "\361" +#define STR_2 "\362" +#define STR_3 "\363" +#define STR_4 "\364" +#define STR_5 "\365" +#define STR_6 "\366" +#define STR_7 "\367" +#define STR_8 "\370" +#define STR_9 "\371" +#define STR_COLON "\172" +#define STR_SEMICOLON "\136" +#define STR_LESS_THAN_SIGN "\114" +#define STR_EQUALS_SIGN "\176" +#define STR_GREATER_THAN_SIGN "\156" +#define STR_QUESTION_MARK "\157" +#define STR_COMMERCIAL_AT "\174" +#define STR_A "\301" +#define STR_B "\302" +#define STR_C "\303" +#define STR_D "\304" +#define STR_E "\305" +#define STR_F "\306" +#define STR_G "\307" +#define STR_H "\310" +#define STR_I "\311" +#define STR_J "\321" +#define STR_K "\322" +#define STR_L "\323" +#define STR_M "\324" +#define STR_N "\325" +#define STR_O "\326" +#define STR_P "\327" +#define STR_Q "\330" +#define STR_R "\331" +#define STR_S "\342" +#define STR_T "\343" +#define STR_U "\344" +#define STR_V "\345" +#define STR_W "\346" +#define STR_X "\347" +#define STR_Y "\350" +#define STR_Z "\351" +#define STR_LEFT_SQUARE_BRACKET "\255" +#define STR_BACKSLASH "\340" +#define STR_RIGHT_SQUARE_BRACKET "\275" +#define STR_CIRCUMFLEX_ACCENT "\137" +#define STR_UNDERSCORE "\155" +#define STR_GRAVE_ACCENT "\171" +#define STR_a "\201" +#define STR_b "\202" +#define STR_c "\203" +#define STR_d "\204" +#define STR_e "\205" +#define STR_f "\206" +#define STR_g "\207" +#define STR_h "\210" +#define STR_i "\211" +#define STR_j "\221" +#define STR_k "\222" +#define STR_l "\223" +#define STR_m "\224" +#define STR_n "\225" +#define STR_o "\226" +#define STR_p "\227" +#define STR_q "\230" +#define STR_r "\231" +#define STR_s "\242" +#define STR_t "\243" +#define STR_u "\244" +#define STR_v "\245" +#define STR_w "\246" +#define STR_x "\247" +#define STR_y "\250" +#define STR_z "\251" +#define STR_LEFT_CURLY_BRACKET "\300" +#define STR_VERTICAL_LINE "\117" +#define STR_RIGHT_CURLY_BRACKET "\320" +#define STR_TILDE "\241" + +#else /* EBCDIC_IGNORING_COMPILER */ + +/* Otherwise, on a real EBCDIC compiler or an ASCII compiler, we can use simple +string and character literals. */ + +#ifdef EBCDIC +#if 'a' != 0x81 +#error "EBCDIC character 'a' is not 0x81" +#endif +#else +#if 'a' != 0x61 +#error "ASCII character 'a' is not 0x61" +#endif +#endif #define CHAR_NUL '\0' #define CHAR_HT '\t' @@ -899,84 +1123,7 @@ a positive value. */ #define STR_RIGHT_CURLY_BRACKET "}" #define STR_TILDE "~" -#define STRING_ACCEPT0 "ACCEPT\0" -#define STRING_COMMIT0 "COMMIT\0" -#define STRING_F0 "F\0" -#define STRING_FAIL0 "FAIL\0" -#define STRING_MARK0 "MARK\0" -#define STRING_PRUNE0 "PRUNE\0" -#define STRING_SKIP0 "SKIP\0" -#define STRING_THEN "THEN" - -#define STRING_atomic0 "atomic\0" -#define STRING_pla0 "pla\0" -#define STRING_plb0 "plb\0" -#define STRING_napla0 "napla\0" -#define STRING_naplb0 "naplb\0" -#define STRING_nla0 "nla\0" -#define STRING_nlb0 "nlb\0" -#define STRING_sr0 "sr\0" -#define STRING_asr0 "asr\0" -#define STRING_positive_lookahead0 "positive_lookahead\0" -#define STRING_positive_lookbehind0 "positive_lookbehind\0" -#define STRING_non_atomic_positive_lookahead0 "non_atomic_positive_lookahead\0" -#define STRING_non_atomic_positive_lookbehind0 "non_atomic_positive_lookbehind\0" -#define STRING_negative_lookahead0 "negative_lookahead\0" -#define STRING_negative_lookbehind0 "negative_lookbehind\0" -#define STRING_script_run0 "script_run\0" -#define STRING_atomic_script_run "atomic_script_run" - -#define STRING_alpha0 "alpha\0" -#define STRING_lower0 "lower\0" -#define STRING_upper0 "upper\0" -#define STRING_alnum0 "alnum\0" -#define STRING_ascii0 "ascii\0" -#define STRING_blank0 "blank\0" -#define STRING_cntrl0 "cntrl\0" -#define STRING_digit0 "digit\0" -#define STRING_graph0 "graph\0" -#define STRING_print0 "print\0" -#define STRING_punct0 "punct\0" -#define STRING_space0 "space\0" -#define STRING_word0 "word\0" -#define STRING_xdigit "xdigit" - -#define STRING_DEFINE "DEFINE" -#define STRING_VERSION "VERSION" -#define STRING_WEIRD_STARTWORD "[:<:]]" -#define STRING_WEIRD_ENDWORD "[:>:]]" - -#define STRING_CR_RIGHTPAR "CR)" -#define STRING_LF_RIGHTPAR "LF)" -#define STRING_CRLF_RIGHTPAR "CRLF)" -#define STRING_ANY_RIGHTPAR "ANY)" -#define STRING_ANYCRLF_RIGHTPAR "ANYCRLF)" -#define STRING_NUL_RIGHTPAR "NUL)" -#define STRING_BSR_ANYCRLF_RIGHTPAR "BSR_ANYCRLF)" -#define STRING_BSR_UNICODE_RIGHTPAR "BSR_UNICODE)" -#define STRING_UTF8_RIGHTPAR "UTF8)" -#define STRING_UTF16_RIGHTPAR "UTF16)" -#define STRING_UTF32_RIGHTPAR "UTF32)" -#define STRING_UTF_RIGHTPAR "UTF)" -#define STRING_UCP_RIGHTPAR "UCP)" -#define STRING_NO_AUTO_POSSESS_RIGHTPAR "NO_AUTO_POSSESS)" -#define STRING_NO_DOTSTAR_ANCHOR_RIGHTPAR "NO_DOTSTAR_ANCHOR)" -#define STRING_NO_JIT_RIGHTPAR "NO_JIT)" -#define STRING_NO_START_OPT_RIGHTPAR "NO_START_OPT)" -#define STRING_NOTEMPTY_RIGHTPAR "NOTEMPTY)" -#define STRING_NOTEMPTY_ATSTART_RIGHTPAR "NOTEMPTY_ATSTART)" -#define STRING_LIMIT_HEAP_EQ "LIMIT_HEAP=" -#define STRING_LIMIT_MATCH_EQ "LIMIT_MATCH=" -#define STRING_LIMIT_DEPTH_EQ "LIMIT_DEPTH=" -#define STRING_LIMIT_RECURSION_EQ "LIMIT_RECURSION=" -#define STRING_MARK "MARK" - -#define STRING_bc "bc" -#define STRING_bidiclass "bidiclass" -#define STRING_sc "sc" -#define STRING_script "script" -#define STRING_scriptextensions "scriptextensions" -#define STRING_scx "scx" +#endif /* EBCDIC_WITH_ASCII_COMPILER */ #else /* SUPPORT_UNICODE */ @@ -1200,6 +1347,9 @@ only. */ #define STR_RIGHT_CURLY_BRACKET "\175" #define STR_TILDE "\176" +#endif /* SUPPORT_UNICODE */ + + #define STRING_ACCEPT0 STR_A STR_C STR_C STR_E STR_P STR_T "\0" #define STRING_COMMIT0 STR_C STR_O STR_M STR_M STR_I STR_T "\0" #define STRING_F0 STR_F "\0" @@ -1216,6 +1366,7 @@ only. */ #define STRING_naplb0 STR_n STR_a STR_p STR_l STR_b "\0" #define STRING_nla0 STR_n STR_l STR_a "\0" #define STRING_nlb0 STR_n STR_l STR_b "\0" +#define STRING_scs0 STR_s STR_c STR_s "\0" #define STRING_sr0 STR_s STR_r "\0" #define STRING_asr0 STR_a STR_s STR_r "\0" #define STRING_positive_lookahead0 STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_a STR_h STR_e STR_a STR_d "\0" @@ -1226,6 +1377,7 @@ only. */ #define STRING_negative_lookbehind0 STR_n STR_e STR_g STR_a STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_b STR_e STR_h STR_i STR_n STR_d "\0" #define STRING_script_run0 STR_s STR_c STR_r STR_i STR_p STR_t STR_UNDERSCORE STR_r STR_u STR_n "\0" #define STRING_atomic_script_run STR_a STR_t STR_o STR_m STR_i STR_c STR_UNDERSCORE STR_s STR_c STR_r STR_i STR_p STR_t STR_UNDERSCORE STR_r STR_u STR_n +#define STRING_scan_substring0 STR_s STR_c STR_a STR_n STR_UNDERSCORE STR_s STR_u STR_b STR_s STR_t STR_r STR_i STR_n STR_g "\0" #define STRING_alpha0 STR_a STR_l STR_p STR_h STR_a "\0" #define STRING_lower0 STR_l STR_o STR_w STR_e STR_r "\0" @@ -1266,6 +1418,8 @@ only. */ #define STRING_NO_START_OPT_RIGHTPAR STR_N STR_O STR_UNDERSCORE STR_S STR_T STR_A STR_R STR_T STR_UNDERSCORE STR_O STR_P STR_T STR_RIGHT_PARENTHESIS #define STRING_NOTEMPTY_RIGHTPAR STR_N STR_O STR_T STR_E STR_M STR_P STR_T STR_Y STR_RIGHT_PARENTHESIS #define STRING_NOTEMPTY_ATSTART_RIGHTPAR STR_N STR_O STR_T STR_E STR_M STR_P STR_T STR_Y STR_UNDERSCORE STR_A STR_T STR_S STR_T STR_A STR_R STR_T STR_RIGHT_PARENTHESIS +#define STRING_CASELESS_RESTRICT_RIGHTPAR STR_C STR_A STR_S STR_E STR_L STR_E STR_S STR_S STR_UNDERSCORE STR_R STR_E STR_S STR_T STR_R STR_I STR_C STR_T STR_RIGHT_PARENTHESIS +#define STRING_TURKISH_CASING_RIGHTPAR STR_T STR_U STR_R STR_K STR_I STR_S STR_H STR_UNDERSCORE STR_C STR_A STR_S STR_I STR_N STR_G STR_RIGHT_PARENTHESIS #define STRING_LIMIT_HEAP_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_H STR_E STR_A STR_P STR_EQUALS_SIGN #define STRING_LIMIT_MATCH_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_M STR_A STR_T STR_C STR_H STR_EQUALS_SIGN #define STRING_LIMIT_DEPTH_EQ STR_L STR_I STR_M STR_I STR_T STR_UNDERSCORE STR_D STR_E STR_P STR_T STR_H STR_EQUALS_SIGN @@ -1280,8 +1434,6 @@ only. */ #define STRING_scx STR_s STR_c STR_x -#endif /* SUPPORT_UNICODE */ - /* -------------------- End of character and string names -------------------*/ /* -------------------- Definitions for compiled patterns -------------------*/ @@ -1290,21 +1442,22 @@ only. */ changed, the autopossessifying table in pcre2_auto_possess.c must be updated to match. */ -#define PT_ANY 0 /* Any property - matches all chars */ -#define PT_LAMP 1 /* L& - the union of Lu, Ll, Lt */ -#define PT_GC 2 /* Specified general characteristic (e.g. L) */ -#define PT_PC 3 /* Specified particular characteristic (e.g. Lu) */ -#define PT_SC 4 /* Script only (e.g. Han) */ -#define PT_SCX 5 /* Script extensions (includes SC) */ -#define PT_ALNUM 6 /* Alphanumeric - the union of L and N */ -#define PT_SPACE 7 /* Perl space - general category Z plus 9,10,12,13 */ -#define PT_PXSPACE 8 /* POSIX space - Z plus 9,10,11,12,13 */ -#define PT_WORD 9 /* Word - L, N, Mn, or Pc */ -#define PT_CLIST 10 /* Pseudo-property: match character list */ -#define PT_UCNC 11 /* Universal Character nameable character */ -#define PT_BIDICL 12 /* Specified bidi class */ -#define PT_BOOL 13 /* Boolean property */ -#define PT_TABSIZE 14 /* Size of square table for autopossessify tests */ +#define PT_LAMP 0 /* L& - the union of Lu, Ll, Lt */ +#define PT_GC 1 /* Specified general characteristic (e.g. L) */ +#define PT_PC 2 /* Specified particular characteristic (e.g. Lu) */ +#define PT_SC 3 /* Script only (e.g. Han) */ +#define PT_SCX 4 /* Script extensions (includes SC) */ +#define PT_ALNUM 5 /* Alphanumeric - the union of L and N */ +#define PT_SPACE 6 /* Perl space - general category Z plus 9,10,12,13 */ +#define PT_PXSPACE 7 /* POSIX space - Z plus 9,10,11,12,13 */ +#define PT_WORD 8 /* Word - L, N, Mn, or Pc */ +#define PT_CLIST 9 /* Pseudo-property: match character list */ +#define PT_UCNC 10 /* Universal Character nameable character */ +#define PT_BIDICL 11 /* Specified bidi class */ +#define PT_BOOL 12 /* Boolean property */ +#define PT_ANY 13 /* Must be the last entry! + Any property - matches all chars */ +#define PT_TABSIZE PT_ANY /* Size of square table for autopossessify tests */ /* The following special properties are used only in XCLASS items, when POSIX classes are specified and PCRE2_UCP is set - in other words, for Unicode @@ -1334,6 +1487,99 @@ contain characters with values greater than 255. */ #define XCL_RANGE 2 /* A range (two multibyte chars) follows */ #define XCL_PROP 3 /* Unicode property (2-byte property code follows) */ #define XCL_NOTPROP 4 /* Unicode inverted property (ditto) */ +/* This value represents the beginning of character lists. The value +is 16 bit long, and stored as a high and low byte pair in 8 bit mode. +The lower 12 bit contains information about character lists (see later). */ +#define XCL_LIST (sizeof(PCRE2_UCHAR) == 1 ? 0x10 : 0x1000) + +/* When a character class contains many characters/ranges, +they are stored in character lists. There are four character +lists which contain characters/ranges within a given range. + +The name, character range and item size for each list: +Low16 [0x100 - 0x7fff] 16 bit items +High16 [0x8000 - 0xffff] 16 bit items +Low32 [0x10000 - 0x7fffffff] 32 bit items +High32 [0x80000000 - 0xffffffff] 32 bit items + +The Low32 character list is used only when utf encoding or 32 bit +character width is enabled, and the High32 character is used only +when 32 bit character width is enabled. + +Each character list contain items. The lowest bit represents that +an item is the beginning of a range (bit is cleared), or not (bit +is set). The other bits represent the character shifted left by +one, so its highest bit is discarded. Due to the layout of character +lists, the highest bit of a character is always known: + +Low16 and Low32: the highest bit is always zero +High16 and High32: the highest bit is always one + +The items are ordered in increasing order, so binary search can be +used to find the lower bound of an input character. The lower bound +is the highest item, which value is less or equal than the input +character. If the lower bit of the item is cleared, or the character +stored in the item equals to the input character, the input +character is in the character list. */ + +/* Character list constants. */ +#define XCL_CHAR_LIST_LOW_16_START 0x100 +#define XCL_CHAR_LIST_LOW_16_END 0x7fff +#define XCL_CHAR_LIST_LOW_16_ADD 0x0 + +#define XCL_CHAR_LIST_HIGH_16_START 0x8000 +#define XCL_CHAR_LIST_HIGH_16_END 0xffff +#define XCL_CHAR_LIST_HIGH_16_ADD 0x8000 + +#define XCL_CHAR_LIST_LOW_32_START 0x10000 +#define XCL_CHAR_LIST_LOW_32_END 0x7fffffff +#define XCL_CHAR_LIST_LOW_32_ADD 0x0 + +#define XCL_CHAR_LIST_HIGH_32_START 0x80000000 +#define XCL_CHAR_LIST_HIGH_32_END 0xffffffff +#define XCL_CHAR_LIST_HIGH_32_ADD 0x80000000 + +/* Mask and length values for getting the descriptors of +all character list ranges. The bit length of each descriptor +is XCL_TYPE_BIT_LEN so the total size is 4*XCL_TYPE_BIT_LEN +(currently 12 bit). This data is stored for all four character +lists, even if no characters are present in a list. */ +#define XCL_TYPE_MASK 0xfff +#define XCL_TYPE_BIT_LEN 3 +/* If this bit is set for a character class, the first item of the +character list is the end of a range, which started before the +starting character of the character list. If this bit is set, and +no characters are present in the list, the whole character class +is part of a range. E.g: [\x{500}-\x{12000}] covers the entire +0x8000-0xffff range. */ +#define XCL_BEGIN_WITH_RANGE 0x4 +/* Number of items in the character list: 0, 1, or 2. The value 3 +represents that the item count is stored at the begining of the +character list. The item count has the same width as the items +in the character list (e.g. 16 bit for Low16 and High16 lists). */ +#define XCL_ITEM_COUNT_MASK 0x3 +/* Shift and flag for constructing character list items. The XCL_CHAR_END +is set, when the item is not the beginning of a range. The XCL_CHAR_SHIFT +can be used to encode / decode the character value stored in an item. */ +#define XCL_CHAR_END 0x1 +#define XCL_CHAR_SHIFT 1 + +/* Flag bits for an extended class (OP_ECLASS), which is used for complex +character matches such as [\p{Greek} && \p{Ll}]. */ + +#define ECL_MAP 0x01 /* Flag: a 32-byte map is present */ + +/* Type tags for the items stored in an extended class (OP_ECLASS). These items +follow the OP_ECLASS's flag char and bitmap, and represent a Reverse Polish +Notation list of operands and operators manipulating a stack of bits. */ + +#define ECL_AND 1 /* Pop two from the stack, AND, and push result. */ +#define ECL_OR 2 /* Pop two from the stack, OR, and push result. */ +#define ECL_XOR 3 /* Pop two from the stack, XOR, and push result. */ +#define ECL_NOT 4 /* Pop one from the stack, NOT, and push result. */ +#define ECL_XCLASS 5 /* XCLASS nested within ECLASS; match and push result. */ +#define ECL_ANY 6 /* Temporary, only used during compilation. */ +#define ECL_NONE 7 /* Temporary, only used during compilation. */ /* These are escaped items that aren't just an encoding of a particular data value such as \n. They must have non-zero values, as check_escape() returns 0 @@ -1555,102 +1801,105 @@ enum { character > 255 is encountered. */ OP_XCLASS, /* 112 Extended class for handling > 255 chars within the class. This does both positive and negative. */ - OP_REF, /* 113 Match a back reference, casefully */ - OP_REFI, /* 114 Match a back reference, caselessly */ - OP_DNREF, /* 115 Match a duplicate name backref, casefully */ - OP_DNREFI, /* 116 Match a duplicate name backref, caselessly */ - OP_RECURSE, /* 117 Match a numbered subpattern (possibly recursive) */ - OP_CALLOUT, /* 118 Call out to external function if provided */ - OP_CALLOUT_STR, /* 119 Call out with string argument */ - - OP_ALT, /* 120 Start of alternation */ - OP_KET, /* 121 End of group that doesn't have an unbounded repeat */ - OP_KETRMAX, /* 122 These two must remain together and in this */ - OP_KETRMIN, /* 123 order. They are for groups the repeat for ever. */ - OP_KETRPOS, /* 124 Possessive unlimited repeat. */ + OP_ECLASS, /* 113 Really-extended class, for handling logical + expressions computed over characters. */ + OP_REF, /* 114 Match a back reference, casefully */ + OP_REFI, /* 115 Match a back reference, caselessly */ + OP_DNREF, /* 116 Match a duplicate name backref, casefully */ + OP_DNREFI, /* 117 Match a duplicate name backref, caselessly */ + OP_RECURSE, /* 118 Match a numbered subpattern (possibly recursive) */ + OP_CALLOUT, /* 119 Call out to external function if provided */ + OP_CALLOUT_STR, /* 120 Call out with string argument */ + + OP_ALT, /* 121 Start of alternation */ + OP_KET, /* 122 End of group that doesn't have an unbounded repeat */ + OP_KETRMAX, /* 123 These two must remain together and in this */ + OP_KETRMIN, /* 124 order. They are for groups the repeat for ever. */ + OP_KETRPOS, /* 125 Possessive unlimited repeat. */ /* The assertions must come before BRA, CBRA, ONCE, and COND. */ - OP_REVERSE, /* 125 Move pointer back - used in lookbehind assertions */ - OP_VREVERSE, /* 126 Move pointer back - variable */ - OP_ASSERT, /* 127 Positive lookahead */ - OP_ASSERT_NOT, /* 128 Negative lookahead */ - OP_ASSERTBACK, /* 129 Positive lookbehind */ - OP_ASSERTBACK_NOT, /* 130 Negative lookbehind */ - OP_ASSERT_NA, /* 131 Positive non-atomic lookahead */ - OP_ASSERTBACK_NA, /* 132 Positive non-atomic lookbehind */ + OP_REVERSE, /* 126 Move pointer back - used in lookbehind assertions */ + OP_VREVERSE, /* 127 Move pointer back - variable */ + OP_ASSERT, /* 128 Positive lookahead */ + OP_ASSERT_NOT, /* 129 Negative lookahead */ + OP_ASSERTBACK, /* 130 Positive lookbehind */ + OP_ASSERTBACK_NOT, /* 131 Negative lookbehind */ + OP_ASSERT_NA, /* 132 Positive non-atomic lookahead */ + OP_ASSERTBACK_NA, /* 133 Positive non-atomic lookbehind */ + OP_ASSERT_SCS, /* 134 Scan substring */ /* ONCE, SCRIPT_RUN, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come immediately after the assertions, with ONCE first, as there's a test for >= ONCE for a subpattern that isn't an assertion. The POS versions must immediately follow the non-POS versions in each case. */ - OP_ONCE, /* 133 Atomic group, contains captures */ - OP_SCRIPT_RUN, /* 134 Non-capture, but check characters' scripts */ - OP_BRA, /* 135 Start of non-capturing bracket */ - OP_BRAPOS, /* 136 Ditto, with unlimited, possessive repeat */ - OP_CBRA, /* 137 Start of capturing bracket */ - OP_CBRAPOS, /* 138 Ditto, with unlimited, possessive repeat */ - OP_COND, /* 139 Conditional group */ + OP_ONCE, /* 135 Atomic group, contains captures */ + OP_SCRIPT_RUN, /* 136 Non-capture, but check characters' scripts */ + OP_BRA, /* 137 Start of non-capturing bracket */ + OP_BRAPOS, /* 138 Ditto, with unlimited, possessive repeat */ + OP_CBRA, /* 139 Start of capturing bracket */ + OP_CBRAPOS, /* 140 Ditto, with unlimited, possessive repeat */ + OP_COND, /* 141 Conditional group */ /* These five must follow the previous five, in the same order. There's a check for >= SBRA to distinguish the two sets. */ - OP_SBRA, /* 140 Start of non-capturing bracket, check empty */ - OP_SBRAPOS, /* 141 Ditto, with unlimited, possessive repeat */ - OP_SCBRA, /* 142 Start of capturing bracket, check empty */ - OP_SCBRAPOS, /* 143 Ditto, with unlimited, possessive repeat */ - OP_SCOND, /* 144 Conditional group, check empty */ + OP_SBRA, /* 142 Start of non-capturing bracket, check empty */ + OP_SBRAPOS, /* 143 Ditto, with unlimited, possessive repeat */ + OP_SCBRA, /* 144 Start of capturing bracket, check empty */ + OP_SCBRAPOS, /* 145 Ditto, with unlimited, possessive repeat */ + OP_SCOND, /* 146 Conditional group, check empty */ /* The next two pairs must (respectively) be kept together. */ - OP_CREF, /* 145 Used to hold a capture number as condition */ - OP_DNCREF, /* 146 Used to point to duplicate names as a condition */ - OP_RREF, /* 147 Used to hold a recursion number as condition */ - OP_DNRREF, /* 148 Used to point to duplicate names as a condition */ - OP_FALSE, /* 149 Always false (used by DEFINE and VERSION) */ - OP_TRUE, /* 150 Always true (used by VERSION) */ + OP_CREF, /* 147 Used to hold a capture number as condition */ + OP_DNCREF, /* 148 Used to point to duplicate names as a condition */ + OP_RREF, /* 149 Used to hold a recursion number as condition */ + OP_DNRREF, /* 150 Used to point to duplicate names as a condition */ + OP_FALSE, /* 151 Always false (used by DEFINE and VERSION) */ + OP_TRUE, /* 152 Always true (used by VERSION) */ - OP_BRAZERO, /* 151 These two must remain together and in this */ - OP_BRAMINZERO, /* 152 order. */ - OP_BRAPOSZERO, /* 153 */ + OP_BRAZERO, /* 153 These two must remain together and in this */ + OP_BRAMINZERO, /* 154 order. */ + OP_BRAPOSZERO, /* 155 */ /* These are backtracking control verbs */ - OP_MARK, /* 154 always has an argument */ - OP_PRUNE, /* 155 */ - OP_PRUNE_ARG, /* 156 same, but with argument */ - OP_SKIP, /* 157 */ - OP_SKIP_ARG, /* 158 same, but with argument */ - OP_THEN, /* 159 */ - OP_THEN_ARG, /* 160 same, but with argument */ - OP_COMMIT, /* 161 */ - OP_COMMIT_ARG, /* 162 same, but with argument */ + OP_MARK, /* 156 always has an argument */ + OP_PRUNE, /* 157 */ + OP_PRUNE_ARG, /* 158 same, but with argument */ + OP_SKIP, /* 159 */ + OP_SKIP_ARG, /* 160 same, but with argument */ + OP_THEN, /* 161 */ + OP_THEN_ARG, /* 162 same, but with argument */ + OP_COMMIT, /* 163 */ + OP_COMMIT_ARG, /* 164 same, but with argument */ /* These are forced failure and success verbs. FAIL and ACCEPT do accept an argument, but these cases can be compiled as, for example, (*MARK:X)(*FAIL) without the need for a special opcode. */ - OP_FAIL, /* 163 */ - OP_ACCEPT, /* 164 */ - OP_ASSERT_ACCEPT, /* 165 Used inside assertions */ - OP_CLOSE, /* 166 Used before OP_ACCEPT to close open captures */ + OP_FAIL, /* 165 */ + OP_ACCEPT, /* 166 */ + OP_ASSERT_ACCEPT, /* 167 Used inside assertions */ + OP_CLOSE, /* 168 Used before OP_ACCEPT to close open captures */ /* This is used to skip a subpattern with a {0} quantifier */ - OP_SKIPZERO, /* 167 */ + OP_SKIPZERO, /* 169 */ /* This is used to identify a DEFINE group during compilation so that it can be checked for having only one branch. It is changed to OP_FALSE before compilation finishes. */ - OP_DEFINE, /* 168 */ + OP_DEFINE, /* 170 */ /* These opcodes replace their normal counterparts in UCP mode when PCRE2_EXTRA_ASCII_BSW is not set. */ - OP_NOT_UCP_WORD_BOUNDARY, /* 169 */ - OP_UCP_WORD_BOUNDARY, /* 170 */ + OP_NOT_UCP_WORD_BOUNDARY, /* 171 */ + OP_UCP_WORD_BOUNDARY, /* 172 */ /* This is not an opcode, but is used to check that tables indexed by opcode are the correct length, in order to catch updating errors - there have been @@ -1668,7 +1917,7 @@ pcre2_dfa_match.c that must be updated. */ /* This macro defines textual names for all the opcodes. These are used only for debugging, and some of them are only partial names. The macro is referenced -only in pcre2_printint.c, which fills out the full names in many cases (and in +only in pcre2_printint_inc.h, which fills out the full names in many cases (and in some cases doesn't actually use these names at all). */ #define OP_NAME_LIST \ @@ -1693,19 +1942,21 @@ some cases doesn't actually use these names at all). */ "*+","++", "?+", "{", \ "*", "*?", "+", "+?", "?", "??", "{", "{", \ "*+","++", "?+", "{", \ - "class", "nclass", "xclass", "Ref", "Refi", "DnRef", "DnRefi", \ + "class", "nclass", "xclass", "eclass", \ + "Ref", "Refi", "DnRef", "DnRefi", \ "Recurse", "Callout", "CalloutStr", \ "Alt", "Ket", "KetRmax", "KetRmin", "KetRpos", \ "Reverse", "VReverse", "Assert", "Assert not", \ "Assert back", "Assert back not", \ "Non-atomic assert", "Non-atomic assert back", \ + "Scan substring", \ "Once", \ "Script run", \ "Bra", "BraPos", "CBra", "CBraPos", \ "Cond", \ "SBra", "SBraPos", "SCBra", "SCBraPos", \ "SCond", \ - "Cond ref", "Cond dnref", "Cond rec", "Cond dnrec", \ + "Capture ref", "Capture dnref", "Cond rec", "Cond dnrec", \ "Cond false", "Cond true", \ "Brazero", "Braminzero", "Braposzero", \ "*MARK", "*PRUNE", "*PRUNE", "*SKIP", "*SKIP", \ @@ -1766,10 +2017,11 @@ in UTF-8 mode. The code that uses this table must know about such things. */ 1+(32/sizeof(PCRE2_UCHAR)), /* CLASS */ \ 1+(32/sizeof(PCRE2_UCHAR)), /* NCLASS */ \ 0, /* XCLASS - variable length */ \ + 0, /* ECLASS - variable length */ \ 1+IMM2_SIZE, /* REF */ \ - 1+IMM2_SIZE, /* REFI */ \ + 1+IMM2_SIZE+1, /* REFI */ \ 1+2*IMM2_SIZE, /* DNREF */ \ - 1+2*IMM2_SIZE, /* DNREFI */ \ + 1+2*IMM2_SIZE+1, /* DNREFI */ \ 1+LINK_SIZE, /* RECURSE */ \ 1+2*LINK_SIZE+1, /* CALLOUT */ \ 0, /* CALLOUT_STR - variable length */ \ @@ -1786,6 +2038,7 @@ in UTF-8 mode. The code that uses this table must know about such things. */ 1+LINK_SIZE, /* Assert behind not */ \ 1+LINK_SIZE, /* NA Assert */ \ 1+LINK_SIZE, /* NA Assert behind */ \ + 1+LINK_SIZE, /* Scan substring */ \ 1+LINK_SIZE, /* ONCE */ \ 1+LINK_SIZE, /* SCRIPT_RUN */ \ 1+LINK_SIZE, /* BRA */ \ @@ -1815,6 +2068,11 @@ in UTF-8 mode. The code that uses this table must know about such things. */ #define RREF_ANY 0xffff +/* Constants used by OP_REFI and OP_DNREFI to control matching behaviour. */ + +#define REFI_FLAG_CASELESS_RESTRICT 0x1 +#define REFI_FLAG_TURKISH_CASING 0x2 + /* ---------- Private structures that are mode-independent. ---------- */ @@ -1890,6 +2148,14 @@ typedef struct { #define UCD_SCRIPTX(ch) UCD_SCRIPTX_PROP(GET_UCD(ch)) #define UCD_BPROPS(ch) UCD_BPROPS_PROP(GET_UCD(ch)) #define UCD_BIDICLASS(ch) UCD_BIDICLASS_PROP(GET_UCD(ch)) +#define UCD_ANY_I(ch) \ + /* match any of the four characters 'i', 'I', U+0130, U+0131 */ \ + (((uint32_t)(ch) | 0x20u) == 0x69u || ((uint32_t)(ch) | 1u) == 0x0131u) +#define UCD_DOTTED_I(ch) \ + ((uint32_t)(ch) == 0x69u || (uint32_t)(ch) == 0x0130u) +#define UCD_FOLD_I_TURKISH(ch) \ + ((uint32_t)(ch) == 0x0130u ? 0x69u : \ + (uint32_t)(ch) == 0x49u ? 0x0131u : (uint32_t)(ch)) /* The "scriptx" and bprops fields contain offsets into vectors of 32-bit words that form a bitmap representing a list of scripts or boolean properties. These @@ -1935,7 +2201,7 @@ tables are needed only when compiling the 8-bit library. */ #if PCRE2_CODE_UNIT_WIDTH == 8 extern const int PRIV(utf8_table1)[]; -extern const int PRIV(utf8_table1_size); +extern const unsigned PRIV(utf8_table1_size); extern const int PRIV(utf8_table2)[]; extern const int PRIV(utf8_table3)[]; extern const uint8_t PRIV(utf8_table4)[]; @@ -1955,6 +2221,9 @@ extern const uint8_t PRIV(utf8_table4)[]; #define _pcre2_vspace_list PCRE2_SUFFIX(_pcre2_vspace_list_) #define _pcre2_ucd_boolprop_sets PCRE2_SUFFIX(_pcre2_ucd_boolprop_sets_) #define _pcre2_ucd_caseless_sets PCRE2_SUFFIX(_pcre2_ucd_caseless_sets_) +#define _pcre2_ucd_turkish_dotted_i_caseset PCRE2_SUFFIX(_pcre2_ucd_turkish_dotted_i_caseset_) +#define _pcre2_ucd_nocase_ranges PCRE2_SUFFIX(_pcre2_ucd_nocase_ranges_) +#define _pcre2_ucd_nocase_ranges_size PCRE2_SUFFIX(_pcre2_ucd_nocase_ranges_size_) #define _pcre2_ucd_digit_sets PCRE2_SUFFIX(_pcre2_ucd_digit_sets_) #define _pcre2_ucd_script_sets PCRE2_SUFFIX(_pcre2_ucd_script_sets_) #define _pcre2_ucd_records PCRE2_SUFFIX(_pcre2_ucd_records_) @@ -1967,18 +2236,23 @@ extern const uint8_t PRIV(utf8_table4)[]; #define _pcre2_utt PCRE2_SUFFIX(_pcre2_utt_) #define _pcre2_utt_names PCRE2_SUFFIX(_pcre2_utt_names_) #define _pcre2_utt_size PCRE2_SUFFIX(_pcre2_utt_size_) +#define _pcre2_ebcdic_1047_to_ascii PCRE2_SUFFIX(_pcre2_ebcdic_1047_to_ascii_) +#define _pcre2_ascii_to_ebcdic_1047 PCRE2_SUFFIX(_pcre2_ascii_to_ebcdic_1047_) extern const uint8_t PRIV(OP_lengths)[]; extern const uint32_t PRIV(callout_end_delims)[]; extern const uint32_t PRIV(callout_start_delims)[]; -extern const pcre2_compile_context PRIV(default_compile_context); -extern const pcre2_convert_context PRIV(default_convert_context); -extern const pcre2_match_context PRIV(default_match_context); +extern pcre2_compile_context PRIV(default_compile_context); +extern pcre2_convert_context PRIV(default_convert_context); +extern pcre2_match_context PRIV(default_match_context); extern const uint8_t PRIV(default_tables)[]; extern const uint32_t PRIV(hspace_list)[]; extern const uint32_t PRIV(vspace_list)[]; extern const uint32_t PRIV(ucd_boolprop_sets)[]; extern const uint32_t PRIV(ucd_caseless_sets)[]; +extern const uint32_t PRIV(ucd_turkish_dotted_i_caseset); +extern const uint32_t PRIV(ucd_nocase_ranges)[]; +extern const uint32_t PRIV(ucd_nocase_ranges_size); extern const uint32_t PRIV(ucd_digit_sets)[]; extern const uint32_t PRIV(ucd_script_sets)[]; extern const ucd_record PRIV(ucd_records)[]; @@ -1996,6 +2270,8 @@ extern const char *PRIV(unicode_version); extern const ucp_type_table PRIV(utt)[]; extern const char PRIV(utt_names)[]; extern const size_t PRIV(utt_size); +extern const uint8_t PRIV(ebcdic_1047_to_ascii)[]; +extern const uint8_t PRIV(ascii_to_ebcdic_1047)[]; /* Mode-dependent macros and hidden and private structures are defined in a separate file so that pcre2test can include them at all supported widths. When @@ -2019,11 +2295,13 @@ is available. */ #define _pcre2_auto_possessify PCRE2_SUFFIX(_pcre2_auto_possessify_) #define _pcre2_check_escape PCRE2_SUFFIX(_pcre2_check_escape_) +#define _pcre2_ckd_smul PCRE2_SUFFIX(_pcre2_ckd_smul_) #define _pcre2_extuni PCRE2_SUFFIX(_pcre2_extuni_) #define _pcre2_find_bracket PCRE2_SUFFIX(_pcre2_find_bracket_) #define _pcre2_is_newline PCRE2_SUFFIX(_pcre2_is_newline_) #define _pcre2_jit_free_rodata PCRE2_SUFFIX(_pcre2_jit_free_rodata_) #define _pcre2_jit_free PCRE2_SUFFIX(_pcre2_jit_free_) +#define _pcre2_jit_check_exec PCRE2_SUFFIX(_pcre2_jit_check_exec_) #define _pcre2_jit_get_size PCRE2_SUFFIX(_pcre2_jit_get_size_) #define _pcre2_jit_get_target PCRE2_SUFFIX(_pcre2_jit_get_target_) #define _pcre2_memctl_malloc PCRE2_SUFFIX(_pcre2_memctl_malloc_) @@ -2039,11 +2317,13 @@ is available. */ #define _pcre2_valid_utf PCRE2_SUFFIX(_pcre2_valid_utf_) #define _pcre2_was_newline PCRE2_SUFFIX(_pcre2_was_newline_) #define _pcre2_xclass PCRE2_SUFFIX(_pcre2_xclass_) +#define _pcre2_eclass PCRE2_SUFFIX(_pcre2_eclass_) extern int _pcre2_auto_possessify(PCRE2_UCHAR *, const compile_block *); extern int _pcre2_check_escape(PCRE2_SPTR *, PCRE2_SPTR, uint32_t *, - int *, uint32_t, uint32_t, BOOL, compile_block *); + int *, uint32_t, uint32_t, uint32_t, BOOL, compile_block *); +extern BOOL _pcre2_ckd_smul(PCRE2_SIZE *, int, int); extern PCRE2_SPTR _pcre2_extuni(uint32_t, PCRE2_SPTR, PCRE2_SPTR, PCRE2_SPTR, BOOL, int *); extern PCRE2_SPTR _pcre2_find_bracket(PCRE2_SPTR, BOOL, int); @@ -2051,6 +2331,7 @@ extern BOOL _pcre2_is_newline(PCRE2_SPTR, uint32_t, PCRE2_SPTR, uint32_t *, BOOL); extern void _pcre2_jit_free_rodata(void *, void *); extern void _pcre2_jit_free(void *, pcre2_memctl *); +extern BOOL _pcre2_jit_check_exec(void *, uint32_t); extern size_t _pcre2_jit_get_size(void *); const char * _pcre2_jit_get_target(void); extern void * _pcre2_memctl_malloc(size_t, pcre2_memctl *); @@ -2066,18 +2347,13 @@ extern int _pcre2_study(pcre2_real_code *); extern int _pcre2_valid_utf(PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE *); extern BOOL _pcre2_was_newline(PCRE2_SPTR, uint32_t, PCRE2_SPTR, uint32_t *, BOOL); -extern BOOL _pcre2_xclass(uint32_t, PCRE2_SPTR, BOOL); - -/* This function is needed only when memmove() is not available. */ - -#if !defined(VPCOMPAT) && !defined(HAVE_MEMMOVE) -#define _pcre2_memmove PCRE2_SUFFIX(_pcre2_memmove) -extern void * _pcre2_memmove(void *, const void *, size_t); -#endif +extern BOOL _pcre2_xclass(uint32_t, PCRE2_SPTR, const uint8_t *, BOOL); +extern BOOL _pcre2_eclass(uint32_t, PCRE2_SPTR, PCRE2_SPTR, + const uint8_t *, BOOL); #endif /* PCRE2_CODE_UNIT_WIDTH */ -extern BOOL PRIV(ckd_smul)(PCRE2_SIZE *, int, int); +#include "pcre2_util.h" #endif /* PCRE2_INTERNAL_H_IDEMPOTENT_GUARD */ diff --git a/std/regex/pcre2/pcre2_intmodedep.h b/std/regex/pcre2/pcre2_intmodedep.h index 9bd9e694a..269c418fe 100644 --- a/std/regex/pcre2/pcre2_intmodedep.h +++ b/std/regex/pcre2/pcre2_intmodedep.h @@ -47,9 +47,16 @@ to have access to the hidden structures at all supported widths. Some of the mode-dependent macros are required at different widths for different parts of the pcre2test code (in particular, the included -pcre_printint.c file). We undefine them here so that they can be re-defined for -multiple inclusions. Not all of these are used in pcre2test, but it's easier -just to undefine them all. */ +pcre2_printint_inc.h file). We undefine them here so that they can be re-defined +for multiple inclusions. Not all of these are used in pcre2test, but it's easier +just to undefine them all. + +You can also include pcre2_intmodedep.h with PCRE2_CODE_UNIT_WIDTH defined to +zero in order to simply clear the previous macros. */ + +#ifndef PCRE2_CODE_UNIT_WIDTH +#error PCRE2_CODE_UNIT_WIDTH must be defined +#endif #undef ACROSSCHAR #undef BACKCHAR @@ -81,9 +88,14 @@ just to undefine them all. */ #undef PUTINC #undef TABLE_GET +/************************************************* +* MACROS * +*************************************************/ +/* Macros may be undefined and re-defined if the same file handles multiple +bit-widths. */ -/* -------------------------- MACROS ----------------------------- */ +#if PCRE2_CODE_UNIT_WIDTH != 0 /* PCRE keeps offsets in its compiled code as at least 16-bit quantities (always stored in big-endian order in 8-bit mode) by default. These are used, @@ -97,11 +109,23 @@ unit string is now handled by the macros that are defined here. The macros are controlled by the value of LINK_SIZE. This defaults to 2, but values of 3 or 4 are also supported. */ +#ifndef CONFIGURED_LINK_SIZE +#if LINK_SIZE == 2 +#define CONFIGURED_LINK_SIZE 2 +#elif LINK_SIZE == 3 +#define CONFIGURED_LINK_SIZE 3 +#elif LINK_SIZE == 4 +#define CONFIGURED_LINK_SIZE 4 +#else +#error LINK_SIZE must be 2, 3, or 4 +#endif +#endif /* CONFIGURED_LINK_SIZE */ + /* ------------------- 8-bit support ------------------ */ #if PCRE2_CODE_UNIT_WIDTH == 8 -#if LINK_SIZE == 2 +#if CONFIGURED_LINK_SIZE == 2 #define PUT(a,n,d) \ (a[n] = (PCRE2_UCHAR)((d) >> 8)), \ (a[(n)+1] = (PCRE2_UCHAR)((d) & 255)) @@ -109,7 +133,7 @@ values of 3 or 4 are also supported. */ (unsigned int)(((a)[n] << 8) | (a)[(n)+1]) #define MAX_PATTERN_SIZE (1 << 16) -#elif LINK_SIZE == 3 +#elif CONFIGURED_LINK_SIZE == 3 #define PUT(a,n,d) \ (a[n] = (PCRE2_UCHAR)((d) >> 16)), \ (a[(n)+1] = (PCRE2_UCHAR)((d) >> 8)), \ @@ -118,7 +142,7 @@ values of 3 or 4 are also supported. */ (unsigned int)(((a)[n] << 16) | ((a)[(n)+1] << 8) | (a)[(n)+2]) #define MAX_PATTERN_SIZE (1 << 24) -#elif LINK_SIZE == 4 +#elif CONFIGURED_LINK_SIZE == 4 #define PUT(a,n,d) \ (a[n] = (PCRE2_UCHAR)((d) >> 24)), \ (a[(n)+1] = (PCRE2_UCHAR)((d) >> 16)), \ @@ -128,8 +152,6 @@ values of 3 or 4 are also supported. */ (unsigned int)(((a)[n] << 24) | ((a)[(n)+1] << 16) | ((a)[(n)+2] << 8) | (a)[(n)+3]) #define MAX_PATTERN_SIZE (1 << 30) /* Keep it positive */ -#else -#error LINK_SIZE must be 2, 3, or 4 #endif @@ -137,7 +159,7 @@ values of 3 or 4 are also supported. */ #elif PCRE2_CODE_UNIT_WIDTH == 16 -#if LINK_SIZE == 2 +#if CONFIGURED_LINK_SIZE == 2 #undef LINK_SIZE #define LINK_SIZE 1 #define PUT(a,n,d) \ @@ -146,7 +168,7 @@ values of 3 or 4 are also supported. */ (a[n]) #define MAX_PATTERN_SIZE (1 << 16) -#elif LINK_SIZE == 3 || LINK_SIZE == 4 +#elif CONFIGURED_LINK_SIZE == 3 || CONFIGURED_LINK_SIZE == 4 #undef LINK_SIZE #define LINK_SIZE 2 #define PUT(a,n,d) \ @@ -156,8 +178,6 @@ values of 3 or 4 are also supported. */ (unsigned int)(((a)[n] << 16) | (a)[(n)+1]) #define MAX_PATTERN_SIZE (1 << 30) /* Keep it positive */ -#else -#error LINK_SIZE must be 2, 3, or 4 #endif @@ -194,7 +214,7 @@ arithmetic results in a signed value. Hence the cast. */ #define GET2(a,n) (unsigned int)(((a)[n] << 8) | (a)[(n)+1]) #define PUT2(a,n,d) a[n] = (d) >> 8, a[(n)+1] = (d) & 255 -#else /* Code units are 16 or 32 bits */ +#elif PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 #define IMM2_SIZE 1 #define GET2(a,n) a[n] #define PUT2(a,n,d) a[n] = d @@ -219,7 +239,7 @@ check is needed before accessing these tables. */ #define CHMAX_255(c) TRUE #endif /* SUPPORT_UNICODE */ -#else /* Code units are 16 or 32 bits */ +#elif PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 #define CHMAX_255(c) ((c) <= 255u) #define MAX_255(c) ((c) <= 255u) #define MAX_MARK ((1u << 16) - 1) @@ -230,21 +250,6 @@ check is needed before accessing these tables. */ /* ----------------- Character-handling macros ----------------- */ -/* There is a proposed future special "UTF-21" mode, in which only the lowest -21 bits of a 32-bit character are interpreted as UTF, with the remaining 11 -high-order bits available to the application for other uses. In preparation for -the future implementation of this mode, there are macros that load a data item -and, if in this special mode, mask it to 21 bits. These macros all have names -starting with UCHAR21. In all other modes, including the normal 32-bit -library, the macros all have the same simple definitions. When the new mode is -implemented, it is expected that these definitions will be varied appropriately -using #ifdef when compiling the library that supports the special mode. */ - -#define UCHAR21(eptr) (*(eptr)) -#define UCHAR21TEST(eptr) (*(eptr)) -#define UCHAR21INC(eptr) (*(eptr)++) -#define UCHAR21INCTEST(eptr) (*(eptr)++) - /* When UTF encoding is being used, a character is no longer just a single byte in 8-bit mode or a single short in 16-bit mode. The macros for character handling generate simple sequences when used in the basic mode, and more @@ -285,7 +290,7 @@ UTF support is omitted, we don't even define them. */ #define HAS_EXTRALEN(c) HASUTF8EXTRALEN(c) -/* Returns with the additional number of characters if IS_MULTICHAR(c) is TRUE. +/* Returns with the additional number of characters if HAS_EXTRALEN(c) is TRUE. Otherwise it has an undefined behaviour. */ #define GET_EXTRALEN(c) (PRIV(utf8_table4)[(c) & 0x3fu]) @@ -371,7 +376,7 @@ because almost all calls are already within a block of UTF-8 only code. */ #define HAS_EXTRALEN(c) (((c) & 0xfc00u) == 0xd800u) -/* Returns with the additional number of characters if IS_MULTICHAR(c) is TRUE. +/* Returns with the additional number of characters if HAS_EXTRALEN(c) is TRUE. Otherwise it has an undefined behaviour. */ #define GET_EXTRALEN(c) 1 @@ -435,7 +440,7 @@ UTF-16 mode. */ c = *eptr; \ if ((c & 0xfc00u) == 0xd800u) GETUTF16LEN(c, eptr, len); -/* Get the next UTF-816character, testing for UTF-16 mode, not advancing the +/* Get the next UTF-16 character, testing for UTF-16 mode, not advancing the pointer, incrementing length if there is a low surrogate. This is called when we do not know if we are in UTF-16 mode. */ @@ -466,7 +471,7 @@ code. */ /* ------------------- 32-bit support ------------------ */ -#else +#elif PCRE2_CODE_UNIT_WIDTH == 32 /* These are trivial for the 32-bit library, since all UTF-32 characters fit into one PCRE2_UCHAR unit. */ @@ -547,6 +552,32 @@ These are all no-ops since all UTF-32 characters fit into one PCRE2_UCHAR. */ #define PUTINC(a,n,d) PUT(a,n,d), a += LINK_SIZE #define PUT2INC(a,n,d) PUT2(a,n,d), a += IMM2_SIZE +#endif /* PCRE2_CODE_UNIT_WIDTH != 0 */ + + + +/************************************************* +* STRUCTURES * +*************************************************/ + +/* We need a more complex include guard than usual, because the file can be +included once for each bit-width to define the various structures. */ + +#if PCRE2_CODE_UNIT_WIDTH == 8 && !defined PCRE2_INTMODEDEP_IDEMPOTENT_GUARD_8 +#define PCRE2_INTMODEDEP_IDEMPOTENT_GUARD_8 +#define PCRE2_INTMODEDEP_CAN_DEFINE +#endif +#if PCRE2_CODE_UNIT_WIDTH == 16 && !defined PCRE2_INTMODEDEP_IDEMPOTENT_GUARD_16 +#define PCRE2_INTMODEDEP_IDEMPOTENT_GUARD_16 +#define PCRE2_INTMODEDEP_CAN_DEFINE +#endif +#if PCRE2_CODE_UNIT_WIDTH == 32 && !defined PCRE2_INTMODEDEP_IDEMPOTENT_GUARD_32 +#define PCRE2_INTMODEDEP_IDEMPOTENT_GUARD_32 +#define PCRE2_INTMODEDEP_CAN_DEFINE +#endif + +#ifdef PCRE2_INTMODEDEP_CAN_DEFINE +#undef PCRE2_INTMODEDEP_CAN_DEFINE /* ----------------------- HIDDEN STRUCTURES ----------------------------- */ @@ -556,6 +587,11 @@ code that uses them is simpler because it assumes this. */ /* The real general context structure. At present it holds only data for custom memory control. */ +/* WARNING: if this is ever changed, code in pcre2_substitute.c will have to be +changed because it builds a general context "by hand" in order to avoid the +malloc() call in pcre2_general_context)_create(). There is also code in +pcre2_match.c that makes the same assumption. */ + typedef struct pcre2_real_general_context { pcre2_memctl memctl; } pcre2_real_general_context; @@ -574,6 +610,7 @@ typedef struct pcre2_real_compile_context { uint32_t parens_nest_limit; uint32_t extra_options; uint32_t max_varlookbehind; + uint32_t optimization_flags; } pcre2_real_compile_context; /* The real match context structure. */ @@ -584,10 +621,13 @@ typedef struct pcre2_real_match_context { pcre2_jit_callback jit_callback; void *jit_callback_data; #endif - int (*callout)(pcre2_callout_block *, void *); - void *callout_data; - int (*substitute_callout)(pcre2_substitute_callout_block *, void *); - void *substitute_callout_data; + int (*callout)(pcre2_callout_block *, void *); + void *callout_data; + int (*substitute_callout)(pcre2_substitute_callout_block *, void *); + void *substitute_callout_data; + PCRE2_SIZE (*substitute_case_callout)(PCRE2_SPTR, PCRE2_SIZE, PCRE2_UCHAR *, + PCRE2_SIZE, int, void *); + void *substitute_case_callout_data; PCRE2_SIZE offset_limit; uint32_t heap_limit; uint32_t match_limit; @@ -615,7 +655,7 @@ have 16-bit arguments in 8-bit and 16-bit modes, so we need no more than a #define CODE_BLOCKSIZE_TYPE PCRE2_SIZE #undef LOOKBEHIND_MAX -#define LOOKBEHIND_MAX UINT16_MAX +#define LOOKBEHIND_MAX ((int)UINT16_MAX) typedef struct pcre2_real_code { pcre2_memctl memctl; /* Memory control fields */ @@ -623,6 +663,7 @@ typedef struct pcre2_real_code { void *executable_jit; /* Pointer to JIT code */ uint8_t start_bitmap[32]; /* Bitmap for starting code unit < 256 */ CODE_BLOCKSIZE_TYPE blocksize; /* Total (bytes) that was malloc-ed */ + CODE_BLOCKSIZE_TYPE code_start; /* Byte code start offset */ uint32_t magic_number; /* Paranoid and endianness check */ uint32_t compile_options; /* Options passed to pcre2_compile() */ uint32_t overall_options; /* Options after processing the pattern */ @@ -641,6 +682,7 @@ typedef struct pcre2_real_code { uint16_t top_backref; /* Highest numbered back reference */ uint16_t name_entry_size; /* Size (code units) of table entries */ uint16_t name_count; /* Number of name entries in the table */ + uint32_t optimization_flags; /* Optimizations enabled at compile time */ } pcre2_real_code; /* The real match data structure. Define ovector as large as it can ever @@ -661,12 +703,14 @@ typedef struct pcre2_real_match_data { struct heapframe *heapframes; /* Backtracking frames heap memory */ PCRE2_SIZE heapframes_size; /* Malloc-ed size */ PCRE2_SIZE subject_length; /* Subject length */ + PCRE2_SIZE start_offset; /* Offset to start of search */ PCRE2_SIZE leftchar; /* Offset to leftmost code unit */ PCRE2_SIZE rightchar; /* Offset to rightmost code unit */ PCRE2_SIZE startchar; /* Offset to starting code unit */ uint8_t matchedby; /* Type of match (normal, JIT, DFA) */ uint8_t flags; /* Various flags */ uint16_t oveccount; /* Number of pairs */ + uint32_t options; /* Options passed in to the match call */ int rc; /* The return code from the match */ PCRE2_SIZE ovector[131072]; /* Must be last in the structure */ } pcre2_real_match_data; @@ -707,15 +751,51 @@ typedef struct branch_chain { } branch_chain; /* Structure for building a list of named groups during the first pass of -compiling. */ +compiling. When a duplicate name is stored in the list, its name is set to +the name of the first entry with the same name, and its length is set to 0. */ typedef struct named_group { PCRE2_SPTR name; /* Points to the name in the pattern */ uint32_t number; /* Group number */ uint16_t length; /* Length of the name */ - uint16_t isdup; /* TRUE if a duplicate */ + uint16_t hash_dup; /* A concatenation of a 15 bit hash code and + a singe bit which represents duplication */ } named_group; +/* Structure for storing compile time data. */ + +typedef struct compile_data { + struct compile_data *next; /* Next compile data */ +#ifdef PCRE2_DEBUG + uint8_t type; /* Debug only type of the data */ +#endif +} compile_data; + +/* Structure for caching sorted ranges. This improves the performance +of translating META code to byte code. */ + +typedef struct class_ranges { + compile_data header; /* Common header */ + size_t char_lists_size; /* Total size of encoded char lists */ + size_t char_lists_start; /* Start offset of encoded char lists */ + uint16_t range_list_size; /* Size of ranges array */ + uint16_t char_lists_types; /* The XCL_LIST header of char lists */ + /* Followed by the list of ranges (start/end pairs) */ +} class_ranges; + +/* Structure for sorted recurse arguments. */ + +typedef struct recurse_arguments { + compile_data header; /* Common header */ + size_t size; /* Total size */ + size_t skip_size; /* Space consumed by arguments */ +} recurse_arguments; + +typedef union class_bits_storage { + uint8_t classbits[32]; + uint32_t classwords[8]; +} class_bits_storage; + /* Structure for passing "static" information around between the functions doing the compiling, so that they are thread-safe. */ @@ -725,14 +805,15 @@ typedef struct compile_block { const uint8_t *fcc; /* Points to case-flipping table */ const uint8_t *cbits; /* Points to character type table */ const uint8_t *ctypes; /* Points to table of type maps */ - PCRE2_SPTR start_workspace; /* The start of working space */ - PCRE2_SPTR start_code; /* The start of the compiled code */ + PCRE2_UCHAR *start_workspace; /* The start of working space */ + PCRE2_UCHAR *start_code; /* The start of the compiled code */ PCRE2_SPTR start_pattern; /* The start of the pattern */ PCRE2_SPTR end_pattern; /* The end of the pattern */ PCRE2_UCHAR *name_table; /* The name/number table */ PCRE2_SIZE workspace_size; /* Size of workspace */ PCRE2_SIZE small_ref_offset[10]; /* Offsets for \1 to \9 */ PCRE2_SIZE erroroffset; /* Offset of error in pattern */ + class_bits_storage classbits; /* Temporary store for classbits */ uint16_t names_found; /* Number of entries so far */ uint16_t name_entry_size; /* Size of each entry */ uint16_t parens_depth; /* Depth of nested parentheses */ @@ -750,9 +831,9 @@ typedef struct compile_block { uint32_t backref_map; /* Bitmap of low back refs */ uint32_t nltype; /* Newline type */ uint32_t nllen; /* Newline string length */ - uint32_t class_range_start; /* Overall class range start */ - uint32_t class_range_end; /* Overall class range end */ PCRE2_UCHAR nl[4]; /* Newline string when fixed length */ + uint8_t class_op_used[ECLASS_NEST_LIMIT]; /* Operation used for + extended classes */ uint32_t req_varyopt; /* "After variable item" flag for reqbyte */ uint32_t max_varlookbehind; /* Limit for variable lookbehinds */ int max_lookbehind; /* Maximum lookbehind encountered (characters) */ @@ -760,6 +841,11 @@ typedef struct compile_block { BOOL had_pruneorskip; /* (*PRUNE) or (*SKIP) encountered */ BOOL had_recurse; /* Had a pattern recursion or subroutine call */ BOOL dupnames; /* Duplicate names exist */ + compile_data *first_data; /* First item in the compile data list */ + compile_data *last_data; /* Last item in the compile data list */ +#ifdef SUPPORT_WIDE_CHARS + size_t char_lists_size; /* Current size of character lists */ +#endif } compile_block; /* Structure for keeping the properties of the in-memory stack used @@ -790,38 +876,125 @@ we don't generate any code when all is well. */ typedef struct heapframe { /* The first set of fields are variables that have to be preserved over calls - to RRMATCH(), but which do not need to be copied to new frames. */ + to RMATCH(), but which do not need to be copied to new frames. */ PCRE2_SPTR ecode; /* The current position in the pattern */ - PCRE2_SPTR temp_sptr[2]; /* Used for short-term PCRE_SPTR values */ - PCRE2_SIZE length; /* Used for character, string, or code lengths */ PCRE2_SIZE back_frame; /* Amount to subtract on RRETURN */ - PCRE2_SIZE temp_size; /* Used for short-term PCRE2_SIZE values */ uint32_t rdepth; /* Function "recursion" depth within pcre2_match() */ uint32_t group_frame_type; /* Type information for group frames */ - uint32_t temp_32[4]; /* Used for short-term 32-bit or BOOL values */ uint8_t return_id; /* Where to go on in internal "return" */ uint8_t op; /* Processing opcode */ + uint8_t byte1; /* A temporary byte to store anything */ + uint8_t byte2; /* A temporary byte to store anything */ - /* At this point, the structure is 16-bit aligned. On most architectures + /* At this point, the structure is 32-bit aligned. On most architectures the alignment requirement for a pointer will ensure that the eptr field below is 32-bit or 64-bit aligned. However, on m68k it is fine to have a pointer - that is 16-bit aligned. We must therefore ensure that what comes between here - and eptr is an odd multiple of 16 bits so as to get back into 32-bit - alignment. This happens naturally when PCRE2_UCHAR is 8 bits wide, but needs - fudges in the other cases. In the 32-bit case the padding comes first so that - the occu field itself is 32-bit aligned. Without the padding, this structure - is no longer a multiple of PCRE2_SIZE on m68k, and the check below fails. */ - + that is 16-bit aligned, so all uint8_t members above are required for a 32 + bit alignment. */ + + union { + /* Fields for storing localized data, which + is preserved by RMATCH() calls. */ + + struct { + PCRE2_SPTR start_eptr; + PCRE2_SPTR charptr; + uint32_t min; + uint32_t max; + uint32_t c; + union { + uint32_t oc; + /* Buffer for other case code units. The size of + the buffer is enough to store the longest character. */ #if PCRE2_CODE_UNIT_WIDTH == 8 - PCRE2_UCHAR occu[6]; /* Used for other case code units */ + PCRE2_UCHAR occu[4]; #elif PCRE2_CODE_UNIT_WIDTH == 16 - PCRE2_UCHAR occu[2]; /* Used for other case code units */ - uint8_t unused[2]; /* Ensure 32-bit alignment (see above) */ + PCRE2_UCHAR occu[2]; #else - uint8_t unused[2]; /* Ensure 32-bit alignment (see above) */ - PCRE2_UCHAR occu[1]; /* Used for other case code units */ + PCRE2_UCHAR occu[1]; #endif + } oc; + } char_repeat; + + struct { + PCRE2_SPTR start_eptr; + uint32_t min; + uint32_t max; + uint32_t c; + uint32_t oc; + } charnot_repeat; + + struct { + PCRE2_SPTR start_eptr; + PCRE2_SPTR byte_map_address; + uint32_t min; + uint32_t max; + } class_repeat; + + struct { + PCRE2_SPTR start_eptr; + PCRE2_SPTR xclass_data; + uint32_t min; + uint32_t max; + } xclass_repeat; + + struct { + PCRE2_SPTR start_eptr; + PCRE2_SPTR eclass_data; + PCRE2_SIZE eclass_len; + uint32_t min; + uint32_t max; + } eclass_repeat; + + struct { + PCRE2_SPTR start_eptr; + uint32_t min; + uint32_t max; + uint32_t ctype; + uint32_t propvalue; + } type_repeat; + + struct { + PCRE2_SPTR start; + PCRE2_SIZE offset; + PCRE2_SIZE length; + uint32_t min; + uint32_t max; + } ref_repeat; + + struct { + uint32_t frame_type; /* Set for all that use GROUPLOOP */ + } op_bra; + + struct { + PCRE2_SPTR start_eptr; + PCRE2_SPTR start_group; + uint32_t frame_type; + } op_brapos; + + struct { + PCRE2_SPTR start_branch; + uint32_t frame_type; + } op_recurse; + + struct { + PCRE2_SPTR saved_end_subject; + PCRE2_SPTR saved_eptr; + PCRE2_SIZE true_end_extra; + uint32_t saved_moptions; + } op_assert_scs; + + struct { + PCRE2_SPTR start_branch; + PCRE2_SIZE length; + } op_cond; + + struct { + uint32_t min; + uint32_t max; + } op_vreverse; + } fields; /* The rest have to be copied from the previous frame whenever a new frame becomes current. The final field is specified as a large vector so that @@ -841,11 +1014,10 @@ typedef struct heapframe { PCRE2_SIZE ovector[131072]; /* Must be last in the structure */ } heapframe; -/* This typedef is a check that the size of the heapframe structure is a -multiple of PCRE2_SIZE. See various comments above. */ +/* Assert that the size of the heapframe structure is a multiple of PCRE2_SIZE. +See various comments above. */ -typedef char check_heapframe_size[ - ((sizeof(heapframe) % sizeof(PCRE2_SIZE)) == 0)? (+1):(-1)]; +STATIC_ASSERT((sizeof(heapframe) % sizeof(PCRE2_SIZE)) == 0, heapframe_size); /* Structure for computing the alignment of heapframe. */ @@ -869,7 +1041,9 @@ typedef struct match_block { uint32_t match_call_count; /* Number of times a new frame is created */ BOOL hitend; /* Hit the end of the subject at some point */ BOOL hasthen; /* Pattern contains (*THEN) */ + BOOL hasbsk; /* Pattern contains \K */ BOOL allowemptypartial; /* Allow empty hard partial */ + BOOL allowlookaroundbsk; /* Allow \K within lookarounds */ const uint8_t *lcc; /* Points to lower casing table */ const uint8_t *fcc; /* Points to case-flipping table */ const uint8_t *ctypes; /* Points to table of type maps */ @@ -937,4 +1111,6 @@ typedef struct dfa_match_block { #endif /* PCRE2_PCRE2TEST */ +#endif /* PCRE2_INTMODEDEP_CAN_DEFINE */ + /* End of pcre2_intmodedep.h */ diff --git a/std/regex/pcre2/pcre2_jit_compile.c b/std/regex/pcre2/pcre2_jit_compile.c index 92f4fb858..c5da883ca 100644 --- a/std/regex/pcre2/pcre2_jit_compile.c +++ b/std/regex/pcre2/pcre2_jit_compile.c @@ -39,10 +39,6 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #if defined(__has_feature) #if __has_feature(memory_sanitizer) #include @@ -82,7 +78,7 @@ pcre2_memctl *allocator = ((pcre2_memctl*)allocator_data); allocator->free(ptr, allocator->memory_data); } -#include "sljit/sljitLir.c" +#include "../deps/sljit/sljit_src/sljitLir.c" #if defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED #error Unsupported architecture @@ -103,7 +99,7 @@ Fast, but limited size. */ /* Growth rate for stack allocated by the OS. Should be the multiply of page size. */ -#define STACK_GROWTH_RATE 8192 +#define STACK_GROWTH_RATE (sljit_sw)8192 /* Enable to check that the allocation could destroy temporaries. */ #if defined SLJIT_DEBUG && SLJIT_DEBUG @@ -282,14 +278,14 @@ typedef struct bracket_backtrack { struct sljit_label *zero_matchingpath; /* Contains the branches of a failed condition. */ union { - /* Both for OP_COND, OP_SCOND. */ - jump_list *condfailed; + /* Both for OP_COND, OP_SCOND, OP_ASSERT_SCS. */ + jump_list *no_capture; assert_backtrack *assert; /* For OP_ONCE. Less than 0 if not needed. */ int framesize; - /* For brackets with >3 alternatives. */ - struct sljit_jump *matching_mov_addr; } u; + /* For brackets with >3 alternatives. */ + struct sljit_jump *matching_mov_addr; /* Points to our private memory word on the stack. */ int private_data_ptr; } bracket_backtrack; @@ -313,20 +309,19 @@ typedef struct char_iterator_backtrack { backtrack_common common; /* Next iteration. */ struct sljit_label *matchingpath; - union { - jump_list *backtracks; - struct { - unsigned int othercasebit; - PCRE2_UCHAR chr; - BOOL enabled; - } charpos; - } u; + /* Creating a range based on the next character. */ + struct { + unsigned int othercasebit; + PCRE2_UCHAR chr; + BOOL charpos_enabled; + } charpos; } char_iterator_backtrack; typedef struct ref_iterator_backtrack { backtrack_common common; /* Next iteration. */ struct sljit_label *matchingpath; + BOOL possessive_or_exact; } ref_iterator_backtrack; typedef struct recurse_entry { @@ -341,6 +336,10 @@ typedef struct recurse_entry { jump_list *backtrack_calls; /* Points to the starting opcode. */ sljit_sw start; + /* Start of caller arguments. */ + PCRE2_SPTR arg_start; + /* Size of caller arguments in bytes. */ + sljit_uw arg_size; } recurse_entry; typedef struct recurse_backtrack { @@ -400,14 +399,20 @@ typedef struct compiler_common { sljit_s32 *private_data_ptrs; /* Chain list of read-only data ptrs. */ void *read_only_data_head; - /* Tells whether the capturing bracket is optimized. */ - sljit_u8 *optimized_cbracket; + /* Bitset which tells which capture brackets can be optimized. */ + sljit_u8 *optimized_cbrackets; + /* Bitset for tracking capture bracket status. */ + sljit_u8 *cbracket_bitset; /* Tells whether the starting offset is a target of then. */ sljit_u8 *then_offsets; /* Current position where a THEN must jump. */ then_trap_backtrack *then_trap; /* Starting offset of private data for capturing brackets. */ sljit_s32 cbra_ptr; +#if defined SLJIT_DEBUG && SLJIT_DEBUG + /* End offset of locals for assertions. */ + sljit_s32 locals_size; +#endif /* Output vector starting point. Must be divisible by 2. */ sljit_s32 ovector_start; /* Points to the starting character of the current match. */ @@ -429,6 +434,11 @@ typedef struct compiler_common { Each item must have a previous offset and type (see control_types) values. See do_search_mark. */ sljit_s32 control_head_ptr; + /* The offset of the saved STR_END in the outermost + scan substring block. Since scan substring restores + STR_END after a match, it is enough to restore + STR_END inside a scan substring block. */ + sljit_s32 restore_end_ptr; /* Points to the last matched capture block index. */ sljit_s32 capture_last_ptr; /* Fast forward skipping byte code pointer. */ @@ -436,6 +446,8 @@ typedef struct compiler_common { /* Locals used by fast fail optimization. */ sljit_s32 early_fail_start_ptr; sljit_s32 early_fail_end_ptr; + /* Byte length of optimized_cbrackets and cbracket_bitset. */ + sljit_u32 cbracket_bitset_length; /* Variables used by recursive call generator. */ sljit_s32 recurse_bitset_size; uint8_t *recurse_bitset; @@ -461,6 +473,8 @@ typedef struct compiler_common { BOOL local_quit_available; /* Currently in a positive assertion. */ BOOL in_positive_assertion; + /* More than STACK_GROWTH_RATE / 2 stack memory is allocated. */ + BOOL large_stack_allocation; /* Newline control. */ int nltype; sljit_u32 nlmax; @@ -513,7 +527,6 @@ typedef struct compiler_common { BOOL invalid_utf; BOOL ucp; /* Points to saving area for iref. */ - sljit_s32 iref_ptr; jump_list *getucd; jump_list *getucdtype; #if PCRE2_CODE_UNIT_WIDTH == 8 @@ -603,14 +616,14 @@ typedef struct compare_context { #endif /* Local space layout. */ -/* These two locals can be used by the current opcode. */ -#define LOCALS0 (0 * sizeof(sljit_sw)) -#define LOCALS1 (1 * sizeof(sljit_sw)) -/* Two local variables for possessive quantifiers (char1 cannot use them). */ -#define POSSESSIVE0 (2 * sizeof(sljit_sw)) -#define POSSESSIVE1 (3 * sizeof(sljit_sw)) /* Max limit of recursions. */ -#define LIMIT_MATCH (4 * sizeof(sljit_sw)) +#define LIMIT_MATCH (0 * sizeof(sljit_sw)) +/* Local variables. Their number is computed by check_opcode_types. */ +#define LOCAL0 (1 * sizeof(sljit_sw)) +#define LOCAL1 (2 * sizeof(sljit_sw)) +#define LOCAL2 (3 * sizeof(sljit_sw)) +#define LOCAL3 (4 * sizeof(sljit_sw)) +#define LOCAL4 (5 * sizeof(sljit_sw)) /* The output vector is stored on the stack, and contains pointers to characters. The vector data is divided into two groups: the first group contains the start / end character pointers, and the second is @@ -667,7 +680,7 @@ the start pointers when the end of the capturing group has not yet reached. */ #define GET_LOCAL_BASE(dst, dstw, offset) \ sljit_get_local_base(compiler, (dst), (dstw), (offset)) -#define READ_CHAR_MAX 0x7fffffff +#define READ_CHAR_MAX ((sljit_u32)0xffffffff) #define INVALID_UTF_CHAR -1 #define UNASSIGNED_UTF_CHAR 888 @@ -862,7 +875,7 @@ the start pointers when the end of the capturing group has not yet reached. */ static PCRE2_SPTR bracketend(PCRE2_SPTR cc) { -SLJIT_ASSERT((*cc >= OP_ASSERT && *cc <= OP_ASSERTBACK_NA) || (*cc >= OP_ONCE && *cc <= OP_SCOND)); +SLJIT_ASSERT((*cc >= OP_ASSERT && *cc <= OP_ASSERT_SCS) || (*cc >= OP_ONCE && *cc <= OP_SCOND)); do cc += GET(cc, 1); while (*cc == OP_ALT); SLJIT_ASSERT(*cc >= OP_KET && *cc <= OP_KETRPOS); cc += 1 + LINK_SIZE; @@ -872,7 +885,7 @@ return cc; static int no_alternatives(PCRE2_SPTR cc) { int count = 0; -SLJIT_ASSERT((*cc >= OP_ASSERT && *cc <= OP_ASSERTBACK_NA) || (*cc >= OP_ONCE && *cc <= OP_SCOND)); +SLJIT_ASSERT((*cc >= OP_ASSERT && *cc <= OP_ASSERT_SCS) || (*cc >= OP_ONCE && *cc <= OP_SCOND)); do { cc += GET(cc, 1); @@ -975,6 +988,7 @@ switch(*cc) case OP_ASSERTBACK_NOT: case OP_ASSERT_NA: case OP_ASSERTBACK_NA: + case OP_ASSERT_SCS: case OP_ONCE: case OP_SCRIPT_RUN: case OP_BRA: @@ -1097,7 +1111,9 @@ switch(*cc) return cc + GET(cc, 1 + 2*LINK_SIZE); #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8 + case OP_ECLASS: case OP_XCLASS: + SLJIT_COMPILE_ASSERT(OP_XCLASS + 1 == OP_ECLASS && OP_CLASS + 1 == OP_NCLASS && OP_NCLASS < OP_XCLASS, class_byte_code_order); return cc + GET(cc, 1); #endif @@ -1114,12 +1130,52 @@ switch(*cc) } } +static sljit_s32 ref_update_local_size(compiler_common *common, PCRE2_SPTR cc, sljit_s32 current_locals_size) +{ +/* Depends on do_casefulcmp(), do_caselesscmp(), and compile_ref_matchingpath() */ +int locals_size = 2 * SSIZE_OF(sw); +SLJIT_UNUSED_ARG(common); + +#ifdef SUPPORT_UNICODE +if ((*cc == OP_REFI || *cc == OP_DNREFI) && (common->utf || common->ucp)) + locals_size = 3 * SSIZE_OF(sw); +#endif + +cc += PRIV(OP_lengths)[*cc]; +/* Although do_casefulcmp() uses only one local, the allocate_stack() +calls during the repeat destroys LOCAL1 variables. */ +if (*cc >= OP_CRSTAR && *cc <= OP_CRPOSRANGE) + { + locals_size += 2 * SSIZE_OF(sw); + if (*cc >= OP_CRPOSRANGE && GET2(cc, 1 + IMM2_SIZE + 1) != GET2(cc, 1 + IMM2_SIZE + 1 + IMM2_SIZE)) + locals_size += SSIZE_OF(sw); + } + +return (current_locals_size >= locals_size) ? current_locals_size : locals_size; +} + +static SLJIT_INLINE BOOL is_optimized_cbracket(compiler_common *common, sljit_s32 capture_index) +{ +sljit_u8 bit = (sljit_u8)(1 << (capture_index & 0x7)); +return (common->optimized_cbrackets[capture_index >> 3] & bit) != 0; +} + +static SLJIT_INLINE void clear_optimized_cbracket(compiler_common *common, sljit_s32 capture_index) +{ +sljit_u8 mask = (sljit_u8)~(1 << (capture_index & 0x7)); +common->optimized_cbrackets[capture_index >> 3] &= mask; +} + static BOOL check_opcode_types(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend) { int count; PCRE2_SPTR slot; PCRE2_SPTR assert_back_end = cc - 1; PCRE2_SPTR assert_na_end = cc - 1; +sljit_s32 locals_size = 2 * SSIZE_OF(sw); +BOOL set_recursive_head = FALSE; +BOOL set_capture_last = FALSE; +BOOL set_mark = FALSE; /* Calculate important variables (like stack size) and checks whether all opcodes are supported. */ while (cc < ccend) @@ -1132,22 +1188,41 @@ while (cc < ccend) cc += 1; break; + case OP_TYPEUPTO: + case OP_TYPEEXACT: + if (cc[1 + IMM2_SIZE] == OP_EXTUNI && locals_size <= 3 * SSIZE_OF(sw)) + locals_size = 3 * SSIZE_OF(sw); + cc += (2 + IMM2_SIZE) - 1; + break; + + case OP_TYPEPOSSTAR: + case OP_TYPEPOSPLUS: + case OP_TYPEPOSQUERY: + if (cc[1] == OP_EXTUNI && locals_size <= 3 * SSIZE_OF(sw)) + locals_size = 3 * SSIZE_OF(sw); + cc += 2 - 1; + break; + + case OP_TYPEPOSUPTO: +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 + if (common->utf && locals_size <= 3 * SSIZE_OF(sw)) + locals_size = 3 * SSIZE_OF(sw); +#endif + if (cc[1 + IMM2_SIZE] == OP_EXTUNI && locals_size <= 3 * SSIZE_OF(sw)) + locals_size = 3 * SSIZE_OF(sw); + cc += (2 + IMM2_SIZE) - 1; + break; + case OP_REFI: -#ifdef SUPPORT_UNICODE - if (common->iref_ptr == 0) - { - common->iref_ptr = common->ovector_start; - common->ovector_start += 3 * sizeof(sljit_sw); - } -#endif /* SUPPORT_UNICODE */ - /* Fall through. */ case OP_REF: - common->optimized_cbracket[GET2(cc, 1)] = 0; - cc += 1 + IMM2_SIZE; + locals_size = ref_update_local_size(common, cc, locals_size); + clear_optimized_cbracket(common, GET2(cc, 1)); + cc += PRIV(OP_lengths)[*cc]; break; case OP_ASSERT_NA: case OP_ASSERTBACK_NA: + case OP_ASSERT_SCS: slot = bracketend(cc); if (slot > assert_na_end) assert_na_end = slot; @@ -1156,7 +1231,7 @@ while (cc < ccend) case OP_CBRAPOS: case OP_SCBRAPOS: - common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] = 0; + clear_optimized_cbracket(common, GET2(cc, 1 + LINK_SIZE)); cc += 1 + LINK_SIZE + IMM2_SIZE; break; @@ -1170,40 +1245,39 @@ while (cc < ccend) break; case OP_CREF: - common->optimized_cbracket[GET2(cc, 1)] = 0; + clear_optimized_cbracket(common, GET2(cc, 1)); cc += 1 + IMM2_SIZE; break; - case OP_DNREF: case OP_DNREFI: + case OP_DNREF: + locals_size = ref_update_local_size(common, cc, locals_size); + PCRE2_FALLTHROUGH /* Fall through */ case OP_DNCREF: count = GET2(cc, 1 + IMM2_SIZE); slot = common->name_table + GET2(cc, 1) * common->name_entry_size; while (count-- > 0) { - common->optimized_cbracket[GET2(slot, 0)] = 0; + clear_optimized_cbracket(common, GET2(slot, 0)); slot += common->name_entry_size; } - cc += 1 + 2 * IMM2_SIZE; + cc += PRIV(OP_lengths)[*cc]; break; case OP_RECURSE: /* Set its value only once. */ - if (common->recursive_head_ptr == 0) + set_recursive_head = TRUE; + cc += 1 + LINK_SIZE; + while (*cc == OP_CREF) { - common->recursive_head_ptr = common->ovector_start; - common->ovector_start += sizeof(sljit_sw); + clear_optimized_cbracket(common, GET2(cc, 1)); + cc += 1 + IMM2_SIZE; } - cc += 1 + LINK_SIZE; break; case OP_CALLOUT: case OP_CALLOUT_STR: - if (common->capture_last_ptr == 0) - { - common->capture_last_ptr = common->ovector_start; - common->ovector_start += sizeof(sljit_sw); - } + set_capture_last = TRUE; cc += (*cc == OP_CALLOUT) ? PRIV(OP_lengths)[OP_CALLOUT] : GET(cc, 1 + 2*LINK_SIZE); break; @@ -1217,19 +1291,12 @@ while (cc < ccend) case OP_THEN_ARG: common->has_then = TRUE; common->control_head_ptr = 1; - /* Fall through. */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_COMMIT_ARG: case OP_PRUNE_ARG: - if (cc < assert_na_end) - return FALSE; - /* Fall through */ case OP_MARK: - if (common->mark_ptr == 0) - { - common->mark_ptr = common->ovector_start; - common->ovector_start += sizeof(sljit_sw); - } + set_mark = TRUE; cc += 1 + 2 + cc[1]; break; @@ -1242,8 +1309,6 @@ while (cc < ccend) case OP_SKIP: if (cc < assert_back_end) common->has_skip_in_assert_back = TRUE; - if (cc < assert_na_end) - return FALSE; cc += 1; break; @@ -1252,19 +1317,31 @@ while (cc < ccend) common->has_skip_arg = TRUE; if (cc < assert_back_end) common->has_skip_in_assert_back = TRUE; - if (cc < assert_na_end) - return FALSE; cc += 1 + 2 + cc[1]; break; - case OP_PRUNE: - case OP_COMMIT: case OP_ASSERT_ACCEPT: if (cc < assert_na_end) return FALSE; cc++; break; +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 + case OP_CRPOSRANGE: + /* The second value can be 0 for infinite repeats. */ + if (common->utf && GET2(cc, 1) != GET2(cc, 1 + IMM2_SIZE) && locals_size <= 3 * SSIZE_OF(sw)) + locals_size = 3 * SSIZE_OF(sw); + cc += 1 + 2 * IMM2_SIZE; + break; + + case OP_POSUPTO: + case OP_POSUPTOI: + case OP_NOTPOSUPTO: + case OP_NOTPOSUPTOI: + if (common->utf && locals_size <= 3 * SSIZE_OF(sw)) + locals_size = 3 * SSIZE_OF(sw); +#endif + PCRE2_FALLTHROUGH /* Fall through */ default: cc = next_opcode(common, cc); if (cc == NULL) @@ -1272,6 +1349,36 @@ while (cc < ccend) break; } } + +SLJIT_ASSERT((locals_size & (SSIZE_OF(sw) - 1)) == 0); +#if defined SLJIT_DEBUG && SLJIT_DEBUG +common->locals_size = locals_size; +#endif + +if (locals_size > 0) + common->ovector_start += locals_size; + +if (set_mark) + { + SLJIT_ASSERT(common->mark_ptr == 0); + common->mark_ptr = common->ovector_start; + common->ovector_start += sizeof(sljit_sw); + } + +if (set_recursive_head) + { + SLJIT_ASSERT(common->recursive_head_ptr == 0); + common->recursive_head_ptr = common->ovector_start; + common->ovector_start += sizeof(sljit_sw); + } + +if (set_capture_last) + { + SLJIT_ASSERT(common->capture_last_ptr == 0); + common->capture_last_ptr = common->ovector_start; + common->ovector_start += sizeof(sljit_sw); + } + return TRUE; } @@ -1300,7 +1407,7 @@ int result = 0; int count, prev_count; SLJIT_ASSERT(*cc == OP_ONCE || *cc == OP_BRA || *cc == OP_CBRA); -SLJIT_ASSERT(*cc != OP_CBRA || common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] != 0); +SLJIT_ASSERT(*cc != OP_CBRA || is_optimized_cbracket(common, GET2(cc, 1 + LINK_SIZE))); SLJIT_ASSERT(start < EARLY_FAIL_ENHANCE_MAX); next_alt = cc + GET(cc, 1); @@ -1383,7 +1490,7 @@ do case OP_TYPEMINPLUS: if (count == 2) count = 3; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_TYPESTAR: case OP_TYPEPLUS: @@ -1412,7 +1519,7 @@ do case OP_TYPEMINUPTO: case OP_TYPEPOSUPTO: cc += IMM2_SIZE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_TYPEQUERY: case OP_TYPEMINQUERY: @@ -1433,7 +1540,7 @@ do case OP_NOTMINPLUSI: if (count == 2) count = 3; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_STAR: case OP_PLUS: @@ -1486,7 +1593,7 @@ do case OP_NOTEXACTI: case OP_NOTPOSUPTOI: cc += IMM2_SIZE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_QUERY: case OP_MINQUERY: @@ -1512,8 +1619,9 @@ do case OP_NCLASS: #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8 case OP_XCLASS: + case OP_ECLASS: accelerated_start = cc; - cc += ((*cc == OP_XCLASS) ? GET(cc, 1) : (unsigned int)(1 + (32 / sizeof(PCRE2_UCHAR)))); + cc += (*cc >= OP_XCLASS) ? GET(cc, 1) : (unsigned int)(1 + (32 / sizeof(PCRE2_UCHAR))); #else accelerated_start = cc; cc += (1 + (32 / sizeof(PCRE2_UCHAR))); @@ -1525,7 +1633,7 @@ do case OP_CRMINPLUS: if (count == 2) count = 3; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_CRSTAR: case OP_CRPLUS: @@ -1547,7 +1655,7 @@ do } cc += 2 * IMM2_SIZE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_CRQUERY: case OP_CRMINQUERY: case OP_CRPOSQUERY: @@ -1577,7 +1685,7 @@ do count = 3; end = bracketend(cc); - if (end[-1 - LINK_SIZE] != OP_KET || (*cc == OP_CBRA && common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0)) + if (end[-1 - LINK_SIZE] != OP_KET || (*cc == OP_CBRA && !is_optimized_cbracket(common, GET2(cc, 1 + LINK_SIZE)))) break; prev_count = detect_early_fail(common, cc, private_data_start, depth + 1, prev_count); @@ -1687,7 +1795,7 @@ switch(*cc) if (max == 0) return (*cc == OP_CRRANGE) ? 2 : 1; max -= min; - if (max > 2) + if (max > (sljit_u32)(*cc == OP_CRRANGE ? 0 : 1)) max = 2; return max; @@ -1758,7 +1866,8 @@ if (*next == OP_BRAZERO || *next == OP_BRAMINZERO) if (i == max) { - common->private_data_ptrs[max_end - common->start - LINK_SIZE] = next_end - max_end; + /* Patterns must fit into an int32 even for link-size=4. */ + common->private_data_ptrs[max_end - common->start - LINK_SIZE] = (sljit_s32)(next_end - max_end); common->private_data_ptrs[max_end - common->start - LINK_SIZE + 1] = (type == OP_BRAZERO) ? OP_UPTO : OP_MINUPTO; /* +2 the original and the last. */ common->private_data_ptrs[max_end - common->start - LINK_SIZE + 2] = max + 2; @@ -1773,7 +1882,7 @@ if (*next == OP_BRAZERO || *next == OP_BRAMINZERO) if (min >= 3) { - common->private_data_ptrs[end - common->start - LINK_SIZE] = max_end - end; + common->private_data_ptrs[end - common->start - LINK_SIZE] = (sljit_s32)(max_end - end); common->private_data_ptrs[end - common->start - LINK_SIZE + 1] = OP_EXACT; common->private_data_ptrs[end - common->start - LINK_SIZE + 2] = min; return TRUE; @@ -1905,6 +2014,12 @@ while (cc < ccend) bracketlen = 1 + LINK_SIZE; break; + case OP_ASSERT_SCS: + common->private_data_ptrs[cc - common->start] = private_data_ptr; + private_data_ptr += 2 * sizeof(sljit_sw); + bracketlen = 1 + LINK_SIZE; + break; + case OP_CBRAPOS: case OP_SCBRAPOS: common->private_data_ptrs[cc - common->start] = private_data_ptr; @@ -1962,13 +2077,13 @@ while (cc < ccend) CASE_ITERATOR_TYPE_PRIVATE_DATA_2A size = 1; - if (cc[1] != OP_ANYNL && cc[1] != OP_EXTUNI) + if (cc[1] != OP_EXTUNI) space = 2; break; case OP_TYPEUPTO: size = 1 + IMM2_SIZE; - if (cc[1 + IMM2_SIZE] != OP_ANYNL && cc[1 + IMM2_SIZE] != OP_EXTUNI) + if (cc[1 + IMM2_SIZE] != OP_EXTUNI) space = 2; break; @@ -1985,6 +2100,7 @@ while (cc < ccend) #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8 case OP_XCLASS: + case OP_ECLASS: size = GET(cc, 1); space = get_class_iterator_size(cc + size); break; @@ -2031,11 +2147,22 @@ while (cc < ccend) *private_data_start = private_data_ptr; } +static SLJIT_INLINE BOOL is_cbracket_processed(compiler_common *common, sljit_s32 capture_index) +{ +sljit_u8 bit = (sljit_u8)(1 << (capture_index & 0x7)); +sljit_u8 *ptr = common->cbracket_bitset + (capture_index >> 3); +sljit_u8 value = *ptr; + +*ptr |= bit; +return (value & bit) != 0; +} + /* Returns with a frame_types (always < 0) if no need for frame. */ static int get_framesize(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, BOOL recursive, BOOL *needs_control_head) { int length = 0; int possessive = 0; +int offset; BOOL stack_restore = FALSE; BOOL setsom_found = recursive; BOOL setmark_found = recursive; @@ -2049,6 +2176,8 @@ SLJIT_ASSERT(common->control_head_ptr != 0); *needs_control_head = FALSE; #endif +memset(common->cbracket_bitset, 0, common->cbracket_bitset_length); + if (ccend == NULL) { ccend = bracketend(cc) - (1 + LINK_SIZE); @@ -2109,7 +2238,15 @@ while (cc < ccend) length += 2; capture_last_found = TRUE; } + cc += 1 + LINK_SIZE; + while (*cc == OP_CREF) + { + offset = GET2(cc, 1); + if (!is_cbracket_processed(common, offset)) + length += 3; + cc += 1 + IMM2_SIZE; + } break; case OP_CBRA: @@ -2122,7 +2259,10 @@ while (cc < ccend) length += 2; capture_last_found = TRUE; } - length += 3; + + offset = GET2(cc, 1 + LINK_SIZE); + if (!is_cbracket_processed(common, offset)) + length += 3; cc += 1 + LINK_SIZE + IMM2_SIZE; break; @@ -2135,7 +2275,7 @@ while (cc < ccend) default: stack_restore = TRUE; - /* Fall through. */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_NOT_WORD_BOUNDARY: case OP_WORD_BOUNDARY: @@ -2200,6 +2340,7 @@ while (cc < ccend) case OP_CLASS: case OP_NCLASS: case OP_XCLASS: + case OP_ECLASS: case OP_CALLOUT: case OP_CALLOUT_STR: @@ -2234,6 +2375,8 @@ int offset; SLJIT_UNUSED_ARG(stacktop); SLJIT_ASSERT(stackpos >= stacktop + 2); +memset(common->cbracket_bitset, 0, common->cbracket_bitset_length); + stackpos = STACK(stackpos); if (ccend == NULL) { @@ -2242,6 +2385,7 @@ if (ccend == NULL) cc = next_opcode(common, cc); } +/* The data is restored by do_revertframes(). */ SLJIT_ASSERT(cc != NULL); while (cc < ccend) switch(*cc) @@ -2306,6 +2450,23 @@ while (cc < ccend) capture_last_found = TRUE; } cc += 1 + LINK_SIZE; + while (*cc == OP_CREF) + { + offset = GET2(cc, 1); + if (!is_cbracket_processed(common, offset)) + { + offset <<= 1; + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, OVECTOR(offset)); + stackpos -= SSIZE_OF(sw); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset)); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1)); + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP1, 0); + stackpos -= SSIZE_OF(sw); + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP2, 0); + stackpos -= SSIZE_OF(sw); + } + cc += 1 + IMM2_SIZE; + } break; case OP_CBRA: @@ -2321,15 +2482,20 @@ while (cc < ccend) stackpos -= SSIZE_OF(sw); capture_last_found = TRUE; } - offset = (GET2(cc, 1 + LINK_SIZE)) << 1; - OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, OVECTOR(offset)); - stackpos -= SSIZE_OF(sw); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset)); - OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1)); - OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP1, 0); - stackpos -= SSIZE_OF(sw); - OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP2, 0); - stackpos -= SSIZE_OF(sw); + + offset = GET2(cc, 1 + LINK_SIZE); + if (!is_cbracket_processed(common, offset)) + { + offset <<= 1; + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, OVECTOR(offset)); + stackpos -= SSIZE_OF(sw); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset)); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1)); + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP1, 0); + stackpos -= SSIZE_OF(sw); + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, TMP2, 0); + stackpos -= SSIZE_OF(sw); + } cc += 1 + LINK_SIZE + IMM2_SIZE; break; @@ -2349,7 +2515,7 @@ SLJIT_ASSERT(stackpos == STACK(stacktop)); typedef struct delayed_mem_copy_status { struct sljit_compiler *compiler; int store_bases[RECURSE_TMP_REG_COUNT]; - int store_offsets[RECURSE_TMP_REG_COUNT]; + sljit_s32 store_offsets[RECURSE_TMP_REG_COUNT]; int tmp_regs[RECURSE_TMP_REG_COUNT]; int saved_tmp_regs[RECURSE_TMP_REG_COUNT]; int next_tmp_reg; @@ -2371,7 +2537,7 @@ status->compiler = common->compiler; } static void delayed_mem_copy_move(delayed_mem_copy_status *status, int load_base, sljit_sw load_offset, - int store_base, sljit_sw store_offset) + int store_base, sljit_s32 store_offset) { struct sljit_compiler *compiler = status->compiler; int next_tmp_reg = status->next_tmp_reg; @@ -2448,17 +2614,31 @@ enum get_recurse_flags { recurse_flag_setsom_found = (1 << 2), recurse_flag_setmark_found = (1 << 3), recurse_flag_control_head_found = (1 << 4), + recurse_flag_recurse_arg = (1 << 5), }; static int get_recurse_data_length(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, uint32_t *result_flags) { int length = 1; int size, offset; -PCRE2_SPTR alternative; +PCRE2_SPTR alternative, cref; uint32_t recurse_flags = 0; memset(common->recurse_bitset, 0, common->recurse_bitset_size); +if (common->currententry->arg_size > 0) + { + cref = common->currententry->arg_start; + + do + { + offset = GET2(cref, 1); + recurse_check_bit(common, OVECTOR(offset << 1)); + cref += 1 + IMM2_SIZE; + } + while (*cref == OP_CREF); + } + #if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD SLJIT_ASSERT(common->control_head_ptr != 0); recurse_flags |= recurse_flag_control_head_found; @@ -2484,6 +2664,8 @@ while (cc < ccend) if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) length++; cc += 1 + LINK_SIZE; + if (*cc == OP_CREF) + recurse_flags |= recurse_flag_recurse_arg; break; case OP_KET: @@ -2516,6 +2698,29 @@ while (cc < ccend) cc += 1 + LINK_SIZE; break; + case OP_CREF: + if ((recurse_flags & recurse_flag_recurse_arg) != 0) + { + offset = GET2(cc, 1); + if (recurse_check_bit(common, OVECTOR(offset << 1))) + { + SLJIT_ASSERT(recurse_check_bit(common, OVECTOR((offset << 1) + 1))); + length += 2; + } + + if (cc[1 + IMM2_SIZE] != OP_CREF) + recurse_flags &= ~(uint32_t)recurse_flag_recurse_arg; + } + cc += 1 + IMM2_SIZE; + break; + + case OP_ASSERT_SCS: + SLJIT_ASSERT(PRIVATE_DATA(cc) != 0); + if (recurse_check_bit(common, PRIVATE_DATA(cc))) + length += 2; + cc += 1 + LINK_SIZE; + break; + case OP_CBRA: case OP_SCBRA: offset = GET2(cc, 1 + LINK_SIZE); @@ -2524,7 +2729,7 @@ while (cc < ccend) 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))) + if (!is_optimized_cbracket(common, offset) && recurse_check_bit(common, OVECTOR_PRIV(offset))) length++; if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) length++; @@ -2623,7 +2828,8 @@ while (cc < ccend) case OP_NCLASS: #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8 case OP_XCLASS: - size = (*cc == OP_XCLASS) ? GET(cc, 1) : 1 + 32 / (int)sizeof(PCRE2_UCHAR); + case OP_ECLASS: + size = (*cc >= OP_XCLASS) ? GET(cc, 1) : 1 + 32 / (int)sizeof(PCRE2_UCHAR); #else size = 1 + 32 / (int)sizeof(PCRE2_UCHAR); #endif @@ -2706,7 +2912,7 @@ static void copy_recurse_data(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR int type, int stackptr, int stacktop, uint32_t recurse_flags) { delayed_mem_copy_status status; -PCRE2_SPTR alternative; +PCRE2_SPTR alternative, cref; sljit_sw private_srcw[2]; sljit_sw shared_srcw[3]; sljit_sw kept_shared_srcw[2]; @@ -2715,6 +2921,19 @@ int from_sp, base_reg, offset, i; memset(common->recurse_bitset, 0, common->recurse_bitset_size); +if (common->currententry->arg_size > 0) + { + cref = common->currententry->arg_start; + + do + { + offset = GET2(cref, 1); + recurse_check_bit(common, OVECTOR(offset << 1)); + cref += 1 + IMM2_SIZE; + } + while (*cref == OP_CREF); + } + #if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD SLJIT_ASSERT(common->control_head_ptr != 0); recurse_check_bit(common, common->control_head_ptr); @@ -2827,12 +3046,16 @@ while (cc < ccend) kept_shared_count++; } } + if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) { shared_srcw[0] = common->capture_last_ptr; shared_count = 1; } + cc += 1 + LINK_SIZE; + if (*cc == OP_CREF) + recurse_flags |= recurse_flag_recurse_arg; break; case OP_KET: @@ -2865,6 +3088,32 @@ while (cc < ccend) cc += 1 + LINK_SIZE; break; + case OP_CREF: + if ((recurse_flags & recurse_flag_recurse_arg) != 0) + { + offset = GET2(cc, 1); + 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 (cc[1 + IMM2_SIZE] != OP_CREF) + recurse_flags &= ~(uint32_t)recurse_flag_recurse_arg; + } + cc += 1 + IMM2_SIZE; + break; + + case OP_ASSERT_SCS: + 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; + cc += 1 + LINK_SIZE; + break; + case OP_CBRA: case OP_SCBRA: offset = GET2(cc, 1 + LINK_SIZE); @@ -2882,7 +3131,7 @@ while (cc < ccend) shared_count++; } - if (common->optimized_cbracket[offset] == 0) + if (!is_optimized_cbracket(common, offset)) { private_srcw[0] = OVECTOR_PRIV(offset); if (recurse_check_bit(common, private_srcw[0])) @@ -3005,7 +3254,8 @@ while (cc < ccend) case OP_NCLASS: #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8 case OP_XCLASS: - i = (*cc == OP_XCLASS) ? GET(cc, 1) : 1 + 32 / (int)sizeof(PCRE2_UCHAR); + case OP_ECLASS: + i = (*cc >= OP_XCLASS) ? GET(cc, 1) : 1 + 32 / (int)sizeof(PCRE2_UCHAR); #else i = 1 + 32 / (int)sizeof(PCRE2_UCHAR); #endif @@ -3078,7 +3328,7 @@ while (cc < ccend) SLJIT_ASSERT(private_srcw[i] != 0); if (!from_sp) - delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, private_srcw[i]); + delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, (sljit_s32)private_srcw[i]); if (from_sp || type == recurse_swap_global) delayed_mem_copy_move(&status, SLJIT_SP, private_srcw[i], base_reg, stackptr); @@ -3098,7 +3348,7 @@ while (cc < ccend) SLJIT_ASSERT(shared_srcw[i] != 0); if (!from_sp) - delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, shared_srcw[i]); + delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, (sljit_s32)shared_srcw[i]); if (from_sp || type == recurse_swap_global) delayed_mem_copy_move(&status, SLJIT_SP, shared_srcw[i], base_reg, stackptr); @@ -3118,7 +3368,7 @@ while (cc < ccend) SLJIT_ASSERT(kept_shared_srcw[i] != 0); if (!from_sp) - delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, kept_shared_srcw[i]); + delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, (sljit_s32)kept_shared_srcw[i]); if (from_sp || type == recurse_swap_global) delayed_mem_copy_move(&status, SLJIT_SP, kept_shared_srcw[i], base_reg, stackptr); @@ -3140,50 +3390,66 @@ static SLJIT_INLINE PCRE2_SPTR set_then_offsets(compiler_common *common, PCRE2_S PCRE2_SPTR end = bracketend(cc); BOOL has_alternatives = cc[GET(cc, 1)] == OP_ALT; -/* Assert captures then. */ -if (*cc >= OP_ASSERT && *cc <= OP_ASSERTBACK_NA) +/* Assert captures *THEN verb even if it has no alternatives. */ +if (*cc >= OP_ASSERT && *cc <= OP_ASSERTBACK_NOT) current_offset = NULL; -/* Conditional block does not. */ -if (*cc == OP_COND || *cc == OP_SCOND) +else if (*cc >= OP_ASSERT_NA && *cc <= OP_ASSERT_SCS) + has_alternatives = TRUE; +/* Conditional block does never capture. */ +else if (*cc == OP_COND || *cc == OP_SCOND) has_alternatives = FALSE; cc = next_opcode(common, cc); if (has_alternatives) { - if (*cc == OP_REVERSE) - cc += 1 + IMM2_SIZE; - else if (*cc == OP_VREVERSE) - cc += 1 + 2 * IMM2_SIZE; + switch (*cc) + { + case OP_REVERSE: + case OP_CREF: + cc += 1 + IMM2_SIZE; + break; + case OP_VREVERSE: + case OP_DNCREF: + cc += 1 + 2 * IMM2_SIZE; + break; + } current_offset = common->then_offsets + (cc - common->start); } while (cc < end) { - if ((*cc >= OP_ASSERT && *cc <= OP_ASSERTBACK_NA) || (*cc >= OP_ONCE && *cc <= OP_SCOND)) - cc = set_then_offsets(common, cc, current_offset); - else + if (*cc >= OP_ASSERT && *cc <= OP_SCOND) { - if (*cc == OP_ALT && has_alternatives) - { - cc += 1 + LINK_SIZE; + cc = set_then_offsets(common, cc, current_offset); + continue; + } - if (*cc == OP_REVERSE) - cc += 1 + IMM2_SIZE; - else if (*cc == OP_VREVERSE) - cc += 1 + 2 * IMM2_SIZE; + if (*cc == OP_ALT && has_alternatives) + { + cc += 1 + LINK_SIZE; - current_offset = common->then_offsets + (cc - common->start); - continue; - } + if (*cc == OP_REVERSE) + cc += 1 + IMM2_SIZE; + else if (*cc == OP_VREVERSE) + cc += 1 + 2 * IMM2_SIZE; - if (*cc >= OP_THEN && *cc <= OP_THEN_ARG && current_offset != NULL) - *current_offset = 1; - cc = next_opcode(common, cc); + current_offset = common->then_offsets + (cc - common->start); + continue; } + + if (*cc >= OP_THEN && *cc <= OP_THEN_ARG && current_offset != NULL) + *current_offset = 1; + cc = next_opcode(common, cc); } +cc = end - 1 - LINK_SIZE; + +/* Ignore repeats. */ +if (*cc == OP_KET && PRIVATE_DATA(cc) != 0) + end += PRIVATE_DATA(cc + 1); + return end; } @@ -3258,24 +3524,30 @@ OP2(SLJIT_SUB | SLJIT_SET_Z, COUNT_MATCH, 0, COUNT_MATCH, 0, SLJIT_IMM, 1); add_jump(compiler, &common->calllimit, JUMP(SLJIT_ZERO)); } -static SLJIT_INLINE void allocate_stack(compiler_common *common, int size) +static SLJIT_INLINE void allocate_stack(compiler_common *common, sljit_s32 size) { /* May destroy all locals and registers except TMP2. */ DEFINE_COMPILER; SLJIT_ASSERT(size > 0); +if (size > (STACK_GROWTH_RATE / (SSIZE_OF(sw) * 2))) + common->large_stack_allocation = TRUE; OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, size * SSIZE_OF(sw)); #ifdef DESTROY_REGISTERS OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 12345); OP1(SLJIT_MOV, TMP3, 0, TMP1, 0); OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0); -OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, TMP1, 0); -OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, TMP1, 0); +#if defined SLJIT_DEBUG && SLJIT_DEBUG +SLJIT_ASSERT(common->locals_size >= 2 * SSIZE_OF(sw)); +/* These two are also used by the stackalloc calls. */ +OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCAL0, TMP1, 0); +OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCAL1, TMP1, 0); +#endif #endif add_stub(common, CMP(SLJIT_LESS, STACK_TOP, 0, STACK_LIMIT, 0)); } -static SLJIT_INLINE void free_stack(compiler_common *common, int size) +static SLJIT_INLINE void free_stack(compiler_common *common, sljit_s32 size) { DEFINE_COMPILER; @@ -3701,9 +3973,12 @@ oc = TABLE_GET(c, common->fcc, c); SLJIT_ASSERT(c != oc); bit = c ^ oc; + +#ifndef EBCDIC /* Optimized for English alphabet. */ if (c <= 127 && bit == 0x20) return (0 << 8) | 0x20; +#endif /* Since c != oc, they must have at least 1 bit difference. */ if (!is_powerof2(bit)) @@ -5147,15 +5422,15 @@ OP_SRC(SLJIT_FAST_RETURN, RETURN_ADDR, 0); static void do_utfreadchar_invalid(compiler_common *common) { /* Slow decoding a UTF-16 character. TMP1 contains the first half -of the character (>= 0xd800). Return char value in TMP1. STR_PTR is -undefined for invalid characters. */ +of the character (>= 0xd800). TMP2 contains TMP1 - 0xd800. Return +char value in TMP1. STR_PTR is unchanged for invalid characters. */ DEFINE_COMPILER; struct sljit_jump *exit_invalid[3]; sljit_emit_op_dst(compiler, SLJIT_FAST_ENTER, RETURN_ADDR, 0); /* TMP2 contains the high surrogate. */ -exit_invalid[0] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00); +exit_invalid[0] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x400); exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); @@ -5169,9 +5444,10 @@ exit_invalid[2] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x400); OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); OP_SRC(SLJIT_FAST_RETURN, RETURN_ADDR, 0); +JUMPHERE(exit_invalid[2]); +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); JUMPHERE(exit_invalid[0]); JUMPHERE(exit_invalid[1]); -JUMPHERE(exit_invalid[2]); OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR); OP_SRC(SLJIT_FAST_RETURN, RETURN_ADDR, 0); } @@ -5307,8 +5583,7 @@ OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK); -OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); -OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); +sljit_emit_op2_shift(compiler, SLJIT_ADD | SLJIT_SHL_IMM | SLJIT_SRC2_UNDEFINED, TMP1, 0, TMP1, 0, TMP2, 0, UCD_BLOCK_SHIFT); OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_stage2)); OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1); OP_SRC(SLJIT_FAST_RETURN, RETURN_ADDR, 0); @@ -5347,16 +5622,14 @@ OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK); -OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); -OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); +sljit_emit_op2_shift(compiler, SLJIT_ADD | SLJIT_SHL_IMM | SLJIT_SRC2_UNDEFINED, TMP1, 0, TMP1, 0, TMP2, 0, UCD_BLOCK_SHIFT); OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_stage2)); OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1); -/* TMP2 is multiplied by 12. Same as (TMP2 << 2) + ((TMP2 << 2) << 1). */ +/* TMP2 is multiplied by 12. Same as (TMP2 + (TMP2 << 1)) << 2. */ OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype)); -OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 2); -OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); -OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 1); +sljit_emit_op2_shift(compiler, SLJIT_ADD | SLJIT_SHL_IMM | SLJIT_SRC2_UNDEFINED, TMP2, 0, TMP2, 0, TMP2, 0, 1); +OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 2); OP_SRC(SLJIT_FAST_RETURN, RETURN_ADDR, 0); } @@ -5372,7 +5645,6 @@ struct sljit_jump *start; struct sljit_jump *end = NULL; struct sljit_jump *end2 = NULL; #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 -struct sljit_label *loop; struct sljit_jump *jump; #endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */ jump_list *newline = NULL; @@ -5478,7 +5750,7 @@ mainloop = LABEL(); /* Increasing the STR_PTR here requires one less jump in the most common case. */ #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 -if (common->utf && !common->invalid_utf) readuchar = TRUE; +if (common->utf) readuchar = TRUE; #endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */ if (newlinecheck) readuchar = TRUE; @@ -5494,13 +5766,11 @@ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); if (common->invalid_utf) { /* Skip continuation code units. */ - loop = LABEL(); - jump = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x80); - CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x40, loop); - OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0); + OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0); + add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); + OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR); + SELECT(SLJIT_EQUAL, STR_PTR, TMP3, 0, STR_PTR); JUMPHERE(jump); } else if (common->utf) @@ -5514,13 +5784,9 @@ else if (common->utf) if (common->invalid_utf) { /* Skip continuation code units. */ - loop = LABEL(); - jump = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xdc00); - CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x400, loop); - OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800); + jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xe000 - 0xd800); + add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); JUMPHERE(jump); } else if (common->utf) @@ -5589,11 +5855,38 @@ if (last) chars->last_count++; } -static int scan_prefix(compiler_common *common, PCRE2_SPTR cc, fast_forward_char_data *chars, int max_chars, sljit_u32 *rec_count) +/* Value can be increased if needed. Patterns +such as /(a|){33}b/ can exhaust the stack. + +Note: /(a|){29}b/ already stops scan_prefix() +because it reaches the maximum step_count. */ +#define SCAN_PREFIX_STACK_END 32 + +/* +Scan prefix stores the prefix string in the chars array. +The elements of the chars array is either small character +sets or "any" (count is set to 255). + +Examples (the chars array is represented by a simple regex): + +/(abc|xbyd)/ prefix: /[ax]b[cy]/ (length: 3) +/a[a-z]b+c/ prefix: a.b (length: 3) +/ab?cd/ prefix: a[bc][cd] (length: 3) +/(ab|cd)|(ef|gh)/ prefix: [aceg][bdfh] (length: 2) + +The length is returned by scan_prefix(). The length is +less than or equal than the minimum length of the pattern. +*/ + +static int scan_prefix(compiler_common *common, PCRE2_SPTR cc, fast_forward_char_data *chars) { -/* Recursive function, which scans prefix literals. */ +fast_forward_char_data *chars_start = chars; +fast_forward_char_data *chars_end = chars + MAX_N_CHARS; +PCRE2_SPTR cc_stack[SCAN_PREFIX_STACK_END]; +fast_forward_char_data *chars_stack[SCAN_PREFIX_STACK_END]; +sljit_u8 next_alternative_stack[SCAN_PREFIX_STACK_END]; BOOL last, any, class, caseless; -int len, repeat, len_save, consumed = 0; +int stack_ptr, step_count, repeat, len, len_save; sljit_u32 chr; /* Any unicode character. */ sljit_u8 *bytes, *bytes_end, byte; PCRE2_SPTR alternative, cc_save, oc; @@ -5606,11 +5899,44 @@ PCRE2_UCHAR othercase[1]; #endif repeat = 1; +stack_ptr = 0; +step_count = 10000; while (TRUE) { - if (*rec_count == 0) + if (--step_count == 0) return 0; - (*rec_count)--; + + SLJIT_ASSERT(chars <= chars_start + MAX_N_CHARS); + + if (chars >= chars_end) + { + if (stack_ptr == 0) + return (int)(chars_end - chars_start); + + --stack_ptr; + cc = cc_stack[stack_ptr]; + chars = chars_stack[stack_ptr]; + + if (chars >= chars_end) + continue; + + if (next_alternative_stack[stack_ptr] != 0) + { + /* When an alternative is processed, the + next alternative is pushed onto the stack. */ + SLJIT_ASSERT(*cc == OP_ALT); + alternative = cc + GET(cc, 1); + if (*alternative == OP_ALT) + { + SLJIT_ASSERT(stack_ptr < SCAN_PREFIX_STACK_END); + SLJIT_ASSERT(chars_stack[stack_ptr] == chars); + SLJIT_ASSERT(next_alternative_stack[stack_ptr] == 1); + cc_stack[stack_ptr] = alternative; + stack_ptr++; + } + cc += 1 + LINK_SIZE; + } + } last = TRUE; any = FALSE; @@ -5621,7 +5947,7 @@ while (TRUE) { case OP_CHARI: caseless = TRUE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_CHAR: last = FALSE; cc++; @@ -5650,6 +5976,7 @@ while (TRUE) case OP_ASSERTBACK_NOT: case OP_ASSERT_NA: case OP_ASSERTBACK_NA: + case OP_ASSERT_SCS: cc = bracketend(cc); continue; @@ -5657,7 +5984,7 @@ while (TRUE) case OP_MINPLUSI: case OP_POSPLUSI: caseless = TRUE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_PLUS: case OP_MINPLUS: case OP_POSPLUS: @@ -5666,7 +5993,7 @@ while (TRUE) case OP_EXACTI: caseless = TRUE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_EXACT: repeat = GET2(cc, 1); last = FALSE; @@ -5677,7 +6004,7 @@ while (TRUE) case OP_MINQUERYI: case OP_POSQUERYI: caseless = TRUE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_QUERY: case OP_MINQUERY: case OP_POSQUERY: @@ -5686,9 +6013,17 @@ while (TRUE) #ifdef SUPPORT_UNICODE if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); #endif - max_chars = scan_prefix(common, cc + len, chars, max_chars, rec_count); - if (max_chars == 0) - return consumed; + if (stack_ptr >= SCAN_PREFIX_STACK_END) + { + chars_end = chars; + continue; + } + + cc_stack[stack_ptr] = cc + len; + chars_stack[stack_ptr] = chars; + next_alternative_stack[stack_ptr] = 0; + stack_ptr++; + last = FALSE; break; @@ -5706,12 +6041,18 @@ while (TRUE) case OP_CBRA: case OP_CBRAPOS: alternative = cc + GET(cc, 1); - while (*alternative == OP_ALT) + if (*alternative == OP_ALT) { - max_chars = scan_prefix(common, alternative + 1 + LINK_SIZE, chars, max_chars, rec_count); - if (max_chars == 0) - return consumed; - alternative += GET(alternative, 1); + if (stack_ptr >= SCAN_PREFIX_STACK_END) + { + chars_end = chars; + continue; + } + + cc_stack[stack_ptr] = alternative; + chars_stack[stack_ptr] = chars; + next_alternative_stack[stack_ptr] = 1; + stack_ptr++; } if (*cc == OP_CBRA || *cc == OP_CBRAPOS) @@ -5722,22 +6063,34 @@ while (TRUE) case OP_CLASS: #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf && !is_char7_bitset((const sljit_u8 *)(cc + 1), FALSE)) - return consumed; + { + chars_end = chars; + continue; + } #endif class = TRUE; break; case OP_NCLASS: #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 - if (common->utf) return consumed; + if (common->utf) + { + chars_end = chars; + continue; + } #endif class = TRUE; break; #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8 case OP_XCLASS: + case OP_ECLASS: #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 - if (common->utf) return consumed; + if (common->utf) + { + chars_end = chars; + continue; + } #endif any = TRUE; cc += GET(cc, 1); @@ -5747,7 +6100,10 @@ while (TRUE) case OP_DIGIT: #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_digit, FALSE)) - return consumed; + { + chars_end = chars; + continue; + } #endif any = TRUE; cc++; @@ -5756,7 +6112,10 @@ while (TRUE) case OP_WHITESPACE: #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_space, FALSE)) - return consumed; + { + chars_end = chars; + continue; + } #endif any = TRUE; cc++; @@ -5765,7 +6124,10 @@ while (TRUE) case OP_WORDCHAR: #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_word, FALSE)) - return consumed; + { + chars_end = chars; + continue; + } #endif any = TRUE; cc++; @@ -5774,14 +6136,18 @@ while (TRUE) case OP_NOT: case OP_NOTI: cc++; - /* Fall through. */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_NOT_DIGIT: case OP_NOT_WHITESPACE: case OP_NOT_WORDCHAR: case OP_ANY: case OP_ALLANY: #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 - if (common->utf) return consumed; + if (common->utf) + { + chars_end = chars; + continue; + } #endif any = TRUE; cc++; @@ -5791,7 +6157,11 @@ while (TRUE) case OP_NOTPROP: case OP_PROP: #if PCRE2_CODE_UNIT_WIDTH != 32 - if (common->utf) return consumed; + if (common->utf) + { + chars_end = chars; + continue; + } #endif any = TRUE; cc += 1 + 2; @@ -5806,7 +6176,11 @@ while (TRUE) case OP_NOTEXACT: case OP_NOTEXACTI: #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 - if (common->utf) return consumed; + if (common->utf) + { + chars_end = chars; + continue; + } #endif any = TRUE; repeat = GET2(cc, 1); @@ -5814,21 +6188,20 @@ while (TRUE) break; default: - return consumed; + chars_end = chars; + continue; } + SLJIT_ASSERT(chars < chars_end); + if (any) { do { chars->count = 255; - - consumed++; - if (--max_chars == 0) - return consumed; chars++; } - while (--repeat > 0); + while (--repeat > 0 && chars < chars_end); repeat = 1; continue; @@ -5839,17 +6212,27 @@ while (TRUE) bytes = (sljit_u8*) (cc + 1); cc += 1 + 32 / sizeof(PCRE2_UCHAR); + SLJIT_ASSERT(last == TRUE && repeat == 1); switch (*cc) { - case OP_CRSTAR: - case OP_CRMINSTAR: - case OP_CRPOSSTAR: case OP_CRQUERY: case OP_CRMINQUERY: case OP_CRPOSQUERY: - max_chars = scan_prefix(common, cc + 1, chars, max_chars, rec_count); - if (max_chars == 0) - return consumed; + last = FALSE; + PCRE2_FALLTHROUGH /* Fall through */ + case OP_CRSTAR: + case OP_CRMINSTAR: + case OP_CRPOSSTAR: + if (stack_ptr >= SCAN_PREFIX_STACK_END) + { + chars_end = chars; + continue; + } + + cc_stack[stack_ptr] = ++cc; + chars_stack[stack_ptr] = chars; + next_alternative_stack[stack_ptr] = 0; + stack_ptr++; break; default: @@ -5863,7 +6246,14 @@ while (TRUE) case OP_CRPOSRANGE: repeat = GET2(cc, 1); if (repeat <= 0) - return consumed; + { + repeat = 1; + chars_end = chars; + continue; + } + + last = (repeat != (int)GET2(cc, 1 + IMM2_SIZE)); + cc += 1 + 2 * IMM2_SIZE; break; } @@ -5898,36 +6288,13 @@ while (TRUE) bytes = bytes_end - 32; } - consumed++; - if (--max_chars == 0) - return consumed; chars++; } - while (--repeat > 0); - - switch (*cc) - { - case OP_CRSTAR: - case OP_CRMINSTAR: - case OP_CRPOSSTAR: - return consumed; - - case OP_CRQUERY: - case OP_CRMINQUERY: - case OP_CRPOSQUERY: - cc++; - break; - - case OP_CRRANGE: - case OP_CRMINRANGE: - case OP_CRPOSRANGE: - if (GET2(cc, 1) != GET2(cc, 1 + IMM2_SIZE)) - return consumed; - cc += 1 + 2 * IMM2_SIZE; - break; - } + while (--repeat > 0 && chars < chars_end); repeat = 1; + if (last) + chars_end = chars; continue; } @@ -5943,7 +6310,10 @@ while (TRUE) { GETCHAR(chr, cc); if ((int)PRIV(ord2utf)(char_othercase(common, chr), othercase) != len) - return consumed; + { + chars_end = chars; + continue; + } } else #endif @@ -5974,7 +6344,6 @@ while (TRUE) do { len--; - consumed++; chr = *cc; add_prefix_char(*cc, chars, len == 0); @@ -5982,15 +6351,13 @@ while (TRUE) if (caseless) add_prefix_char(*oc, chars, len == 0); - if (--max_chars == 0) - return consumed; chars++; cc++; oc++; } - while (len > 0); + while (len > 0 && chars < chars_end); - if (--repeat == 0) + if (--repeat == 0 || chars >= chars_end) break; len = len_save; @@ -5999,7 +6366,7 @@ while (TRUE) repeat = 1; if (last) - return consumed; + chars_end = chars; } } @@ -6169,7 +6536,6 @@ int i, max, from; int range_right = -1, range_len; sljit_u8 *update_table = NULL; BOOL in_range; -sljit_u32 rec_count; for (i = 0; i < MAX_N_CHARS; i++) { @@ -6177,8 +6543,7 @@ for (i = 0; i < MAX_N_CHARS; i++) chars[i].last_count = 0; } -rec_count = 10000; -max = scan_prefix(common, common->start, chars, MAX_N_CHARS, &rec_count); +max = scan_prefix(common, common->start, chars); if (max < 1) return FALSE; @@ -6527,7 +6892,7 @@ if (JIT_HAS_FAST_FORWARD_CHAR_SIMD && (common->nltype == NLTYPE_FIXED || common- OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); quit = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR); } - else + else { fast_forward_char_simd(common, common->newline, common->newline, 0); @@ -6768,8 +7133,7 @@ jump = JUMP(SLJIT_NOT_ZERO /* SIG_LESS */); OP_SRC(SLJIT_FAST_RETURN, RETURN_ADDR, 0); JUMPHERE(jump); -OP2(SLJIT_SUB, TMP2, 0, SLJIT_IMM, 0, TMP2, 0); -OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); +OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, TMP2, 0); if (HAS_VIRTUAL_REGISTERS) { OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(STACK_TOP), -(2 * SSIZE_OF(sw))); @@ -6811,7 +7175,8 @@ struct sljit_jump *jump; SLJIT_UNUSED_ARG(ucp); SLJIT_COMPILE_ASSERT(ctype_word == 0x10, ctype_word_must_be_16); -sljit_emit_op_dst(compiler, SLJIT_FAST_ENTER, SLJIT_MEM1(SLJIT_SP), LOCALS0); +SLJIT_ASSERT(common->locals_size >= 2 * SSIZE_OF(sw)); +sljit_emit_op_dst(compiler, SLJIT_FAST_ENTER, SLJIT_MEM1(SLJIT_SP), LOCAL0); /* Get type of the previous char, and put it to TMP3. */ OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); @@ -6880,7 +7245,7 @@ JUMPHERE(skipread); OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, 0); check_str_end(common, &skipread_list); -peek_char(common, READ_CHAR_MAX, SLJIT_MEM1(SLJIT_SP), LOCALS1, &invalid_utf2); +peek_char(common, READ_CHAR_MAX, SLJIT_MEM1(SLJIT_SP), LOCAL1, &invalid_utf2); /* Testing char type. This is a code duplication. */ #ifdef SUPPORT_UNICODE @@ -6919,7 +7284,7 @@ else } set_jumps(skipread_list, LABEL()); -OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCAL0); OP2(SLJIT_XOR | SLJIT_SET_Z, TMP2, 0, TMP2, 0, TMP3, 0); OP_SRC(SLJIT_FAST_RETURN, TMP1, 0); @@ -6928,15 +7293,15 @@ if (common->invalid_utf) { set_jumps(invalid_utf1, LABEL()); - peek_char(common, READ_CHAR_MAX, SLJIT_MEM1(SLJIT_SP), LOCALS1, NULL); + peek_char(common, READ_CHAR_MAX, SLJIT_MEM1(SLJIT_SP), LOCAL1, NULL); CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR, valid_utf); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCAL0); OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, -1); OP_SRC(SLJIT_FAST_RETURN, TMP1, 0); set_jumps(invalid_utf2, LABEL()); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCAL0); OP1(SLJIT_MOV, TMP2, 0, TMP3, 0); OP_SRC(SLJIT_FAST_RETURN, TMP1, 0); } @@ -7211,10 +7576,22 @@ DEFINE_COMPILER; sljit_emit_op_dst(compiler, SLJIT_FAST_ENTER, RETURN_ADDR, 0); -OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x0a); -OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x0d - 0x0a); +#ifdef EBCDIC +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_LF); +OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_VT); +OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_FF); +OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_CR); +OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_NEL); +#else +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, CHAR_LF); +OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR - CHAR_LF); OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL); -OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x85 - 0x0a); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_NEL - CHAR_LF); +#endif #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 #if PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf) @@ -7222,7 +7599,7 @@ if (common->utf) #endif OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x1); - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x2029 - 0x0a); + OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x2029 - CHAR_LF); #if PCRE2_CODE_UNIT_WIDTH == 8 } #endif @@ -7238,11 +7615,11 @@ DEFINE_COMPILER; sljit_emit_op_dst(compiler, SLJIT_FAST_ENTER, RETURN_ADDR, 0); -OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x09); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_HT); OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL); -OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x20); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_SPACE); OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); -OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0xa0); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_NBSP); #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 #if PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf) @@ -7254,7 +7631,7 @@ if (common->utf) OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x180e); OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x2000); - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x200A - 0x2000); + OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x200a - 0x2000); OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL); OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x202f - 0x2000); OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); @@ -7277,10 +7654,22 @@ DEFINE_COMPILER; sljit_emit_op_dst(compiler, SLJIT_FAST_ENTER, RETURN_ADDR, 0); -OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x0a); -OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x0d - 0x0a); +#ifdef EBCDIC +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_LF); +OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_VT); +OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_FF); +OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_CR); +OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_NEL); +#else +OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, CHAR_LF); +OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR - CHAR_LF); OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL); -OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x85 - 0x0a); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_NEL - CHAR_LF); +#endif #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 #if PCRE2_CODE_UNIT_WIDTH == 8 if (common->utf) @@ -7288,7 +7677,7 @@ if (common->utf) #endif OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x1); - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x2029 - 0x0a); + OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x2029 - CHAR_LF); #if PCRE2_CODE_UNIT_WIDTH == 8 } #endif @@ -7317,7 +7706,9 @@ else char2_reg = RETURN_ADDR; } -sljit_emit_op_dst(compiler, SLJIT_FAST_ENTER, SLJIT_MEM1(SLJIT_SP), LOCALS0); +/* Update ref_update_local_size() when this changes. */ +SLJIT_ASSERT(common->locals_size >= SSIZE_OF(sw)); +sljit_emit_op_dst(compiler, SLJIT_FAST_ENTER, SLJIT_MEM1(SLJIT_SP), LOCAL0); OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0); if (char1_reg == STR_END) @@ -7336,7 +7727,7 @@ if (sljit_emit_mem_update(compiler, MOV_UCHAR | SLJIT_MEM_SUPP | SLJIT_MEM_POST, JUMPTO(SLJIT_NOT_ZERO, label); JUMPHERE(jump); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCAL0); } else if (sljit_emit_mem_update(compiler, MOV_UCHAR | SLJIT_MEM_SUPP | SLJIT_MEM_PRE, char1_reg, SLJIT_MEM1(TMP1), IN_UCHARS(1)) == SLJIT_SUCCESS) { @@ -7351,7 +7742,7 @@ else if (sljit_emit_mem_update(compiler, MOV_UCHAR | SLJIT_MEM_SUPP | SLJIT_MEM_ JUMPTO(SLJIT_NOT_ZERO, label); JUMPHERE(jump); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCAL0); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); } else @@ -7366,7 +7757,7 @@ else JUMPTO(SLJIT_NOT_ZERO, label); JUMPHERE(jump); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCAL0); } if (char1_reg == STR_END) @@ -7404,10 +7795,12 @@ if (sljit_emit_mem_update(compiler, MOV_UCHAR | SLJIT_MEM_SUPP | SLJIT_MEM_POST, else if (sljit_emit_mem_update(compiler, MOV_UCHAR | SLJIT_MEM_SUPP | SLJIT_MEM_PRE, char1_reg, SLJIT_MEM1(TMP1), IN_UCHARS(1)) == SLJIT_SUCCESS) opt_type = 2; -sljit_emit_op_dst(compiler, SLJIT_FAST_ENTER, SLJIT_MEM1(SLJIT_SP), LOCALS0); +/* Update ref_update_local_size() when this changes. */ +SLJIT_ASSERT(common->locals_size >= 2 * SSIZE_OF(sw)); +sljit_emit_op_dst(compiler, SLJIT_FAST_ENTER, SLJIT_MEM1(SLJIT_SP), LOCAL0); OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0); -OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, char1_reg, 0); +OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCAL1, char1_reg, 0); if (char2_reg == STACK_TOP) { @@ -7461,7 +7854,7 @@ OP2(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, TMP2, 0, SLJIT_IMM, IN_UCHARS(1)); JUMPTO(SLJIT_NOT_ZERO, label); JUMPHERE(jump); -OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCAL0); if (opt_type == 2) OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); @@ -7472,1931 +7865,255 @@ if (char2_reg == STACK_TOP) OP1(SLJIT_MOV, lcc_table, 0, RETURN_ADDR, 0); } -OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1); +OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCAL1); OP_SRC(SLJIT_FAST_RETURN, TMP1, 0); } -static PCRE2_SPTR byte_sequence_compare(compiler_common *common, BOOL caseless, PCRE2_SPTR cc, - compare_context *context, jump_list **backtracks) +#include "pcre2_jit_char_inc.h" + +static PCRE2_SPTR compile_simple_assertion_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR cc, jump_list **backtracks) { DEFINE_COMPILER; -unsigned int othercasebit = 0; -PCRE2_SPTR othercasechar = NULL; -#ifdef SUPPORT_UNICODE -int utflength; -#endif +struct sljit_jump *jump[4]; -if (caseless && char_has_othercase(common, cc)) +switch(type) { - othercasebit = char_get_othercase_bit(common, cc); - SLJIT_ASSERT(othercasebit); - /* Extracting bit difference info. */ -#if PCRE2_CODE_UNIT_WIDTH == 8 - othercasechar = cc + (othercasebit >> 8); - othercasebit &= 0xff; -#elif PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 - /* Note that this code only handles characters in the BMP. If there - ever are characters outside the BMP whose othercase differs in only one - bit from itself (there currently are none), this code will need to be - revised for PCRE2_CODE_UNIT_WIDTH == 32. */ - othercasechar = cc + (othercasebit >> 9); - if ((othercasebit & 0x100) != 0) - othercasebit = (othercasebit & 0xff) << 8; + case OP_SOD: + if (HAS_VIRTUAL_REGISTERS) + { + OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); + } else - othercasebit &= 0xff; -#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */ - } + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, TMP1, 0)); + return cc; -if (context->sourcereg == -1) - { -#if PCRE2_CODE_UNIT_WIDTH == 8 -#if defined SLJIT_UNALIGNED && SLJIT_UNALIGNED - if (context->length >= 4) - OP1(SLJIT_MOV_S32, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); - else if (context->length >= 2) - OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); - else -#endif - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); -#elif PCRE2_CODE_UNIT_WIDTH == 16 -#if defined SLJIT_UNALIGNED && SLJIT_UNALIGNED - if (context->length >= 4) - OP1(SLJIT_MOV_S32, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); + case OP_SOM: + if (HAS_VIRTUAL_REGISTERS) + { + OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str)); + } else -#endif - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); -#elif PCRE2_CODE_UNIT_WIDTH == 32 - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length); -#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */ - context->sourcereg = TMP2; - } + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, str)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, TMP1, 0)); + return cc; + case OP_NOT_WORD_BOUNDARY: + case OP_WORD_BOUNDARY: + case OP_NOT_UCP_WORD_BOUNDARY: + case OP_UCP_WORD_BOUNDARY: + add_jump(compiler, (type == OP_NOT_WORD_BOUNDARY || type == OP_WORD_BOUNDARY) ? &common->wordboundary : &common->ucp_wordboundary, JUMP(SLJIT_FAST_CALL)); #ifdef SUPPORT_UNICODE -utflength = 1; -if (common->utf && HAS_EXTRALEN(*cc)) - utflength += GET_EXTRALEN(*cc); - -do - { -#endif - - context->length -= IN_UCHARS(1); -#if (defined SLJIT_UNALIGNED && SLJIT_UNALIGNED) && (PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16) + if (common->invalid_utf) + { + add_jump(compiler, backtracks, CMP((type == OP_NOT_WORD_BOUNDARY || type == OP_NOT_UCP_WORD_BOUNDARY) ? SLJIT_NOT_EQUAL : SLJIT_SIG_LESS_EQUAL, TMP2, 0, SLJIT_IMM, 0)); + return cc; + } +#endif /* SUPPORT_UNICODE */ + sljit_set_current_flags(compiler, SLJIT_SET_Z); + add_jump(compiler, backtracks, JUMP((type == OP_NOT_WORD_BOUNDARY || type == OP_NOT_UCP_WORD_BOUNDARY) ? SLJIT_NOT_ZERO : SLJIT_ZERO)); + return cc; - /* Unaligned read is supported. */ - if (othercasebit != 0 && othercasechar == cc) + case OP_EODN: + /* Requires rather complex checks. */ + jump[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); + if (common->nltype == NLTYPE_FIXED && common->newline > 255) { - context->c.asuchars[context->ucharptr] = *cc | othercasebit; - context->oc.asuchars[context->ucharptr] = othercasebit; + OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); + if (common->mode == PCRE2_JIT_COMPLETE) + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, STR_END, 0)); + else + { + jump[1] = CMP(SLJIT_EQUAL, TMP2, 0, STR_END, 0); + OP2U(SLJIT_SUB | SLJIT_SET_LESS, TMP2, 0, STR_END, 0); + OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS); + OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); + OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_NOT_EQUAL); + add_jump(compiler, backtracks, JUMP(SLJIT_NOT_EQUAL)); + check_partial(common, TRUE); + add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); + JUMPHERE(jump[1]); + } + OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); } - else + else if (common->nltype == NLTYPE_FIXED) { - context->c.asuchars[context->ucharptr] = *cc; - context->oc.asuchars[context->ucharptr] = 0; + OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, STR_END, 0)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline)); } - context->ucharptr++; - -#if PCRE2_CODE_UNIT_WIDTH == 8 - if (context->ucharptr >= 4 || context->length == 0 || (context->ucharptr == 2 && context->length == 1)) -#else - if (context->ucharptr >= 2 || context->length == 0) -#endif + else { - if (context->length >= 4) - OP1(SLJIT_MOV_S32, context->sourcereg, 0, SLJIT_MEM1(STR_PTR), -context->length); - else if (context->length >= 2) - OP1(SLJIT_MOV_U16, context->sourcereg, 0, SLJIT_MEM1(STR_PTR), -context->length); -#if PCRE2_CODE_UNIT_WIDTH == 8 - else if (context->length >= 1) - OP1(SLJIT_MOV_U8, context->sourcereg, 0, SLJIT_MEM1(STR_PTR), -context->length); -#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ - context->sourcereg = context->sourcereg == TMP1 ? TMP2 : TMP1; + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); + jump[1] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR); + OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); + OP2U(SLJIT_SUB | SLJIT_SET_Z | SLJIT_SET_GREATER, TMP2, 0, STR_END, 0); + jump[2] = JUMP(SLJIT_GREATER); + add_jump(compiler, backtracks, JUMP(SLJIT_NOT_EQUAL) /* LESS */); + /* Equal. */ + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1)); + jump[3] = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_NL); + add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); - switch(context->ucharptr) + JUMPHERE(jump[1]); + if (common->nltype == NLTYPE_ANYCRLF) { - case 4 / sizeof(PCRE2_UCHAR): - if (context->oc.asint != 0) - OP2(SLJIT_OR, context->sourcereg, 0, context->sourcereg, 0, SLJIT_IMM, context->oc.asint); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, context->sourcereg, 0, SLJIT_IMM, context->c.asint | context->oc.asint)); - break; - - case 2 / sizeof(PCRE2_UCHAR): - if (context->oc.asushort != 0) - OP2(SLJIT_OR, context->sourcereg, 0, context->sourcereg, 0, SLJIT_IMM, context->oc.asushort); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, context->sourcereg, 0, SLJIT_IMM, context->c.asushort | context->oc.asushort)); - break; - -#if PCRE2_CODE_UNIT_WIDTH == 8 - case 1: - if (context->oc.asbyte != 0) - OP2(SLJIT_OR, context->sourcereg, 0, context->sourcereg, 0, SLJIT_IMM, context->oc.asbyte); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, context->sourcereg, 0, SLJIT_IMM, context->c.asbyte | context->oc.asbyte)); - break; -#endif - - default: - SLJIT_UNREACHABLE(); - break; + OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP2, 0, STR_END, 0)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_NL)); + } + else + { + OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0); + read_char(common, common->nlmin, common->nlmax, backtracks, READ_CHAR_UPDATE_STR_PTR); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, STR_END, 0)); + add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL)); + sljit_set_current_flags(compiler, SLJIT_SET_Z); + add_jump(compiler, backtracks, JUMP(SLJIT_ZERO)); + OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0); } - context->ucharptr = 0; + JUMPHERE(jump[2]); + JUMPHERE(jump[3]); } + JUMPHERE(jump[0]); + if (common->mode != PCRE2_JIT_COMPLETE) + check_partial(common, TRUE); + return cc; -#else + case OP_EOD: + add_jump(compiler, backtracks, CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0)); + if (common->mode != PCRE2_JIT_COMPLETE) + check_partial(common, TRUE); + return cc; - /* Unaligned read is unsupported or in 32 bit mode. */ - if (context->length >= 1) - OP1(MOV_UCHAR, context->sourcereg, 0, SLJIT_MEM1(STR_PTR), -context->length); + case OP_DOLL: + if (HAS_VIRTUAL_REGISTERS) + { + OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); + OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL); + } + else + OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL); + add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO)); - context->sourcereg = context->sourcereg == TMP1 ? TMP2 : TMP1; + if (!common->endonly) + compile_simple_assertion_matchingpath(common, OP_EODN, cc, backtracks); + else + { + add_jump(compiler, backtracks, CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0)); + check_partial(common, FALSE); + } + return cc; - if (othercasebit != 0 && othercasechar == cc) + case OP_DOLLM: + jump[1] = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0); + if (HAS_VIRTUAL_REGISTERS) { - OP2(SLJIT_OR, context->sourcereg, 0, context->sourcereg, 0, SLJIT_IMM, othercasebit); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, context->sourcereg, 0, SLJIT_IMM, *cc | othercasebit)); + OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); + OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL); } else - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, context->sourcereg, 0, SLJIT_IMM, *cc)); - -#endif + OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL); + add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO)); + check_partial(common, FALSE); + jump[0] = JUMP(SLJIT_JUMP); + JUMPHERE(jump[1]); - cc++; -#ifdef SUPPORT_UNICODE - utflength--; - } -while (utflength > 0); -#endif - -return cc; -} - -#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8 - -#define SET_CHAR_OFFSET(value) \ - if ((value) != charoffset) \ - { \ - if ((value) < charoffset) \ - OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)(charoffset - (value))); \ - else \ - OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)((value) - charoffset)); \ - } \ - charoffset = (value); - -static PCRE2_SPTR compile_char1_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR cc, jump_list **backtracks, BOOL check_str_ptr); - -#ifdef SUPPORT_UNICODE -#define XCLASS_SAVE_CHAR 0x001 -#define XCLASS_CHAR_SAVED 0x002 -#define XCLASS_HAS_TYPE 0x004 -#define XCLASS_HAS_SCRIPT 0x008 -#define XCLASS_HAS_SCRIPT_EXTENSION 0x010 -#define XCLASS_HAS_BOOL 0x020 -#define XCLASS_HAS_BIDICL 0x040 -#define XCLASS_NEEDS_UCD (XCLASS_HAS_TYPE | XCLASS_HAS_SCRIPT | XCLASS_HAS_SCRIPT_EXTENSION | XCLASS_HAS_BOOL | XCLASS_HAS_BIDICL) -#define XCLASS_SCRIPT_EXTENSION_NOTPROP 0x080 -#define XCLASS_SCRIPT_EXTENSION_RESTORE_RETURN_ADDR 0x100 -#define XCLASS_SCRIPT_EXTENSION_RESTORE_LOCALS0 0x200 -#endif /* SUPPORT_UNICODE */ - -static void compile_xclass_matchingpath(compiler_common *common, PCRE2_SPTR cc, jump_list **backtracks) -{ -DEFINE_COMPILER; -jump_list *found = NULL; -jump_list **list = (cc[0] & XCL_NOT) == 0 ? &found : backtracks; -sljit_uw c, charoffset, max = 256, min = READ_CHAR_MAX; -struct sljit_jump *jump = NULL; -PCRE2_SPTR ccbegin; -int compares, invertcmp, numberofcmps; -#if defined SUPPORT_UNICODE && (PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16) -BOOL utf = common->utf; -#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == [8|16] */ - -#ifdef SUPPORT_UNICODE -sljit_u32 unicode_status = 0; -sljit_u32 category_list = 0; -sljit_u32 items; -int typereg = TMP1; -const sljit_u32 *other_cases; -#endif /* SUPPORT_UNICODE */ - -/* Scanning the necessary info. */ -cc++; -ccbegin = cc; -compares = 0; - -if (cc[-1] & XCL_MAP) - { - min = 0; - cc += 32 / sizeof(PCRE2_UCHAR); - } - -while (*cc != XCL_END) - { - compares++; - - if (*cc == XCL_SINGLE) - { - cc ++; - GETCHARINCTEST(c, cc); - if (c > max) max = c; - if (c < min) min = c; -#ifdef SUPPORT_UNICODE - unicode_status |= XCLASS_SAVE_CHAR; -#endif /* SUPPORT_UNICODE */ - } - else if (*cc == XCL_RANGE) - { - cc ++; - GETCHARINCTEST(c, cc); - if (c < min) min = c; - GETCHARINCTEST(c, cc); - if (c > max) max = c; -#ifdef SUPPORT_UNICODE - unicode_status |= XCLASS_SAVE_CHAR; -#endif /* SUPPORT_UNICODE */ - } -#ifdef SUPPORT_UNICODE - else - { - SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP); - cc++; - - if (*cc == PT_CLIST && cc[-1] == XCL_PROP) - { - other_cases = PRIV(ucd_caseless_sets) + cc[1]; - while (*other_cases != NOTACHAR) - { - if (*other_cases > max) max = *other_cases; - if (*other_cases < min) min = *other_cases; - other_cases++; - } - } - else - { - max = READ_CHAR_MAX; - min = 0; - } - - items = 0; - - switch(*cc) - { - case PT_ANY: - /* Any either accepts everything or ignored. */ - if (cc[-1] == XCL_PROP) - items = UCPCAT_ALL; - else - compares--; - break; - - case PT_LAMP: - items = UCPCAT3(ucp_Lu, ucp_Ll, ucp_Lt); - break; - - case PT_GC: - items = UCPCAT_RANGE(PRIV(ucp_typerange)[(int)cc[1] * 2], PRIV(ucp_typerange)[(int)cc[1] * 2 + 1]); - break; - - case PT_PC: - items = UCPCAT(cc[1]); - break; - - case PT_WORD: - items = UCPCAT2(ucp_Mn, ucp_Pc) | UCPCAT_L | UCPCAT_N; - break; - - case PT_ALNUM: - items = UCPCAT_L | UCPCAT_N; - break; - - case PT_SCX: - unicode_status |= XCLASS_HAS_SCRIPT_EXTENSION; - if (cc[-1] == XCL_NOTPROP) - { - unicode_status |= XCLASS_SCRIPT_EXTENSION_NOTPROP; - break; - } - compares++; - /* Fall through */ - - case PT_SC: - unicode_status |= XCLASS_HAS_SCRIPT; - break; - - case PT_SPACE: - case PT_PXSPACE: - case PT_PXGRAPH: - case PT_PXPRINT: - case PT_PXPUNCT: - unicode_status |= XCLASS_SAVE_CHAR | XCLASS_HAS_TYPE; - break; - - case PT_CLIST: - case PT_UCNC: - case PT_PXXDIGIT: - unicode_status |= XCLASS_SAVE_CHAR; - break; - - case PT_BOOL: - unicode_status |= XCLASS_HAS_BOOL; - break; - - case PT_BIDICL: - unicode_status |= XCLASS_HAS_BIDICL; - break; - - default: - SLJIT_UNREACHABLE(); - break; - } - - if (items > 0) - { - if (cc[-1] == XCL_NOTPROP) - items ^= UCPCAT_ALL; - category_list |= items; - unicode_status |= XCLASS_HAS_TYPE; - compares--; - } - - cc += 2; - } -#endif /* SUPPORT_UNICODE */ - } - -#ifdef SUPPORT_UNICODE -if (category_list == UCPCAT_ALL) - { - /* All characters are accepted, same as dotall. */ - compile_char1_matchingpath(common, OP_ALLANY, cc, backtracks, FALSE); - if (list == backtracks) - add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); - return; - } - -if (compares == 0 && category_list == 0) - { - /* No characters are accepted, same as (*F) or dotall. */ - compile_char1_matchingpath(common, OP_ALLANY, cc, backtracks, FALSE); - if (list != backtracks) - add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); - return; - } -#else /* !SUPPORT_UNICODE */ -SLJIT_ASSERT(compares > 0); -#endif /* SUPPORT_UNICODE */ - -/* We are not necessary in utf mode even in 8 bit mode. */ -cc = ccbegin; -if ((cc[-1] & XCL_NOT) != 0) - read_char(common, min, max, backtracks, READ_CHAR_UPDATE_STR_PTR); -else - { -#ifdef SUPPORT_UNICODE - read_char(common, min, max, (unicode_status & XCLASS_NEEDS_UCD) ? backtracks : NULL, 0); -#else /* !SUPPORT_UNICODE */ - read_char(common, min, max, NULL, 0); -#endif /* SUPPORT_UNICODE */ - } - -if ((cc[-1] & XCL_HASPROP) == 0) - { - if ((cc[-1] & XCL_MAP) != 0) - { - jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255); - if (!optimize_class(common, (const sljit_u8 *)cc, (((const sljit_u8 *)cc)[31] & 0x80) != 0, TRUE, &found)) - { - OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7); - OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3); - OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc); - OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0); - OP2U(SLJIT_AND | SLJIT_SET_Z, TMP1, 0, TMP2, 0); - add_jump(compiler, &found, JUMP(SLJIT_NOT_ZERO)); - } - - add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); - JUMPHERE(jump); - - cc += 32 / sizeof(PCRE2_UCHAR); - } - else - { - OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, min); - add_jump(compiler, (cc[-1] & XCL_NOT) == 0 ? backtracks : &found, CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, max - min)); - } - } -else if ((cc[-1] & XCL_MAP) != 0) - { - OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0); -#ifdef SUPPORT_UNICODE - unicode_status |= XCLASS_CHAR_SAVED; -#endif /* SUPPORT_UNICODE */ - if (!optimize_class(common, (const sljit_u8 *)cc, FALSE, TRUE, list)) - { -#if PCRE2_CODE_UNIT_WIDTH == 8 - jump = NULL; - if (common->utf) -#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ - jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255); - - OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7); - OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3); - OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc); - OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0); - OP2U(SLJIT_AND | SLJIT_SET_Z, TMP1, 0, TMP2, 0); - add_jump(compiler, list, JUMP(SLJIT_NOT_ZERO)); - -#if PCRE2_CODE_UNIT_WIDTH == 8 - if (common->utf) -#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ - JUMPHERE(jump); - } - - OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0); - cc += 32 / sizeof(PCRE2_UCHAR); - } - -#ifdef SUPPORT_UNICODE -if (unicode_status & XCLASS_NEEDS_UCD) - { - if ((unicode_status & (XCLASS_SAVE_CHAR | XCLASS_CHAR_SAVED)) == XCLASS_SAVE_CHAR) - OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0); - -#if PCRE2_CODE_UNIT_WIDTH == 32 - if (!common->utf) - { - jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, MAX_UTF_CODE_POINT + 1); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, UNASSIGNED_UTF_CHAR); - JUMPHERE(jump); - } -#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */ - - OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); - OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); - OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); - OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK); - OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); - OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); - OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_stage2)); - OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1); - OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 3); - OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 2); - OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); - - ccbegin = cc; - - if (category_list != 0) - compares++; - - if (unicode_status & XCLASS_HAS_BIDICL) - { - OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, scriptx_bidiclass)); - OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BIDICLASS_SHIFT); - - while (*cc != XCL_END) - { - if (*cc == XCL_SINGLE) - { - cc ++; - GETCHARINCTEST(c, cc); - } - else if (*cc == XCL_RANGE) - { - cc ++; - GETCHARINCTEST(c, cc); - GETCHARINCTEST(c, cc); - } - else - { - SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP); - cc++; - if (*cc == PT_BIDICL) - { - compares--; - invertcmp = (compares == 0 && list != backtracks); - if (cc[-1] == XCL_NOTPROP) - invertcmp ^= 0x1; - jump = CMP(SLJIT_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (int)cc[1]); - add_jump(compiler, compares > 0 ? list : backtracks, jump); - } - cc += 2; - } - } - - cc = ccbegin; - } - - if (unicode_status & XCLASS_HAS_BOOL) - { - OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, bprops)); - OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BPROPS_MASK); - OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 2); - - while (*cc != XCL_END) - { - if (*cc == XCL_SINGLE) - { - cc ++; - GETCHARINCTEST(c, cc); - } - else if (*cc == XCL_RANGE) - { - cc ++; - GETCHARINCTEST(c, cc); - GETCHARINCTEST(c, cc); - } - else - { - SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP); - cc++; - if (*cc == PT_BOOL) - { - compares--; - invertcmp = (compares == 0 && list != backtracks); - if (cc[-1] == XCL_NOTPROP) - invertcmp ^= 0x1; - - OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP1), (sljit_sw)(PRIV(ucd_boolprop_sets) + (cc[1] >> 5)), SLJIT_IMM, (sljit_sw)(1u << (cc[1] & 0x1f))); - add_jump(compiler, compares > 0 ? list : backtracks, JUMP(SLJIT_NOT_ZERO ^ invertcmp)); - } - cc += 2; - } - } - - cc = ccbegin; - } - - if (unicode_status & XCLASS_HAS_SCRIPT) - { - OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script)); - - while (*cc != XCL_END) - { - if (*cc == XCL_SINGLE) - { - cc ++; - GETCHARINCTEST(c, cc); - } - else if (*cc == XCL_RANGE) - { - cc ++; - GETCHARINCTEST(c, cc); - GETCHARINCTEST(c, cc); - } - else - { - SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP); - cc++; - switch (*cc) - { - case PT_SCX: - if (cc[-1] == XCL_NOTPROP) - break; - /* Fall through */ - - case PT_SC: - compares--; - invertcmp = (compares == 0 && list != backtracks); - if (cc[-1] == XCL_NOTPROP) - invertcmp ^= 0x1; - - add_jump(compiler, compares > 0 ? list : backtracks, CMP(SLJIT_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (int)cc[1])); - } - cc += 2; - } - } - - cc = ccbegin; - } - - if (unicode_status & XCLASS_HAS_SCRIPT_EXTENSION) - { - OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, scriptx_bidiclass)); - OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_SCRIPTX_MASK); - OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 2); - - if (unicode_status & XCLASS_SCRIPT_EXTENSION_NOTPROP) - { - if (unicode_status & XCLASS_HAS_TYPE) - { - if (unicode_status & XCLASS_SAVE_CHAR) - { - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, TMP2, 0); - unicode_status |= XCLASS_SCRIPT_EXTENSION_RESTORE_LOCALS0; - } - else - { - OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP2, 0); - unicode_status |= XCLASS_SCRIPT_EXTENSION_RESTORE_RETURN_ADDR; - } - } - OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script)); - } - - while (*cc != XCL_END) - { - if (*cc == XCL_SINGLE) - { - cc ++; - GETCHARINCTEST(c, cc); - } - else if (*cc == XCL_RANGE) - { - cc ++; - GETCHARINCTEST(c, cc); - GETCHARINCTEST(c, cc); - } - else - { - SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP); - cc++; - if (*cc == PT_SCX) - { - compares--; - invertcmp = (compares == 0 && list != backtracks); - - jump = NULL; - if (cc[-1] == XCL_NOTPROP) - { - jump = CMP(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, (int)cc[1]); - if (invertcmp) - { - add_jump(compiler, backtracks, jump); - jump = NULL; - } - invertcmp ^= 0x1; - } - - OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP1), (sljit_sw)(PRIV(ucd_script_sets) + (cc[1] >> 5)), SLJIT_IMM, (sljit_sw)(1u << (cc[1] & 0x1f))); - add_jump(compiler, compares > 0 ? list : backtracks, JUMP(SLJIT_NOT_ZERO ^ invertcmp)); - - if (jump != NULL) - JUMPHERE(jump); - } - cc += 2; - } - } - - if (unicode_status & XCLASS_SCRIPT_EXTENSION_RESTORE_LOCALS0) - OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); - else if (unicode_status & XCLASS_SCRIPT_EXTENSION_RESTORE_RETURN_ADDR) - OP1(SLJIT_MOV, TMP2, 0, RETURN_ADDR, 0); - cc = ccbegin; - } - - if (unicode_status & XCLASS_SAVE_CHAR) - OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0); - - if (unicode_status & XCLASS_HAS_TYPE) - { - if (unicode_status & XCLASS_SAVE_CHAR) - typereg = RETURN_ADDR; - - OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype)); - OP2(SLJIT_SHL, typereg, 0, SLJIT_IMM, 1, TMP2, 0); - - if (category_list > 0) - { - compares--; - invertcmp = (compares == 0 && list != backtracks); - OP2U(SLJIT_AND | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, category_list); - add_jump(compiler, compares > 0 ? list : backtracks, JUMP(SLJIT_NOT_ZERO ^ invertcmp)); - } - } - } -#endif /* SUPPORT_UNICODE */ - -/* Generating code. */ -charoffset = 0; -numberofcmps = 0; - -while (*cc != XCL_END) - { - compares--; - invertcmp = (compares == 0 && list != backtracks); - jump = NULL; - - if (*cc == XCL_SINGLE) - { - cc ++; - GETCHARINCTEST(c, cc); - - if (numberofcmps < 3 && (*cc == XCL_SINGLE || *cc == XCL_RANGE)) - { - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset)); - OP_FLAGS(numberofcmps == 0 ? SLJIT_MOV : SLJIT_OR, TMP2, 0, SLJIT_EQUAL); - numberofcmps++; - } - else if (numberofcmps > 0) - { - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset)); - OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_EQUAL); - jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp); - numberofcmps = 0; - } - else - { - jump = CMP(SLJIT_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset)); - numberofcmps = 0; - } - } - else if (*cc == XCL_RANGE) - { - cc ++; - GETCHARINCTEST(c, cc); - SET_CHAR_OFFSET(c); - GETCHARINCTEST(c, cc); - - if (numberofcmps < 3 && (*cc == XCL_SINGLE || *cc == XCL_RANGE)) - { - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset)); - OP_FLAGS(numberofcmps == 0 ? SLJIT_MOV : SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL); - numberofcmps++; - } - else if (numberofcmps > 0) - { - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset)); - OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL); - jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp); - numberofcmps = 0; - } - else - { - jump = CMP(SLJIT_LESS_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset)); - numberofcmps = 0; - } - } -#ifdef SUPPORT_UNICODE - else - { - SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP); - if (*cc == XCL_NOTPROP) - invertcmp ^= 0x1; - cc++; - switch(*cc) - { - case PT_ANY: - case PT_LAMP: - case PT_GC: - case PT_PC: - case PT_SC: - case PT_SCX: - case PT_BOOL: - case PT_BIDICL: - case PT_WORD: - case PT_ALNUM: - compares++; - /* Already handled. */ - break; - - case PT_SPACE: - case PT_PXSPACE: - SET_CHAR_OFFSET(9); - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0xd - 0x9); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL); - - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x85 - 0x9); - OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); - - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x180e - 0x9); - OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); - - OP2U(SLJIT_AND | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, UCPCAT_RANGE(ucp_Zl, ucp_Zs)); - OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_NOT_ZERO); - jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp); - break; - - case PT_CLIST: - other_cases = PRIV(ucd_caseless_sets) + cc[1]; - - /* At least three characters are required. - Otherwise this case would be handled by the normal code path. */ - SLJIT_ASSERT(other_cases[0] != NOTACHAR && other_cases[1] != NOTACHAR && other_cases[2] != NOTACHAR); - SLJIT_ASSERT(other_cases[0] < other_cases[1] && other_cases[1] < other_cases[2]); - - /* Optimizing character pairs, if their difference is power of 2. */ - if (is_powerof2(other_cases[1] ^ other_cases[0])) - { - if (charoffset == 0) - OP2(SLJIT_OR, TMP2, 0, TMP1, 0, SLJIT_IMM, other_cases[1] ^ other_cases[0]); - else - { - OP2(SLJIT_ADD, TMP2, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)charoffset); - OP2(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_IMM, other_cases[1] ^ other_cases[0]); - } - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, SLJIT_IMM, other_cases[1]); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL); - other_cases += 2; - } - else if (is_powerof2(other_cases[2] ^ other_cases[1])) - { - if (charoffset == 0) - OP2(SLJIT_OR, TMP2, 0, TMP1, 0, SLJIT_IMM, other_cases[2] ^ other_cases[1]); - else - { - OP2(SLJIT_ADD, TMP2, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)charoffset); - OP2(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_IMM, other_cases[1] ^ other_cases[0]); - } - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, SLJIT_IMM, other_cases[2]); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL); - - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(other_cases[0] - charoffset)); - OP_FLAGS(SLJIT_OR | ((other_cases[3] == NOTACHAR) ? SLJIT_SET_Z : 0), TMP2, 0, SLJIT_EQUAL); - - other_cases += 3; - } - else - { - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(*other_cases++ - charoffset)); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL); - } - - while (*other_cases != NOTACHAR) - { - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(*other_cases++ - charoffset)); - OP_FLAGS(SLJIT_OR | ((*other_cases == NOTACHAR) ? SLJIT_SET_Z : 0), TMP2, 0, SLJIT_EQUAL); - } - jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp); - break; - - case PT_UCNC: - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_DOLLAR_SIGN - charoffset)); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL); - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_COMMERCIAL_AT - charoffset)); - OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_GRAVE_ACCENT - charoffset)); - OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); - - SET_CHAR_OFFSET(0xa0); - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, (sljit_sw)(0xd7ff - charoffset)); - OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL); - SET_CHAR_OFFSET(0); - OP2U(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xe000 - 0); - OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_GREATER_EQUAL); - jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp); - break; - - case PT_PXGRAPH: - OP2U(SLJIT_AND | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, UCPCAT_RANGE(ucp_Cc, ucp_Cs) | UCPCAT_RANGE(ucp_Zl, ucp_Zs)); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_NOT_ZERO); - - OP2U(SLJIT_AND | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, UCPCAT(ucp_Cf)); - jump = JUMP(SLJIT_ZERO); - - c = charoffset; - /* In case of ucp_Cf, we overwrite the result. */ - SET_CHAR_OFFSET(0x2066); - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x2069 - 0x2066); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL); - - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x061c - 0x2066); - OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); - - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x180e - 0x2066); - OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); - - /* Restore charoffset. */ - SET_CHAR_OFFSET(c); - - JUMPHERE(jump); - jump = CMP(SLJIT_ZERO ^ invertcmp, TMP2, 0, SLJIT_IMM, 0); - break; - - case PT_PXPRINT: - OP2U(SLJIT_AND | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, UCPCAT_RANGE(ucp_Cc, ucp_Cs) | UCPCAT2(ucp_Zl, ucp_Zp)); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_NOT_ZERO); - - OP2U(SLJIT_AND | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, UCPCAT(ucp_Cf)); - jump = JUMP(SLJIT_ZERO); - - c = charoffset; - /* In case of ucp_Cf, we overwrite the result. */ - SET_CHAR_OFFSET(0x2066); - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x2069 - 0x2066); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL); - - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x061c - 0x2066); - OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL); - - /* Restore charoffset. */ - SET_CHAR_OFFSET(c); - - JUMPHERE(jump); - jump = CMP(SLJIT_ZERO ^ invertcmp, TMP2, 0, SLJIT_IMM, 0); - break; - - case PT_PXPUNCT: - OP2U(SLJIT_AND | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, UCPCAT_RANGE(ucp_Sc, ucp_So)); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_NOT_ZERO); - - SET_CHAR_OFFSET(0); - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x7f); - OP_FLAGS(SLJIT_AND, TMP2, 0, SLJIT_LESS_EQUAL); - - OP2U(SLJIT_AND | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, UCPCAT_RANGE(ucp_Pc, ucp_Ps)); - OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_NOT_ZERO); - jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp); - break; - - case PT_PXXDIGIT: - SET_CHAR_OFFSET(CHAR_A); - OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, ~0x20); - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP2, 0, SLJIT_IMM, CHAR_F - CHAR_A); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL); - - SET_CHAR_OFFSET(CHAR_0); - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_9 - CHAR_0); - OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL); - - SET_CHAR_OFFSET(0xff10); - jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 0xff46 - 0xff10); - - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0xff19 - 0xff10); - OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL); - - SET_CHAR_OFFSET(0xff21); - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0xff26 - 0xff21); - OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL); - - SET_CHAR_OFFSET(0xff41); - OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0xff46 - 0xff41); - OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL); - - SET_CHAR_OFFSET(0xff10); - - JUMPHERE(jump); - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, SLJIT_IMM, 0); - jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp); - break; - - default: - SLJIT_UNREACHABLE(); - break; - } - cc += 2; - } -#endif /* SUPPORT_UNICODE */ - - if (jump != NULL) - add_jump(compiler, compares > 0 ? list : backtracks, jump); - } - -SLJIT_ASSERT(compares == 0); -if (found != NULL) - set_jumps(found, LABEL()); -} - -#undef SET_TYPE_OFFSET -#undef SET_CHAR_OFFSET - -#endif - -static PCRE2_SPTR compile_simple_assertion_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR cc, jump_list **backtracks) -{ -DEFINE_COMPILER; -struct sljit_jump *jump[4]; - -switch(type) - { - case OP_SOD: - if (HAS_VIRTUAL_REGISTERS) - { - OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); - } - else - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, TMP1, 0)); - return cc; - - case OP_SOM: - if (HAS_VIRTUAL_REGISTERS) - { - OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str)); - } - else - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, str)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, TMP1, 0)); - return cc; - - case OP_NOT_WORD_BOUNDARY: - case OP_WORD_BOUNDARY: - case OP_NOT_UCP_WORD_BOUNDARY: - case OP_UCP_WORD_BOUNDARY: - add_jump(compiler, (type == OP_NOT_WORD_BOUNDARY || type == OP_WORD_BOUNDARY) ? &common->wordboundary : &common->ucp_wordboundary, JUMP(SLJIT_FAST_CALL)); -#ifdef SUPPORT_UNICODE - if (common->invalid_utf) - { - add_jump(compiler, backtracks, CMP((type == OP_NOT_WORD_BOUNDARY || type == OP_NOT_UCP_WORD_BOUNDARY) ? SLJIT_NOT_EQUAL : SLJIT_SIG_LESS_EQUAL, TMP2, 0, SLJIT_IMM, 0)); - return cc; - } -#endif /* SUPPORT_UNICODE */ - sljit_set_current_flags(compiler, SLJIT_SET_Z); - add_jump(compiler, backtracks, JUMP((type == OP_NOT_WORD_BOUNDARY || type == OP_NOT_UCP_WORD_BOUNDARY) ? SLJIT_NOT_ZERO : SLJIT_ZERO)); - return cc; - - case OP_EODN: - /* Requires rather complex checks. */ - jump[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0); - if (common->nltype == NLTYPE_FIXED && common->newline > 255) - { - OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); - if (common->mode == PCRE2_JIT_COMPLETE) - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, STR_END, 0)); - else - { - jump[1] = CMP(SLJIT_EQUAL, TMP2, 0, STR_END, 0); - OP2U(SLJIT_SUB | SLJIT_SET_LESS, TMP2, 0, STR_END, 0); - OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS); - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); - OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_NOT_EQUAL); - add_jump(compiler, backtracks, JUMP(SLJIT_NOT_EQUAL)); - check_partial(common, TRUE); - add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); - JUMPHERE(jump[1]); - } - OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); - } - else if (common->nltype == NLTYPE_FIXED) - { - OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, STR_END, 0)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline)); - } - else - { - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); - jump[1] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR); - OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); - OP2U(SLJIT_SUB | SLJIT_SET_Z | SLJIT_SET_GREATER, TMP2, 0, STR_END, 0); - jump[2] = JUMP(SLJIT_GREATER); - add_jump(compiler, backtracks, JUMP(SLJIT_NOT_EQUAL) /* LESS */); - /* Equal. */ - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1)); - jump[3] = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_NL); - add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); - - JUMPHERE(jump[1]); - if (common->nltype == NLTYPE_ANYCRLF) - { - OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP2, 0, STR_END, 0)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_NL)); - } - else - { - OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0); - read_char(common, common->nlmin, common->nlmax, backtracks, READ_CHAR_UPDATE_STR_PTR); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, STR_END, 0)); - add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL)); - sljit_set_current_flags(compiler, SLJIT_SET_Z); - add_jump(compiler, backtracks, JUMP(SLJIT_ZERO)); - OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0); - } - JUMPHERE(jump[2]); - JUMPHERE(jump[3]); - } - JUMPHERE(jump[0]); - if (common->mode != PCRE2_JIT_COMPLETE) - check_partial(common, TRUE); - return cc; - - case OP_EOD: - add_jump(compiler, backtracks, CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0)); - if (common->mode != PCRE2_JIT_COMPLETE) - check_partial(common, TRUE); - return cc; - - case OP_DOLL: - if (HAS_VIRTUAL_REGISTERS) - { - OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); - OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL); - } - else - OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL); - add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO)); - - if (!common->endonly) - compile_simple_assertion_matchingpath(common, OP_EODN, cc, backtracks); - else - { - add_jump(compiler, backtracks, CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0)); - check_partial(common, FALSE); - } - return cc; - - case OP_DOLLM: - jump[1] = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0); - if (HAS_VIRTUAL_REGISTERS) - { - OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); - OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL); - } - else - OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL); - add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO)); - check_partial(common, FALSE); - jump[0] = JUMP(SLJIT_JUMP); - JUMPHERE(jump[1]); - - if (common->nltype == NLTYPE_FIXED && common->newline > 255) - { - OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); - if (common->mode == PCRE2_JIT_COMPLETE) - add_jump(compiler, backtracks, CMP(SLJIT_GREATER, TMP2, 0, STR_END, 0)); - else - { - jump[1] = CMP(SLJIT_LESS_EQUAL, TMP2, 0, STR_END, 0); - /* STR_PTR = STR_END - IN_UCHARS(1) */ - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff)); - check_partial(common, TRUE); - add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); - JUMPHERE(jump[1]); - } - - OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); - } - else - { - peek_char(common, common->nlmax, TMP3, 0, NULL); - check_newlinechar(common, common->nltype, backtracks, FALSE); - } - JUMPHERE(jump[0]); - return cc; - - case OP_CIRC: - if (HAS_VIRTUAL_REGISTERS) - { - OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin)); - add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0)); - OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL); - add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO)); - } - else - { - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin)); - add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0)); - OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL); - add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO)); - } - return cc; - - case OP_CIRCM: - /* TMP2 might be used by peek_char_back. */ - if (HAS_VIRTUAL_REGISTERS) - { - OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); - OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); - jump[1] = CMP(SLJIT_GREATER, STR_PTR, 0, TMP2, 0); - OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL); - } - else - { - OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin)); - jump[1] = CMP(SLJIT_GREATER, STR_PTR, 0, TMP2, 0); - OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL); - } - add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO)); - jump[0] = JUMP(SLJIT_JUMP); - JUMPHERE(jump[1]); - - if (!common->alt_circumflex) - add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); - - if (common->nltype == NLTYPE_FIXED && common->newline > 255) - { - OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); - add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP1, 0, TMP2, 0)); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); - OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff)); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); - } - else - { - peek_char_back(common, common->nlmax, backtracks); - check_newlinechar(common, common->nltype, backtracks, FALSE); - } - JUMPHERE(jump[0]); - return cc; - } -SLJIT_UNREACHABLE(); -return cc; -} - -#ifdef SUPPORT_UNICODE - -#if PCRE2_CODE_UNIT_WIDTH != 32 - -/* The code in this function copies the logic of the interpreter function that -is defined in the pcre2_extuni.c source. If that code is updated, this -function, and those below it, must be kept in step (note by PH, June 2024). */ - -static PCRE2_SPTR SLJIT_FUNC do_extuni_utf(jit_arguments *args, PCRE2_SPTR cc) -{ -PCRE2_SPTR start_subject = args->begin; -PCRE2_SPTR end_subject = args->end; -int lgb, rgb, ricount; -PCRE2_SPTR prevcc, endcc, bptr; -BOOL first = TRUE; -BOOL was_ep_ZWJ = FALSE; -uint32_t c; - -prevcc = cc; -endcc = NULL; -do - { - GETCHARINC(c, cc); - rgb = UCD_GRAPHBREAK(c); - - if (first) - { - lgb = rgb; - endcc = cc; - first = FALSE; - continue; - } - - if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) - break; - - /* ZWJ followed by Extended Pictographic is allowed only if the ZWJ was - preceded by Extended Pictographic. */ - - if (lgb == ucp_gbZWJ && rgb == ucp_gbExtended_Pictographic && !was_ep_ZWJ) - break; - - /* Not breaking between Regional Indicators is allowed only if there - are an even number of preceding RIs. */ - - if (lgb == ucp_gbRegional_Indicator && rgb == ucp_gbRegional_Indicator) - { - ricount = 0; - bptr = prevcc; - - /* bptr is pointing to the left-hand character */ - while (bptr > start_subject) - { - bptr--; - BACKCHAR(bptr); - GETCHAR(c, bptr); - - if (UCD_GRAPHBREAK(c) != ucp_gbRegional_Indicator) - break; - - ricount++; - } - - if ((ricount & 1) != 0) break; /* Grapheme break required */ - } - - /* Set a flag when ZWJ follows Extended Pictographic (with optional Extend in - between; see next statement). */ - - was_ep_ZWJ = (lgb == ucp_gbExtended_Pictographic && rgb == ucp_gbZWJ); - - /* If Extend follows Extended_Pictographic, do not update lgb; this allows - any number of them before a following ZWJ. */ - - if (rgb != ucp_gbExtend || lgb != ucp_gbExtended_Pictographic) - lgb = rgb; - - prevcc = endcc; - endcc = cc; - } -while (cc < end_subject); - -return endcc; -} - -#endif /* PCRE2_CODE_UNIT_WIDTH != 32 */ - -/* The code in this function copies the logic of the interpreter function that -is defined in the pcre2_extuni.c source. If that code is updated, this -function, and the one below it, must be kept in step (note by PH, June 2024). */ - -static PCRE2_SPTR SLJIT_FUNC do_extuni_utf_invalid(jit_arguments *args, PCRE2_SPTR cc) -{ -PCRE2_SPTR start_subject = args->begin; -PCRE2_SPTR end_subject = args->end; -int lgb, rgb, ricount; -PCRE2_SPTR prevcc, endcc, bptr; -BOOL first = TRUE; -BOOL was_ep_ZWJ = FALSE; -uint32_t c; - -prevcc = cc; -endcc = NULL; -do - { - GETCHARINC_INVALID(c, cc, end_subject, break); - rgb = UCD_GRAPHBREAK(c); - - if (first) - { - lgb = rgb; - endcc = cc; - first = FALSE; - continue; - } - - if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) - break; - - /* ZWJ followed by Extended Pictographic is allowed only if the ZWJ was - preceded by Extended Pictographic. */ - - if (lgb == ucp_gbZWJ && rgb == ucp_gbExtended_Pictographic && !was_ep_ZWJ) - break; - - /* Not breaking between Regional Indicators is allowed only if there - are an even number of preceding RIs. */ - - if (lgb == ucp_gbRegional_Indicator && rgb == ucp_gbRegional_Indicator) - { - ricount = 0; - bptr = prevcc; - - /* bptr is pointing to the left-hand character */ - while (bptr > start_subject) - { - GETCHARBACK_INVALID(c, bptr, start_subject, break); - - if (UCD_GRAPHBREAK(c) != ucp_gbRegional_Indicator) - break; - - ricount++; - } - - if ((ricount & 1) != 0) - break; /* Grapheme break required */ - } - - /* Set a flag when ZWJ follows Extended Pictographic (with optional Extend in - between; see next statement). */ - - was_ep_ZWJ = (lgb == ucp_gbExtended_Pictographic && rgb == ucp_gbZWJ); - - /* If Extend follows Extended_Pictographic, do not update lgb; this allows - any number of them before a following ZWJ. */ - - if (rgb != ucp_gbExtend || lgb != ucp_gbExtended_Pictographic) - lgb = rgb; - - prevcc = endcc; - endcc = cc; - } -while (cc < end_subject); - -return endcc; -} - -/* The code in this function copies the logic of the interpreter function that -is defined in the pcre2_extuni.c source. If that code is updated, this -function must be kept in step (note by PH, June 2024). */ - -static PCRE2_SPTR SLJIT_FUNC do_extuni_no_utf(jit_arguments *args, PCRE2_SPTR cc) -{ -PCRE2_SPTR start_subject = args->begin; -PCRE2_SPTR end_subject = args->end; -int lgb, rgb, ricount; -PCRE2_SPTR bptr; -uint32_t c; -BOOL was_ep_ZWJ = FALSE; - -/* Patch by PH */ -/* GETCHARINC(c, cc); */ -c = *cc++; - -#if PCRE2_CODE_UNIT_WIDTH == 32 -if (c >= 0x110000) - return cc; -#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */ -lgb = UCD_GRAPHBREAK(c); - -while (cc < end_subject) - { - c = *cc; -#if PCRE2_CODE_UNIT_WIDTH == 32 - if (c >= 0x110000) - break; -#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */ - rgb = UCD_GRAPHBREAK(c); - - if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) - break; - - /* ZWJ followed by Extended Pictographic is allowed only if the ZWJ was - preceded by Extended Pictographic. */ - - if (lgb == ucp_gbZWJ && rgb == ucp_gbExtended_Pictographic && !was_ep_ZWJ) - break; - - /* Not breaking between Regional Indicators is allowed only if there - are an even number of preceding RIs. */ - - if (lgb == ucp_gbRegional_Indicator && rgb == ucp_gbRegional_Indicator) - { - ricount = 0; - bptr = cc - 1; - - /* bptr is pointing to the left-hand character */ - while (bptr > start_subject) - { - bptr--; - c = *bptr; -#if PCRE2_CODE_UNIT_WIDTH == 32 - if (c >= 0x110000) - break; -#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */ - - if (UCD_GRAPHBREAK(c) != ucp_gbRegional_Indicator) break; - - ricount++; - } - - if ((ricount & 1) != 0) - break; /* Grapheme break required */ - } - - /* Set a flag when ZWJ follows Extended Pictographic (with optional Extend in - between; see next statement). */ - - was_ep_ZWJ = (lgb == ucp_gbExtended_Pictographic && rgb == ucp_gbZWJ); - - /* If Extend follows Extended_Pictographic, do not update lgb; this allows - any number of them before a following ZWJ. */ - - if (rgb != ucp_gbExtend || lgb != ucp_gbExtended_Pictographic) - lgb = rgb; - - cc++; - } - -return cc; -} - -#endif /* SUPPORT_UNICODE */ - -static PCRE2_SPTR compile_char1_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR cc, jump_list **backtracks, BOOL check_str_ptr) -{ -DEFINE_COMPILER; -int length; -unsigned int c, oc, bit; -compare_context context; -struct sljit_jump *jump[3]; -jump_list *end_list; -#ifdef SUPPORT_UNICODE -PCRE2_UCHAR propdata[5]; -#endif /* SUPPORT_UNICODE */ - -switch(type) - { - case OP_NOT_DIGIT: - case OP_DIGIT: - /* Digits are usually 0-9, so it is worth to optimize them. */ - if (check_str_ptr) - detect_partial_match(common, backtracks); -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 - if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_digit, FALSE)) - read_char7_type(common, backtracks, type == OP_NOT_DIGIT); - else -#endif - read_char8_type(common, backtracks, type == OP_NOT_DIGIT); - /* Flip the starting bit in the negative case. */ - OP2U(SLJIT_AND | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, ctype_digit); - add_jump(compiler, backtracks, JUMP(type == OP_DIGIT ? SLJIT_ZERO : SLJIT_NOT_ZERO)); - return cc; - - case OP_NOT_WHITESPACE: - case OP_WHITESPACE: - if (check_str_ptr) - detect_partial_match(common, backtracks); -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 - if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_space, FALSE)) - read_char7_type(common, backtracks, type == OP_NOT_WHITESPACE); - else -#endif - read_char8_type(common, backtracks, type == OP_NOT_WHITESPACE); - OP2U(SLJIT_AND | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, ctype_space); - add_jump(compiler, backtracks, JUMP(type == OP_WHITESPACE ? SLJIT_ZERO : SLJIT_NOT_ZERO)); - return cc; - - case OP_NOT_WORDCHAR: - case OP_WORDCHAR: - if (check_str_ptr) - detect_partial_match(common, backtracks); -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 - if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_word, FALSE)) - read_char7_type(common, backtracks, type == OP_NOT_WORDCHAR); - else -#endif - read_char8_type(common, backtracks, type == OP_NOT_WORDCHAR); - OP2U(SLJIT_AND | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, ctype_word); - add_jump(compiler, backtracks, JUMP(type == OP_WORDCHAR ? SLJIT_ZERO : SLJIT_NOT_ZERO)); - return cc; - - case OP_ANY: - if (check_str_ptr) - detect_partial_match(common, backtracks); - read_char(common, common->nlmin, common->nlmax, backtracks, READ_CHAR_UPDATE_STR_PTR); - if (common->nltype == NLTYPE_FIXED && common->newline > 255) - { - jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); - end_list = NULL; - if (common->mode != PCRE2_JIT_PARTIAL_HARD) - add_jump(compiler, &end_list, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); - else - check_str_end(common, &end_list); - - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); - add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline & 0xff)); - set_jumps(end_list, LABEL()); - JUMPHERE(jump[0]); - } - else - check_newlinechar(common, common->nltype, backtracks, TRUE); - return cc; - - case OP_ALLANY: - if (check_str_ptr) - detect_partial_match(common, backtracks); -#ifdef SUPPORT_UNICODE - if (common->utf && common->invalid_utf) - { - read_char(common, 0, READ_CHAR_MAX, backtracks, READ_CHAR_UPDATE_STR_PTR); - return cc; - } -#endif /* SUPPORT_UNICODE */ - - skip_valid_char(common); - return cc; - - case OP_ANYBYTE: - if (check_str_ptr) - detect_partial_match(common, backtracks); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - return cc; - -#ifdef SUPPORT_UNICODE - case OP_NOTPROP: - case OP_PROP: - propdata[0] = XCL_HASPROP; - propdata[1] = type == OP_NOTPROP ? XCL_NOTPROP : XCL_PROP; - propdata[2] = cc[0]; - propdata[3] = cc[1]; - propdata[4] = XCL_END; - if (check_str_ptr) - detect_partial_match(common, backtracks); - compile_xclass_matchingpath(common, propdata, backtracks); - return cc + 2; -#endif - - case OP_ANYNL: - if (check_str_ptr) - detect_partial_match(common, backtracks); - read_char(common, common->bsr_nlmin, common->bsr_nlmax, NULL, 0); - jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR); - /* We don't need to handle soft partial matching case. */ - end_list = NULL; - if (common->mode != PCRE2_JIT_PARTIAL_HARD) - add_jump(compiler, &end_list, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); - else - check_str_end(common, &end_list); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); - jump[1] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_NL); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - jump[2] = JUMP(SLJIT_JUMP); - JUMPHERE(jump[0]); - check_newlinechar(common, common->bsr_nltype, backtracks, FALSE); - set_jumps(end_list, LABEL()); - JUMPHERE(jump[1]); - JUMPHERE(jump[2]); - return cc; - - case OP_NOT_HSPACE: - case OP_HSPACE: - if (check_str_ptr) - detect_partial_match(common, backtracks); - - if (type == OP_NOT_HSPACE) - read_char(common, 0x9, 0x3000, backtracks, READ_CHAR_UPDATE_STR_PTR); - else - read_char(common, 0x9, 0x3000, NULL, 0); - - add_jump(compiler, &common->hspace, JUMP(SLJIT_FAST_CALL)); - sljit_set_current_flags(compiler, SLJIT_SET_Z); - add_jump(compiler, backtracks, JUMP(type == OP_NOT_HSPACE ? SLJIT_NOT_ZERO : SLJIT_ZERO)); - return cc; - - case OP_NOT_VSPACE: - case OP_VSPACE: - if (check_str_ptr) - detect_partial_match(common, backtracks); - - if (type == OP_NOT_VSPACE) - read_char(common, 0xa, 0x2029, backtracks, READ_CHAR_UPDATE_STR_PTR); - else - read_char(common, 0xa, 0x2029, NULL, 0); - - add_jump(compiler, &common->vspace, JUMP(SLJIT_FAST_CALL)); - sljit_set_current_flags(compiler, SLJIT_SET_Z); - add_jump(compiler, backtracks, JUMP(type == OP_NOT_VSPACE ? SLJIT_NOT_ZERO : SLJIT_ZERO)); - return cc; - -#ifdef SUPPORT_UNICODE - case OP_EXTUNI: - if (check_str_ptr) - detect_partial_match(common, backtracks); - - SLJIT_ASSERT(TMP1 == SLJIT_R0 && STR_PTR == SLJIT_R1); - OP1(SLJIT_MOV, SLJIT_R0, 0, ARGUMENTS, 0); - -#if PCRE2_CODE_UNIT_WIDTH != 32 - sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS2(W, W, W), SLJIT_IMM, - common->utf ? (common->invalid_utf ? SLJIT_FUNC_ADDR(do_extuni_utf_invalid) : SLJIT_FUNC_ADDR(do_extuni_utf)) : SLJIT_FUNC_ADDR(do_extuni_no_utf)); - if (common->invalid_utf) - add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0)); -#else - sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS2(W, W, W), SLJIT_IMM, - common->invalid_utf ? SLJIT_FUNC_ADDR(do_extuni_utf_invalid) : SLJIT_FUNC_ADDR(do_extuni_no_utf)); - if (common->invalid_utf) - add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0)); -#endif - - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0); - - if (common->mode == PCRE2_JIT_PARTIAL_HARD) - { - jump[0] = CMP(SLJIT_LESS, SLJIT_RETURN_REG, 0, STR_END, 0); - /* Since we successfully read a char above, partial matching must occure. */ - check_partial(common, TRUE); - JUMPHERE(jump[0]); - } - return cc; -#endif - - case OP_CHAR: - case OP_CHARI: - length = 1; -#ifdef SUPPORT_UNICODE - if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc); -#endif - - if (check_str_ptr && common->mode != PCRE2_JIT_COMPLETE) - detect_partial_match(common, backtracks); - - if (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0) + if (common->nltype == NLTYPE_FIXED && common->newline > 255) { - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(length)); - if (length > 1 || (check_str_ptr && common->mode == PCRE2_JIT_COMPLETE)) - add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0)); + OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); + if (common->mode == PCRE2_JIT_COMPLETE) + add_jump(compiler, backtracks, CMP(SLJIT_GREATER, TMP2, 0, STR_END, 0)); + else + { + jump[1] = CMP(SLJIT_LESS_EQUAL, TMP2, 0, STR_END, 0); + /* STR_PTR = STR_END - IN_UCHARS(1) */ + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff)); + check_partial(common, TRUE); + add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); + JUMPHERE(jump[1]); + } - context.length = IN_UCHARS(length); - context.sourcereg = -1; -#if defined SLJIT_UNALIGNED && SLJIT_UNALIGNED - context.ucharptr = 0; -#endif - return byte_sequence_compare(common, type == OP_CHARI, cc, &context, backtracks); + OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); } - -#ifdef SUPPORT_UNICODE - if (common->utf) + else { - GETCHAR(c, cc); + peek_char(common, common->nlmax, TMP3, 0, NULL); + check_newlinechar(common, common->nltype, backtracks, FALSE); } - else -#endif - c = *cc; - - SLJIT_ASSERT(type == OP_CHARI && char_has_othercase(common, cc)); - - if (check_str_ptr && common->mode == PCRE2_JIT_COMPLETE) - add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); - - oc = char_othercase(common, c); - read_char(common, c < oc ? c : oc, c > oc ? c : oc, NULL, 0); - - SLJIT_ASSERT(!is_powerof2(c ^ oc)); + JUMPHERE(jump[0]); + return cc; - if (sljit_has_cpu_feature(SLJIT_HAS_CMOV)) + case OP_CIRC: + if (HAS_VIRTUAL_REGISTERS) { - OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, oc); - SELECT(SLJIT_EQUAL, TMP1, SLJIT_IMM, c, TMP1); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, c)); + OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin)); + add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0)); + OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL); + add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO)); } else { - jump[0] = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, c); - add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, oc)); - JUMPHERE(jump[0]); - } - return cc + length; - - case OP_NOT: - case OP_NOTI: - if (check_str_ptr) - detect_partial_match(common, backtracks); - - length = 1; -#ifdef SUPPORT_UNICODE - if (common->utf) - { -#if PCRE2_CODE_UNIT_WIDTH == 8 - c = *cc; - if (c < 128 && !common->invalid_utf) - { - OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(STR_PTR), 0); - if (type == OP_NOT || !char_has_othercase(common, cc)) - add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, c)); - else - { - /* Since UTF8 code page is fixed, we know that c is in [a-z] or [A-Z] range. */ - OP2(SLJIT_OR, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x20); - add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, c | 0x20)); - } - /* Skip the variable-length character. */ - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - jump[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0); - JUMPHERE(jump[0]); - return cc + 1; - } - else -#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */ - { - GETCHARLEN(c, cc, length); - } + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin)); + add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0)); + OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL); + add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO)); } - else -#endif /* SUPPORT_UNICODE */ - c = *cc; + return cc; - if (type == OP_NOT || !char_has_othercase(common, cc)) + case OP_CIRCM: + /* TMP2 might be used by peek_char_back. */ + if (HAS_VIRTUAL_REGISTERS) { - read_char(common, c, c, backtracks, READ_CHAR_UPDATE_STR_PTR); - add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, c)); + OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); + jump[1] = CMP(SLJIT_GREATER, STR_PTR, 0, TMP2, 0); + OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL); } else { - oc = char_othercase(common, c); - read_char(common, c < oc ? c : oc, c > oc ? c : oc, backtracks, READ_CHAR_UPDATE_STR_PTR); - bit = c ^ oc; - if (is_powerof2(bit)) - { - OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, bit); - add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, c | bit)); - } - else - { - add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, c)); - add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, oc)); - } + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin)); + jump[1] = CMP(SLJIT_GREATER, STR_PTR, 0, TMP2, 0); + OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL); } - return cc + length; - - case OP_CLASS: - case OP_NCLASS: - if (check_str_ptr) - detect_partial_match(common, backtracks); - -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 - bit = (common->utf && is_char7_bitset((const sljit_u8 *)cc, type == OP_NCLASS)) ? 127 : 255; - if (type == OP_NCLASS) - read_char(common, 0, bit, backtracks, READ_CHAR_UPDATE_STR_PTR); - else - read_char(common, 0, bit, NULL, 0); -#else - if (type == OP_NCLASS) - read_char(common, 0, 255, backtracks, READ_CHAR_UPDATE_STR_PTR); - else - read_char(common, 0, 255, NULL, 0); -#endif + add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO)); + jump[0] = JUMP(SLJIT_JUMP); + JUMPHERE(jump[1]); - if (optimize_class(common, (const sljit_u8 *)cc, type == OP_NCLASS, FALSE, backtracks)) - return cc + 32 / sizeof(PCRE2_UCHAR); + if (!common->alt_circumflex) + add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 - jump[0] = NULL; - if (common->utf) + if (common->nltype == NLTYPE_FIXED && common->newline > 255) { - jump[0] = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, bit); - if (type == OP_CLASS) - { - add_jump(compiler, backtracks, jump[0]); - jump[0] = NULL; - } + OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2)); + add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP1, 0, TMP2, 0)); + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); + OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff)); + add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); } -#elif PCRE2_CODE_UNIT_WIDTH != 8 - jump[0] = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255); - if (type == OP_CLASS) + else { - add_jump(compiler, backtracks, jump[0]); - jump[0] = NULL; + peek_char_back(common, common->nlmax, backtracks); + check_newlinechar(common, common->nltype, backtracks, FALSE); } -#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 */ - - OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7); - OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3); - OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc); - OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0); - OP2U(SLJIT_AND | SLJIT_SET_Z, TMP1, 0, TMP2, 0); - add_jump(compiler, backtracks, JUMP(SLJIT_ZERO)); - -#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8 - if (jump[0] != NULL) - JUMPHERE(jump[0]); -#endif - return cc + 32 / sizeof(PCRE2_UCHAR); - -#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 - case OP_XCLASS: - if (check_str_ptr) - detect_partial_match(common, backtracks); - compile_xclass_matchingpath(common, cc + LINK_SIZE, backtracks); - return cc + GET(cc, 0) - 1; -#endif + JUMPHERE(jump[0]); + return cc; } SLJIT_UNREACHABLE(); return cc; } -static SLJIT_INLINE PCRE2_SPTR compile_charn_matchingpath(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, jump_list **backtracks) -{ -/* This function consumes at least one input character. */ -/* To decrease the number of length checks, we try to concatenate the fixed length character sequences. */ -DEFINE_COMPILER; -PCRE2_SPTR ccbegin = cc; -compare_context context; -int size; - -context.length = 0; -do - { - if (cc >= ccend) - break; - - if (*cc == OP_CHAR) - { - size = 1; -#ifdef SUPPORT_UNICODE - if (common->utf && HAS_EXTRALEN(cc[1])) - size += GET_EXTRALEN(cc[1]); -#endif - } - else if (*cc == OP_CHARI) - { - size = 1; -#ifdef SUPPORT_UNICODE - if (common->utf) - { - if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0) - size = 0; - else if (HAS_EXTRALEN(cc[1])) - size += GET_EXTRALEN(cc[1]); - } - else -#endif - if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0) - size = 0; - } - else - size = 0; - - cc += 1 + size; - context.length += IN_UCHARS(size); - } -while (size > 0 && context.length <= 128); - -cc = ccbegin; -if (context.length > 0) - { - /* We have a fixed-length byte sequence. */ - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, context.length); - add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0)); - - context.sourcereg = -1; -#if defined SLJIT_UNALIGNED && SLJIT_UNALIGNED - context.ucharptr = 0; -#endif - do cc = byte_sequence_compare(common, *cc == OP_CHARI, cc + 1, &context, backtracks); while (context.length > 0); - return cc; - } - -/* A non-fixed length character will be checked if length == 0. */ -return compile_char1_matchingpath(common, *cc, cc + 1, backtracks, TRUE); -} - /* Forward definitions. */ static void compile_matchingpath(compiler_common *, PCRE2_SPTR, PCRE2_SPTR, backtrack_common *); static void compile_backtrackingpath(compiler_common *, struct backtrack_common *); @@ -9470,10 +8187,16 @@ struct sljit_jump *nopartial; #if defined SUPPORT_UNICODE struct sljit_label *loop; struct sljit_label *caseless_loop; +struct sljit_jump *turkish_ascii_i = NULL; +struct sljit_jump *turkish_non_ascii_i = NULL; jump_list *no_match = NULL; int source_reg = COUNT_MATCH; int source_end_reg = ARGUMENTS; int char1_reg = STACK_LIMIT; +PCRE2_UCHAR refi_flag = 0; + +if (*cc == OP_REFI || *cc == OP_DNREFI) + refi_flag = cc[PRIV(OP_lengths)[*cc] - 1]; #endif /* SUPPORT_UNICODE */ if (ref) @@ -9488,9 +8211,10 @@ else OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), 0); #if defined SUPPORT_UNICODE -if (common->utf && *cc == OP_REFI) +if ((common->utf || common->ucp) && (*cc == OP_REFI || *cc == OP_DNREFI)) { - SLJIT_ASSERT(common->iref_ptr != 0); + /* Update ref_update_local_size() when this changes. */ + SLJIT_ASSERT(common->locals_size >= 3 * SSIZE_OF(sw)); if (ref) OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1)); @@ -9500,9 +8224,9 @@ if (common->utf && *cc == OP_REFI) if (withchecks && emptyfail) add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, TMP2, 0)); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr, source_reg, 0); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw), source_end_reg, 0); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2, char1_reg, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCAL0, source_reg, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCAL1, source_end_reg, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCAL2, char1_reg, 0); OP1(SLJIT_MOV, source_reg, 0, TMP1, 0); OP1(SLJIT_MOV, source_end_reg, 0, TMP2, 0); @@ -9526,6 +8250,16 @@ if (common->utf && *cc == OP_REFI) CMPTO(SLJIT_EQUAL, TMP1, 0, char1_reg, 0, loop); + if ((refi_flag & (REFI_FLAG_TURKISH_CASING|REFI_FLAG_CASELESS_RESTRICT)) == + REFI_FLAG_TURKISH_CASING) + { + OP2(SLJIT_OR, SLJIT_TMP_DEST_REG, 0, char1_reg, 0, SLJIT_IMM, 0x20); + turkish_ascii_i = CMP(SLJIT_EQUAL, SLJIT_TMP_DEST_REG, 0, SLJIT_IMM, 0x69); + + OP2(SLJIT_OR, SLJIT_TMP_DEST_REG, 0, char1_reg, 0, SLJIT_IMM, 0x1); + turkish_non_ascii_i = CMP(SLJIT_EQUAL, SLJIT_TMP_DEST_REG, 0, SLJIT_IMM, 0x131); + } + OP1(SLJIT_MOV, TMP3, 0, TMP1, 0); add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); @@ -9545,6 +8279,9 @@ if (common->utf && *cc == OP_REFI) OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 2); OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_caseless_sets)); + if (refi_flag & REFI_FLAG_CASELESS_RESTRICT) + add_jump(compiler, &no_match, CMP(SLJIT_LESS | SLJIT_32, SLJIT_MEM1(TMP2), 0, SLJIT_IMM, 128)); + caseless_loop = LABEL(); OP1(SLJIT_MOV_U32, TMP1, 0, SLJIT_MEM1(TMP2), 0); OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, sizeof(uint32_t)); @@ -9552,30 +8289,52 @@ if (common->utf && *cc == OP_REFI) JUMPTO(SLJIT_EQUAL, loop); JUMPTO(SLJIT_LESS, caseless_loop); + if ((refi_flag & (REFI_FLAG_TURKISH_CASING|REFI_FLAG_CASELESS_RESTRICT)) == + REFI_FLAG_TURKISH_CASING) + { + add_jump(compiler, &no_match, JUMP(SLJIT_JUMP)); + JUMPHERE(turkish_ascii_i); + + OP2(SLJIT_LSHR, char1_reg, 0, char1_reg, 0, SLJIT_IMM, 5); + OP2(SLJIT_AND, char1_reg, 0, char1_reg, 0, SLJIT_IMM, 1); + OP2(SLJIT_XOR, char1_reg, 0, char1_reg, 0, SLJIT_IMM, 1); + OP2(SLJIT_ADD, char1_reg, 0, char1_reg, 0, SLJIT_IMM, 0x130); + CMPTO(SLJIT_EQUAL, TMP1, 0, char1_reg, 0, loop); + + add_jump(compiler, &no_match, JUMP(SLJIT_JUMP)); + JUMPHERE(turkish_non_ascii_i); + + OP2(SLJIT_AND, char1_reg, 0, char1_reg, 0, SLJIT_IMM, 1); + OP2(SLJIT_XOR, char1_reg, 0, char1_reg, 0, SLJIT_IMM, 1); + OP2(SLJIT_SHL, char1_reg, 0, char1_reg, 0, SLJIT_IMM, 5); + OP2(SLJIT_ADD, char1_reg, 0, char1_reg, 0, SLJIT_IMM, 0x49); + CMPTO(SLJIT_EQUAL, TMP1, 0, char1_reg, 0, loop); + } + set_jumps(no_match, LABEL()); if (common->mode == PCRE2_JIT_COMPLETE) JUMPHERE(partial); - OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr); - OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw)); - OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2); + OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCAL0); + OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCAL1); + OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCAL2); add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); if (common->mode != PCRE2_JIT_COMPLETE) { JUMPHERE(partial); - OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr); - OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw)); - OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2); + OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCAL0); + OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCAL1); + OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCAL2); check_partial(common, FALSE); add_jump(compiler, backtracks, JUMP(SLJIT_JUMP)); } JUMPHERE(jump); - OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr); - OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw)); - OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2); + OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCAL0); + OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCAL1); + OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCAL2); return; } else @@ -9594,7 +8353,7 @@ else if (common->mode == PCRE2_JIT_COMPLETE) add_jump(compiler, backtracks, partial); - add_jump(compiler, *cc == OP_REF ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CALL)); + add_jump(compiler, (*cc == OP_REF || *cc == OP_DNREF) ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CALL)); add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0)); if (common->mode != PCRE2_JIT_COMPLETE) @@ -9606,7 +8365,7 @@ else OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, STR_END, 0); partial = CMP(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, 0); OP1(SLJIT_MOV, STR_PTR, 0, STR_END, 0); - add_jump(compiler, *cc == OP_REF ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CALL)); + add_jump(compiler, (*cc == OP_REF || *cc == OP_DNREF) ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CALL)); add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0)); JUMPHERE(partial); check_partial(common, FALSE); @@ -9630,13 +8389,15 @@ DEFINE_COMPILER; BOOL ref = (*cc == OP_REF || *cc == OP_REFI); backtrack_common *backtrack; PCRE2_UCHAR type; +int local_start = LOCAL2; int offset = 0; struct sljit_label *label; struct sljit_jump *zerolength; struct sljit_jump *jump = NULL; +jump_list *match_failed = NULL; PCRE2_SPTR ccbegin = cc; int min = 0, max = 0; -BOOL minimize; +BOOL minimize, exact; PUSH_BACKTRACK(sizeof(ref_iterator_backtrack), cc, NULL); @@ -9644,34 +8405,65 @@ if (ref) offset = GET2(cc, 1) << 1; else cc += IMM2_SIZE; + +if (*ccbegin == OP_REFI || *ccbegin == OP_DNREFI) + { + cc += 1; +#ifdef SUPPORT_UNICODE + if (common->utf || common->ucp) + local_start = LOCAL3; +#endif + } + type = cc[1 + IMM2_SIZE]; SLJIT_COMPILE_ASSERT((OP_CRSTAR & 0x1) == 0, crstar_opcode_must_be_even); -minimize = (type & 0x1) != 0; +/* Update ref_update_local_size() when this changes. */ +SLJIT_ASSERT(local_start + 2 * SSIZE_OF(sw) <= (int)LOCAL0 + common->locals_size); +minimize = FALSE; +exact = FALSE; switch(type) { - case OP_CRSTAR: case OP_CRMINSTAR: + minimize = TRUE; + PCRE2_FALLTHROUGH /* Fall through */ + case OP_CRSTAR: + case OP_CRPOSSTAR: min = 0; max = 0; cc += 1 + IMM2_SIZE + 1; break; - case OP_CRPLUS: + case OP_CRMINPLUS: + minimize = TRUE; + PCRE2_FALLTHROUGH /* Fall through */ + case OP_CRPLUS: + case OP_CRPOSPLUS: min = 1; max = 0; cc += 1 + IMM2_SIZE + 1; break; - case OP_CRQUERY: + case OP_CRMINQUERY: + minimize = TRUE; + PCRE2_FALLTHROUGH /* Fall through */ + case OP_CRQUERY: + case OP_CRPOSQUERY: min = 0; max = 1; cc += 1 + IMM2_SIZE + 1; break; - case OP_CRRANGE: + case OP_CRMINRANGE: + minimize = TRUE; + PCRE2_FALLTHROUGH /* Fall through */ + case OP_CRRANGE: + case OP_CRPOSRANGE: min = GET2(cc, 1 + IMM2_SIZE + 1); max = GET2(cc, 1 + IMM2_SIZE + 1 + IMM2_SIZE); + SLJIT_ASSERT(min > 1 || max > 1); + if (min == max) + exact = TRUE; cc += 1 + IMM2_SIZE + 1 + 2 * IMM2_SIZE; break; default: @@ -9679,6 +8471,86 @@ switch(type) break; } +if (type >= OP_CRPOSSTAR || exact) + { + BACKTRACK_AS(ref_iterator_backtrack)->possessive_or_exact = TRUE; + if (ref) + { + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset)); + if (min > 0 && !common->unset_backref) + add_jump(compiler, &backtrack->own_backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(1))); + zerolength = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1)); + } + else + { + compile_dnref_search(common, ccbegin, min > 0 ? &backtrack->own_backtracks : NULL); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), local_start + SSIZE_OF(sw), TMP2, 0); + zerolength = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_MEM1(TMP2), sizeof(sljit_sw)); + } + + if (exact) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), local_start, SLJIT_IMM, min); + else if (type != OP_CRPOSSTAR) + { + /* STR_PTR is NULL before reaching min. */ + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), local_start, min > 0 ? SLJIT_IMM : STR_PTR, 0); + if (type == OP_CRPOSRANGE) + { + SLJIT_ASSERT(local_start + 3 * SSIZE_OF(sw) <= (int)LOCAL0 + common->locals_size); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), local_start + 2 * SSIZE_OF(sw), SLJIT_IMM, 0); + } + } + + label = LABEL(); + if (!ref) + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), local_start + SSIZE_OF(sw)); + + if (type == OP_CRPOSSTAR) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), local_start, STR_PTR, 0); + + compile_ref_matchingpath(common, ccbegin, exact ? &backtrack->own_backtracks : &match_failed, FALSE, FALSE); + + if (type == OP_CRPOSSTAR) + JUMPTO(SLJIT_JUMP, label); + else if (type == OP_CRPOSPLUS || type == OP_CRPOSQUERY) + { + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), local_start, STR_PTR, 0); + if (type == OP_CRPOSPLUS) + JUMPTO(SLJIT_JUMP, label); + } + else if (exact) + { + OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_MEM1(SLJIT_SP), local_start, SLJIT_MEM1(SLJIT_SP), local_start, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + } + else + { + OP2(SLJIT_ADD, TMP1, 0, SLJIT_MEM1(SLJIT_SP), local_start + 2 * SSIZE_OF(sw), SLJIT_IMM, 1); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), local_start + 2 * SSIZE_OF(sw), TMP1, 0); + if (min > 0) + CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, min, label); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), local_start, STR_PTR, 0); + if (max == 0) + JUMPTO(SLJIT_JUMP, label); + else + CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, max, label); + } + + if (!exact) + { + set_jumps(match_failed, LABEL()); + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), local_start); + + if (type != OP_CRPOSSTAR) + add_jump(compiler, &backtrack->own_backtracks, CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0)); + } + + JUMPHERE(zerolength); + count_match(common); + return cc; + } + if (!minimize) { if (min == 0) @@ -9690,6 +8562,7 @@ if (!minimize) OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, 0); /* Temporary release of STR_PTR. */ OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw)); + /* Handles both invalid and empty cases. Since the minimum repeat, is zero the invalid case is basically the same as an empty case. */ if (ref) @@ -9698,9 +8571,10 @@ if (!minimize) { compile_dnref_search(common, ccbegin, NULL); OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), 0); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, TMP2, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), local_start + SSIZE_OF(sw), TMP2, 0); zerolength = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_MEM1(TMP2), sizeof(sljit_sw)); } + /* Restore if not zero length. */ OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, sizeof(sljit_sw)); } @@ -9709,6 +8583,7 @@ if (!minimize) allocate_stack(common, 1); if (ref) OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset)); + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), SLJIT_IMM, 0); if (ref) @@ -9721,26 +8596,26 @@ if (!minimize) { compile_dnref_search(common, ccbegin, &backtrack->own_backtracks); OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), 0); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, TMP2, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), local_start + SSIZE_OF(sw), TMP2, 0); zerolength = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_MEM1(TMP2), sizeof(sljit_sw)); } } if (min > 1 || max > 1) - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE0, SLJIT_IMM, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), local_start, SLJIT_IMM, 0); label = LABEL(); if (!ref) - OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), local_start + SSIZE_OF(sw)); compile_ref_matchingpath(common, ccbegin, &backtrack->own_backtracks, FALSE, FALSE); if (min > 1 || max > 1) { - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), POSSESSIVE0); - OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE0, TMP1, 0); + OP2(SLJIT_ADD, TMP1, 0, SLJIT_MEM1(SLJIT_SP), local_start, SLJIT_IMM, 1); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), local_start, TMP1, 0); if (min > 1) CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, min, label); + if (max > 1) { jump = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, max); @@ -9840,11 +8715,18 @@ DEFINE_COMPILER; backtrack_common *backtrack; recurse_entry *entry = common->entries; recurse_entry *prev = NULL; +PCRE2_SPTR end; sljit_sw start = GET(cc, 1); +sljit_uw arg_size; PCRE2_SPTR start_cc; BOOL needs_control_head; -PUSH_BACKTRACK(sizeof(recurse_backtrack), cc, NULL); +end = cc + 1 + LINK_SIZE; + +while (*end == OP_CREF) + end += 1 + IMM2_SIZE; + +PUSH_BACKTRACK(sizeof(recurse_backtrack), cc, end); /* Inlining simple patterns. */ if (get_framesize(common, common->start + start, NULL, TRUE, &needs_control_head) == no_stack) @@ -9852,12 +8734,15 @@ if (get_framesize(common, common->start + start, NULL, TRUE, &needs_control_head start_cc = common->start + start; compile_matchingpath(common, next_opcode(common, start_cc), bracketend(start_cc) - (1 + LINK_SIZE), backtrack); BACKTRACK_AS(recurse_backtrack)->inlined_pattern = TRUE; - return cc + 1 + LINK_SIZE; + return end; } +cc += 1 + LINK_SIZE; +arg_size = (sljit_uw)IN_UCHARS(end - cc); while (entry != NULL) { - if (entry->start == start) + if (entry->start == start && entry->arg_size == arg_size + && (arg_size == 0 || memcmp(cc, entry->arg_start, arg_size) == 0)) break; prev = entry; entry = entry->next; @@ -9867,13 +8752,15 @@ if (entry == NULL) { entry = sljit_alloc_memory(compiler, sizeof(recurse_entry)); if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) - return NULL; + return end; entry->next = NULL; entry->entry_label = NULL; entry->backtrack_label = NULL; entry->entry_calls = NULL; entry->backtrack_calls = NULL; entry->start = start; + entry->arg_start = cc; + entry->arg_size = arg_size; if (prev != NULL) prev->next = entry; @@ -9890,7 +8777,7 @@ else /* Leave if the match is failed. */ add_jump(compiler, &backtrack->own_backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0)); BACKTRACK_AS(recurse_backtrack)->matchingpath = LABEL(); -return cc + 1 + LINK_SIZE; +return end; } static sljit_s32 SLJIT_FUNC do_callout_jit(struct jit_arguments *arguments, pcre2_callout_block *callout_block, PCRE2_SPTR *jit_ovector) @@ -9960,7 +8847,7 @@ unsigned int callout_length = (*cc == OP_CALLOUT) sljit_sw value1; sljit_sw value2; sljit_sw value3; -sljit_uw callout_arg_size = (common->re->top_bracket + 1) * 2 * SSIZE_OF(sw); +sljit_s32 callout_arg_size = (common->re->top_bracket + 1) * 2 * SSIZE_OF(sw); /* top_bracket is uint16 so maximum is 1MiB */ PUSH_BACKTRACK(sizeof(backtrack_common), cc, NULL); @@ -10006,12 +8893,13 @@ OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(mark), (common->mark_pt SLJIT_ASSERT(TMP1 == SLJIT_R0 && STR_PTR == SLJIT_R1); /* Needed to save important temporary registers. */ -OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, STR_PTR, 0); +SLJIT_ASSERT(common->locals_size >= SSIZE_OF(sw)); +OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCAL0, STR_PTR, 0); /* SLJIT_R0 = arguments */ OP1(SLJIT_MOV, SLJIT_R1, 0, STACK_TOP, 0); GET_LOCAL_BASE(SLJIT_R2, 0, OVECTOR_START); sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS3(32, W, W, W), SLJIT_IMM, SLJIT_FUNC_ADDR(do_callout_jit)); -OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); +OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCAL0); free_stack(common, callout_arg_size); /* Check return value. */ @@ -10052,7 +8940,7 @@ if (*cc == OP_REVERSE) else { SLJIT_ASSERT(*cc == OP_VREVERSE); - PUSH_BACKTRACK(sizeof(vreverse_backtrack), cc, NULL); + PUSH_BACKTRACK(sizeof(vreverse_backtrack), cc, cc + 1 + 2 * IMM2_SIZE); reverse_failed = &backtrack->own_backtracks; lmin = GET2(cc, 1); @@ -10179,6 +9067,7 @@ jump_list **found; /* Saving previous accept variables. */ BOOL save_local_quit_available = common->local_quit_available; BOOL save_in_positive_assertion = common->in_positive_assertion; +sljit_s32 save_restore_end_ptr = common->restore_end_ptr; then_trap_backtrack *save_then_trap = common->then_trap; struct sljit_label *save_quit_label = common->quit_label; struct sljit_label *save_accept_label = common->accept_label; @@ -10286,6 +9175,7 @@ if (conditional || (opcode == OP_ASSERT_NOT || opcode == OP_ASSERTBACK_NOT)) { /* Control verbs cannot escape from these asserts. */ local_quit_available = TRUE; + common->restore_end_ptr = 0; common->local_quit_available = TRUE; common->quit_label = NULL; common->quit = NULL; @@ -10321,6 +9211,7 @@ while (1) common->quit = save_quit; } common->in_positive_assertion = save_in_positive_assertion; + common->restore_end_ptr = save_restore_end_ptr; common->then_trap = save_then_trap; common->accept_label = save_accept_label; common->positive_assertion_quit = save_positive_assertion_quit; @@ -10418,6 +9309,7 @@ while (1) common->quit = save_quit; } common->in_positive_assertion = save_in_positive_assertion; + common->restore_end_ptr = save_restore_end_ptr; common->then_trap = save_then_trap; common->accept_label = save_accept_label; common->positive_assertion_quit = save_positive_assertion_quit; @@ -10557,7 +9449,8 @@ if (opcode == OP_ASSERT || opcode == OP_ASSERTBACK) { JUMPTO(SLJIT_JUMP, backtrack->matchingpath); JUMPHERE(brajump); - if (framesize >= 0) + SLJIT_ASSERT(framesize != 0); + if (framesize > 0) { OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); @@ -10622,7 +9515,9 @@ if (local_quit_available) common->quit_label = save_quit_label; common->quit = save_quit; } + common->in_positive_assertion = save_in_positive_assertion; +common->restore_end_ptr = save_restore_end_ptr; common->then_trap = save_then_trap; common->accept_label = save_accept_label; common->positive_assertion_quit = save_positive_assertion_quit; @@ -10689,7 +9584,7 @@ if (common->capture_last_ptr != 0) OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(stacksize), TMP1, 0); stacksize++; } -if (common->optimized_cbracket[offset >> 1] == 0) +if (!is_optimized_cbracket(common, offset >> 1)) { OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset)); OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1)); @@ -10813,6 +9708,7 @@ BOOL needs_control_head = FALSE; BOOL has_vreverse = FALSE; struct sljit_jump *jump; struct sljit_jump *skip; +jump_list *jumplist; struct sljit_label *rmax_label = NULL; struct sljit_jump *braminzero = NULL; @@ -10862,7 +9758,7 @@ if (opcode == OP_CBRA || opcode == OP_SCBRA) { /* Capturing brackets has a pre-allocated space. */ offset = GET2(ccbegin, 1 + LINK_SIZE); - if (common->optimized_cbracket[offset] == 0) + if (!is_optimized_cbracket(common, offset)) { private_data_ptr = OVECTOR_PRIV(offset); offset <<= 1; @@ -10875,7 +9771,8 @@ if (opcode == OP_CBRA || opcode == OP_SCBRA) BACKTRACK_AS(bracket_backtrack)->private_data_ptr = private_data_ptr; matchingpath += IMM2_SIZE; } -else if (opcode == OP_ASSERT_NA || opcode == OP_ASSERTBACK_NA || opcode == OP_ONCE || opcode == OP_SCRIPT_RUN || opcode == OP_SBRA || opcode == OP_SCOND) +else if (opcode == OP_ASSERT_NA || opcode == OP_ASSERTBACK_NA || opcode == OP_ONCE + || opcode == OP_ASSERT_SCS || opcode == OP_SCRIPT_RUN || opcode == OP_SBRA || opcode == OP_SCOND) { /* Other brackets simply allocate the next entry. */ private_data_ptr = PRIVATE_DATA(ccbegin); @@ -11042,7 +9939,7 @@ if (opcode == OP_ONCE) else if (opcode == OP_CBRA || opcode == OP_SCBRA) { /* Saving the previous values. */ - if (common->optimized_cbracket[offset >> 1] != 0) + if (is_optimized_cbracket(common, offset >> 1)) { SLJIT_ASSERT(private_data_ptr == OVECTOR(offset)); allocate_stack(common, 2); @@ -11086,6 +9983,88 @@ else if (opcode == OP_ASSERT_NA || opcode == OP_ASSERTBACK_NA || opcode == OP_SC if (*matchingpath == OP_REVERSE) matchingpath = compile_reverse_matchingpath(common, matchingpath, backtrack); } +else if (opcode == OP_ASSERT_SCS) + { + /* Nested scs blocks will not update this variable. */ + if (common->restore_end_ptr == 0) + common->restore_end_ptr = private_data_ptr + sizeof(sljit_sw); + + if (*matchingpath == OP_CREF && (matchingpath[1 + IMM2_SIZE] != OP_CREF && matchingpath[1 + IMM2_SIZE] != OP_DNCREF)) + { + /* Optimized case for a single capture reference. */ + i = OVECTOR(GET2(matchingpath, 1) << 1); + + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), i); + + add_jump(compiler, &(BACKTRACK_AS(bracket_backtrack)->u.no_capture), CMP(SLJIT_EQUAL, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(1))); + matchingpath += 1 + IMM2_SIZE; + + allocate_stack(common, has_alternatives ? 3 : 2); + + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); + OP1(SLJIT_MOV, SLJIT_TMP_DEST_REG, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr + sizeof(sljit_sw)); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr + sizeof(sljit_sw), STR_END, 0); + OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), i + sizeof(sljit_sw)); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, STR_PTR, 0); + OP1(SLJIT_MOV, STR_PTR, 0, TMP2, 0); + } + else + { + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(1)); + jumplist = NULL; + + while (TRUE) + { + if (*matchingpath == OP_CREF) + { + sljit_get_local_base(compiler, TMP2, 0, OVECTOR(GET2(matchingpath, 1) << 1)); + matchingpath += 1 + IMM2_SIZE; + } + else + { + SLJIT_ASSERT(*matchingpath == OP_DNCREF); + + i = GET2(matchingpath, 1 + IMM2_SIZE); + slot = common->name_table + GET2(matchingpath, 1) * common->name_entry_size; + + while (i-- > 1) + { + sljit_get_local_base(compiler, TMP2, 0, OVECTOR(GET2(slot, 0) << 1)); + add_jump(compiler, &jumplist, CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(TMP2), 0, TMP1, 0)); + slot += common->name_entry_size; + } + + sljit_get_local_base(compiler, TMP2, 0, OVECTOR(GET2(slot, 0) << 1)); + matchingpath += 1 + 2 * IMM2_SIZE; + } + + if (*matchingpath != OP_CREF && *matchingpath != OP_DNCREF) + break; + + add_jump(compiler, &jumplist, CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(TMP2), 0, TMP1, 0)); + } + + add_jump(compiler, &(BACKTRACK_AS(bracket_backtrack)->u.no_capture), + CMP(SLJIT_EQUAL, SLJIT_MEM1(TMP2), 0, TMP1, 0)); + + set_jumps(jumplist, LABEL()); + + allocate_stack(common, has_alternatives ? 3 : 2); + + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); + OP1(SLJIT_MOV, SLJIT_TMP_DEST_REG, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr + sizeof(sljit_sw)); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, STR_PTR, 0); + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(TMP2), 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr + sizeof(sljit_sw), STR_END, 0); + OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(TMP2), sizeof(sljit_sw)); + } + + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), TMP1, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_TMP_DEST_REG, 0); + + if (has_alternatives) + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(2), STR_PTR, 0); + } else if (has_alternatives) { /* Pushing the starting string pointer. */ @@ -11099,7 +10078,7 @@ if (opcode == OP_COND || opcode == OP_SCOND) if (*matchingpath == OP_CREF) { SLJIT_ASSERT(has_alternatives); - add_jump(compiler, &(BACKTRACK_AS(bracket_backtrack)->u.condfailed), + add_jump(compiler, &(BACKTRACK_AS(bracket_backtrack)->u.no_capture), CMP(SLJIT_EQUAL, SLJIT_MEM1(SLJIT_SP), OVECTOR(GET2(matchingpath, 1) << 1), SLJIT_MEM1(SLJIT_SP), OVECTOR(1))); matchingpath += 1 + IMM2_SIZE; } @@ -11121,13 +10100,13 @@ if (opcode == OP_COND || opcode == OP_SCOND) slot += common->name_entry_size; } OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0); - add_jump(compiler, &(BACKTRACK_AS(bracket_backtrack)->u.condfailed), JUMP(SLJIT_ZERO)); + add_jump(compiler, &(BACKTRACK_AS(bracket_backtrack)->u.no_capture), JUMP(SLJIT_ZERO)); matchingpath += 1 + 2 * IMM2_SIZE; } else if ((*matchingpath >= OP_RREF && *matchingpath <= OP_TRUE) || *matchingpath == OP_FAIL) { /* Never has other case. */ - BACKTRACK_AS(bracket_backtrack)->u.condfailed = NULL; + BACKTRACK_AS(bracket_backtrack)->u.no_capture = NULL; SLJIT_ASSERT(!has_alternatives); if (*matchingpath == OP_TRUE) @@ -11197,6 +10176,8 @@ if (opcode == OP_COND || opcode == OP_SCOND) assert->common.cc = matchingpath; BACKTRACK_AS(bracket_backtrack)->u.assert = assert; matchingpath = compile_assert_matchingpath(common, matchingpath, assert, TRUE); + if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) + return NULL; } } @@ -11216,9 +10197,6 @@ switch (opcode) if (PRIVATE_DATA(ccbegin + 1)) OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr + sizeof(sljit_sw)); break; - case OP_ASSERT_NA: - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); - break; case OP_ONCE: match_once_common(common, ket, BACKTRACK_AS(bracket_backtrack)->u.framesize, private_data_ptr, has_alternatives, needs_control_head); break; @@ -11240,7 +10218,7 @@ if (offset != 0) { if (common->capture_last_ptr != 0) stacksize++; - if (common->optimized_cbracket[offset >> 1] == 0) + if (!is_optimized_cbracket(common, offset >> 1)) stacksize += 2; } if (has_alternatives && opcode != OP_ONCE) @@ -11284,18 +10262,34 @@ if (has_alternatives) if (i <= 3) OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(stacksize), SLJIT_IMM, 0); else - BACKTRACK_AS(bracket_backtrack)->u.matching_mov_addr = sljit_emit_mov_addr(compiler, SLJIT_MEM1(STACK_TOP), STACK(stacksize)); + BACKTRACK_AS(bracket_backtrack)->matching_mov_addr = sljit_emit_op_addr(compiler, SLJIT_MOV_ADDR, SLJIT_MEM1(STACK_TOP), STACK(stacksize)); } if (ket != OP_KETRMAX) BACKTRACK_AS(bracket_backtrack)->alternative_matchingpath = LABEL(); } /* Must be after the matchingpath label. */ -if (offset != 0 && common->optimized_cbracket[offset >> 1] != 0) +if (offset != 0 && is_optimized_cbracket(common, offset >> 1)) { SLJIT_ASSERT(private_data_ptr == OVECTOR(offset + 0)); OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1), STR_PTR, 0); } +else switch (opcode) + { + case OP_ASSERT_NA: + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); + break; + case OP_ASSERT_SCS: + OP1(SLJIT_MOV, TMP1, 0, STR_END, 0); + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); + OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr + sizeof(sljit_sw)); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr + sizeof(sljit_sw), TMP1, 0); + + /* Nested scs blocks will not update this variable. */ + if (common->restore_end_ptr == private_data_ptr + SSIZE_OF(sw)) + common->restore_end_ptr = 0; + break; + } if (ket == OP_KETRMAX) { @@ -11359,13 +10353,19 @@ if (bra == OP_BRAMINZERO) /* We need to release the end pointer to perform the backtrack for the zero-length iteration. When framesize is < 0, OP_ONCE will do the release itself. */ - if (opcode == OP_ONCE && BACKTRACK_AS(bracket_backtrack)->u.framesize >= 0) + if (opcode == OP_ONCE) { - OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); - add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); - OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (BACKTRACK_AS(bracket_backtrack)->u.framesize - 1) * sizeof(sljit_sw)); + int framesize = BACKTRACK_AS(bracket_backtrack)->u.framesize; + + SLJIT_ASSERT(framesize != 0); + if (framesize > 0) + { + OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); + add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); + OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (framesize - 1) * sizeof(sljit_sw)); + } } - else if (ket == OP_KETRMIN && opcode != OP_ONCE) + else if (ket == OP_KETRMIN) free_stack(common, 1); } /* Continue to the normal backtrack. */ @@ -11431,7 +10431,7 @@ switch(opcode) offset = GET2(cc, 1 + LINK_SIZE); /* This case cannot be optimized in the same way as normal capturing brackets. */ - SLJIT_ASSERT(common->optimized_cbracket[offset] == 0); + SLJIT_ASSERT(!is_optimized_cbracket(common, offset)); cbraprivptr = OVECTOR_PRIV(offset); offset <<= 1; ccbegin = cc + 1 + LINK_SIZE + IMM2_SIZE; @@ -11613,12 +10613,7 @@ while (*cc != OP_KETRPOS) add_jump(compiler, &emptymatch, CMP(SLJIT_EQUAL, TMP1, 0, STR_PTR, 0)); if (!zero) - { - if (framesize < 0) - OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(stacksize - 1), SLJIT_IMM, 0); - else - OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), SLJIT_IMM, 0); - } + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), SLJIT_IMM, 0); } JUMPTO(SLJIT_JUMP, loop); @@ -11712,11 +10707,11 @@ else if (*opcode >= OP_TYPESTAR && *opcode <= OP_TYPEPOSUPTO) } else { - SLJIT_ASSERT(*opcode == OP_CLASS || *opcode == OP_NCLASS || *opcode == OP_XCLASS); + SLJIT_ASSERT(*opcode == OP_CLASS || *opcode == OP_NCLASS || *opcode == OP_XCLASS || *opcode == OP_ECLASS); *type = *opcode; + class_len = (*type < OP_XCLASS) ? (int)(1 + (32 / sizeof(PCRE2_UCHAR))) : GET(cc, 1); + *opcode = cc[class_len]; cc++; - class_len = (*type < OP_XCLASS) ? (int)(1 + (32 / sizeof(PCRE2_UCHAR))) : GET(cc, 0); - *opcode = cc[class_len - 1]; if (*opcode >= OP_CRSTAR && *opcode <= OP_CRMINQUERY) { @@ -11728,8 +10723,10 @@ else *exact = 1; *opcode -= OP_PLUS - OP_STAR; } + return cc; } - else if (*opcode >= OP_CRPOSSTAR && *opcode <= OP_CRPOSQUERY) + + if (*opcode >= OP_CRPOSSTAR && *opcode <= OP_CRPOSQUERY) { *opcode -= OP_CRPOSSTAR - OP_POSSTAR; *end = cc + class_len; @@ -11739,41 +10736,40 @@ else *exact = 1; *opcode = OP_POSSTAR; } + return cc; } - else + + SLJIT_ASSERT(*opcode == OP_CRRANGE || *opcode == OP_CRMINRANGE || *opcode == OP_CRPOSRANGE); + *max = GET2(cc, (class_len + IMM2_SIZE)); + *exact = GET2(cc, class_len); + *end = cc + class_len + 2 * IMM2_SIZE; + + if (*max == 0) { - SLJIT_ASSERT(*opcode == OP_CRRANGE || *opcode == OP_CRMINRANGE || *opcode == OP_CRPOSRANGE); - *max = GET2(cc, (class_len + IMM2_SIZE)); - *exact = GET2(cc, class_len); + SLJIT_ASSERT(*exact > 1); + if (*opcode == OP_CRRANGE) + *opcode = OP_UPTO; + else if (*opcode == OP_CRPOSRANGE) + *opcode = OP_POSUPTO; + else + *opcode = OP_MINSTAR; + return cc; + } - if (*max == 0) - { - if (*opcode == OP_CRPOSRANGE) - *opcode = OP_POSSTAR; - else - *opcode -= OP_CRRANGE - OP_STAR; - } + *max -= *exact; + if (*max == 0) + *opcode = OP_EXACT; + else + { + SLJIT_ASSERT(*exact > 0 || *max > 1); + if (*opcode == OP_CRRANGE) + *opcode = OP_UPTO; + else if (*opcode == OP_CRPOSRANGE) + *opcode = OP_POSUPTO; + else if (*max == 1) + *opcode = OP_MINQUERY; else - { - *max -= *exact; - if (*max == 0) - *opcode = OP_EXACT; - else if (*max == 1) - { - if (*opcode == OP_CRPOSRANGE) - *opcode = OP_POSQUERY; - else - *opcode -= OP_CRRANGE - OP_QUERY; - } - else - { - if (*opcode == OP_CRPOSRANGE) - *opcode = OP_POSUPTO; - else - *opcode -= OP_CRRANGE - OP_UPTO; - } - } - *end = cc + class_len + 2 * IMM2_SIZE; + *opcode = OP_MINUPTO; } return cc; } @@ -11819,16 +10815,17 @@ if (common->utf && HAS_EXTRALEN(*cc)) *end += GET_EXTRALEN(*cc); return cc; } -static PCRE2_SPTR compile_iterator_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_common *parent) +static PCRE2_SPTR compile_iterator_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_common *parent, jump_list **prev_backtracks) { DEFINE_COMPILER; -backtrack_common *backtrack; +backtrack_common *backtrack = NULL; +PCRE2_SPTR begin = cc; PCRE2_UCHAR opcode; PCRE2_UCHAR type; sljit_u32 max = 0, exact; sljit_s32 early_fail_ptr = PRIVATE_DATA(cc + 1); sljit_s32 early_fail_type; -BOOL charpos_enabled; +BOOL charpos_enabled, use_tmp; PCRE2_UCHAR charpos_char; unsigned int charpos_othercasebit; PCRE2_SPTR end; @@ -11841,11 +10838,6 @@ int base = (private_data_ptr == 0) ? SLJIT_MEM1(STACK_TOP) : SLJIT_MEM1(SLJIT_SP int offset0 = (private_data_ptr == 0) ? STACK(0) : private_data_ptr; int offset1 = (private_data_ptr == 0) ? STACK(1) : private_data_ptr + SSIZE_OF(sw); int tmp_base, tmp_offset; -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 -BOOL use_tmp; -#endif - -PUSH_BACKTRACK(sizeof(char_iterator_backtrack), cc, NULL); early_fail_type = (early_fail_ptr & 0x7); early_fail_ptr >>= 3; @@ -11861,7 +10853,7 @@ SLJIT_ASSERT(common->fast_forward_bc_ptr != NULL || early_fail_ptr == 0 || (early_fail_ptr >= common->early_fail_start_ptr && early_fail_ptr <= common->early_fail_end_ptr)); if (early_fail_type == type_fail) - add_jump(compiler, &backtrack->own_backtracks, CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr)); + add_jump(compiler, prev_backtracks, CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr)); cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &exact, &end); @@ -11873,39 +10865,47 @@ if (type != OP_EXTUNI) else { tmp_base = SLJIT_MEM1(SLJIT_SP); - tmp_offset = POSSESSIVE0; + tmp_offset = LOCAL2; } -/* Handle fixed part first. */ -if (exact > 1) +if (opcode == OP_EXACT) { - SLJIT_ASSERT(early_fail_ptr == 0); + SLJIT_ASSERT(early_fail_ptr == 0 && exact >= 2); if (common->mode == PCRE2_JIT_COMPLETE -#ifdef SUPPORT_UNICODE +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 && !common->utf #endif && type != OP_ANYNL && type != OP_EXTUNI) { - OP2(SLJIT_ADD, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(exact)); - add_jump(compiler, &backtrack->own_backtracks, CMP(SLJIT_GREATER, TMP1, 0, STR_END, 0)); - OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, exact); - label = LABEL(); - compile_char1_matchingpath(common, type, cc, &backtrack->own_backtracks, FALSE); - OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); - JUMPTO(SLJIT_NOT_ZERO, label); + OP2(SLJIT_SUB, TMP1, 0, STR_END, 0, STR_PTR, 0); + add_jump(compiler, prev_backtracks, CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, IN_UCHARS(exact))); + +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 32 + if (type == OP_ALLANY && !common->invalid_utf) +#else + if (type == OP_ALLANY) +#endif + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(exact)); + else + { + OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, exact); + label = LABEL(); + compile_char1_matchingpath(common, type, cc, prev_backtracks, FALSE); + OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + } } else { + SLJIT_ASSERT(tmp_base == TMP3 || common->locals_size >= 3 * SSIZE_OF(sw)); OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, exact); label = LABEL(); - compile_char1_matchingpath(common, type, cc, &backtrack->own_backtracks, TRUE); + compile_char1_matchingpath(common, type, cc, prev_backtracks, TRUE); OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); JUMPTO(SLJIT_NOT_ZERO, label); } } -else if (exact == 1) - compile_char1_matchingpath(common, type, cc, &backtrack->own_backtracks, TRUE); if (early_fail_type == type_fail_range) { @@ -11914,38 +10914,57 @@ if (early_fail_type == type_fail_range) OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + SSIZE_OF(sw)); OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, TMP2, 0); OP2(SLJIT_SUB, TMP2, 0, STR_PTR, 0, TMP2, 0); - add_jump(compiler, &backtrack->own_backtracks, CMP(SLJIT_LESS_EQUAL, TMP2, 0, TMP1, 0)); + add_jump(compiler, prev_backtracks, CMP(SLJIT_LESS_EQUAL, TMP2, 0, TMP1, 0)); OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + SSIZE_OF(sw), STR_PTR, 0); } +if (opcode < OP_EXACT) + PUSH_BACKTRACK(sizeof(char_iterator_backtrack), begin, NULL); + switch(opcode) { case OP_STAR: case OP_UPTO: - SLJIT_ASSERT(early_fail_ptr == 0 || opcode == OP_STAR); + SLJIT_ASSERT(backtrack != NULL && (early_fail_ptr == 0 || opcode == OP_STAR)); + max += exact; - if (type == OP_ANYNL || type == OP_EXTUNI) + if (type == OP_EXTUNI) { SLJIT_ASSERT(private_data_ptr == 0); SLJIT_ASSERT(early_fail_ptr == 0); - allocate_stack(common, 2); - OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0); - OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, 0); + if (exact == 1) + { + SLJIT_ASSERT(opcode == OP_STAR); + allocate_stack(common, 1); + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), SLJIT_IMM, 0); + } + else + { + /* If OP_EXTUNI is present, it has a separate EXACT opcode. */ + SLJIT_ASSERT(exact == 0); + + allocate_stack(common, 2); + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, 0); + } if (opcode == OP_UPTO) - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE0, SLJIT_IMM, max); + { + SLJIT_ASSERT(common->locals_size >= 3 * SSIZE_OF(sw)); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCAL2, SLJIT_IMM, max); + } label = LABEL(); - compile_char1_matchingpath(common, type, cc, &BACKTRACK_AS(char_iterator_backtrack)->u.backtracks, TRUE); + compile_char1_matchingpath(common, type, cc, &backtrack->own_backtracks, TRUE); if (opcode == OP_UPTO) { - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), POSSESSIVE0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCAL2); OP2(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); jump = JUMP(SLJIT_ZERO); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE0, TMP1, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCAL2, TMP1, 0); } /* We cannot use TMP3 because of allocate_stack. */ @@ -11965,6 +10984,9 @@ switch(opcode) { if (opcode == OP_STAR) { + if (exact == 1) + detect_partial_match(common, prev_backtracks); + if (private_data_ptr == 0) allocate_stack(common, 2); @@ -11985,6 +11007,9 @@ switch(opcode) else #endif { + /* If OP_ALLANY is present, it has a separate EXACT opcode. */ + SLJIT_ASSERT(exact == 0); + if (private_data_ptr == 0) allocate_stack(common, 2); @@ -11993,228 +11018,373 @@ switch(opcode) if (common->mode == PCRE2_JIT_COMPLETE) { - OP2U(SLJIT_SUB | SLJIT_SET_GREATER, STR_PTR, 0, STR_END, 0); - SELECT(SLJIT_GREATER, STR_PTR, STR_END, 0, STR_PTR); + OP2U(SLJIT_SUB | SLJIT_SET_GREATER, STR_PTR, 0, STR_END, 0); + SELECT(SLJIT_GREATER, STR_PTR, STR_END, 0, STR_PTR); + } + else + { + jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, STR_END, 0); + process_partial_match(common); + JUMPHERE(jump); + } + + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + + if (early_fail_ptr != 0) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); + BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL(); + break; + } + } + + charpos_enabled = FALSE; + charpos_char = 0; + charpos_othercasebit = 0; + + SLJIT_ASSERT(tmp_base == TMP3); + if ((type != OP_CHAR && type != OP_CHARI) && (*end == OP_CHAR || *end == OP_CHARI)) + { +#ifdef SUPPORT_UNICODE + charpos_enabled = !common->utf || !HAS_EXTRALEN(end[1]); +#else + charpos_enabled = TRUE; +#endif + if (charpos_enabled && *end == OP_CHARI && char_has_othercase(common, end + 1)) + { + charpos_othercasebit = char_get_othercase_bit(common, end + 1); + if (charpos_othercasebit == 0) + charpos_enabled = FALSE; + } + + if (charpos_enabled) + { + charpos_char = end[1]; + /* Consume the OP_CHAR opcode. */ + end += 2; +#if PCRE2_CODE_UNIT_WIDTH == 8 + SLJIT_ASSERT((charpos_othercasebit >> 8) == 0); +#elif PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 + SLJIT_ASSERT((charpos_othercasebit >> 9) == 0); + if ((charpos_othercasebit & 0x100) != 0) + charpos_othercasebit = (charpos_othercasebit & 0xff) << 8; +#endif + if (charpos_othercasebit != 0) + charpos_char |= charpos_othercasebit; + + BACKTRACK_AS(char_iterator_backtrack)->charpos.charpos_enabled = TRUE; + BACKTRACK_AS(char_iterator_backtrack)->charpos.chr = charpos_char; + BACKTRACK_AS(char_iterator_backtrack)->charpos.othercasebit = charpos_othercasebit; + + if (private_data_ptr == 0) + allocate_stack(common, 2); + + use_tmp = (opcode == OP_STAR); + + if (use_tmp) + { + OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, 0); + OP1(SLJIT_MOV, base, offset0, TMP3, 0); + } + else + { + OP1(SLJIT_MOV, base, offset1, COUNT_MATCH, 0); + OP1(SLJIT_MOV, COUNT_MATCH, 0, SLJIT_IMM, 0); + OP1(SLJIT_MOV, base, offset0, COUNT_MATCH, 0); + OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, exact == max ? 0 : (max + 1)); + } + + /* Search the first instance of charpos_char. */ + if (exact > 0) + detect_partial_match(common, &no_match); + else + jump = JUMP(SLJIT_JUMP); + + label = LABEL(); + + if (opcode == OP_UPTO) + { + if (exact == max) + OP2(SLJIT_ADD, TMP3, 0, TMP3, 0, SLJIT_IMM, 1); + else + { + OP2(SLJIT_SUB | SLJIT_SET_Z, TMP3, 0, TMP3, 0, SLJIT_IMM, 1); + add_jump(compiler, &no_match, JUMP(SLJIT_ZERO)); + } + } + + compile_char1_matchingpath(common, type, cc, &no_match, FALSE); + + if (early_fail_ptr != 0) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); + + if (exact == 0) + JUMPHERE(jump); + + detect_partial_match(common, &no_match); + + if (opcode == OP_UPTO && exact > 0) + { + if (exact == max) + CMPTO(SLJIT_LESS, TMP3, 0, SLJIT_IMM, exact, label); + else + CMPTO(SLJIT_GREATER, TMP3, 0, SLJIT_IMM, (max + 1) - exact, label); + } + + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); + if (charpos_othercasebit != 0) + OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, charpos_othercasebit); + CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, charpos_char, label); + + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + if (use_tmp) + { + OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP3, 0, SLJIT_IMM, 0); + SELECT(SLJIT_EQUAL, TMP3, STR_PTR, 0, TMP3); + } + else + { + OP2U(SLJIT_SUB | SLJIT_SET_Z, COUNT_MATCH, 0, SLJIT_IMM, 0); + SELECT(SLJIT_EQUAL, COUNT_MATCH, STR_PTR, 0, COUNT_MATCH); } + JUMPTO(SLJIT_JUMP, label); + + set_jumps(no_match, LABEL()); + OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); + if (use_tmp) + OP1(SLJIT_MOV, base, offset1, TMP3, 0); else { - jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, STR_END, 0); - process_partial_match(common); - JUMPHERE(jump); + OP1(SLJIT_MOV, TMP1, 0, base, offset1); + OP1(SLJIT_MOV, base, offset1, COUNT_MATCH, 0); + OP1(SLJIT_MOV, COUNT_MATCH, 0, TMP1, 0); } - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + add_jump(compiler, &backtrack->own_backtracks, CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0)); - if (early_fail_ptr != 0) - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL(); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); break; } } - charpos_enabled = FALSE; - charpos_char = 0; - charpos_othercasebit = 0; + if (private_data_ptr == 0) + allocate_stack(common, 2); - if ((type != OP_CHAR && type != OP_CHARI) && (*end == OP_CHAR || *end == OP_CHARI)) +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 + use_tmp = (opcode == OP_STAR); + + if (common->utf) { -#ifdef SUPPORT_UNICODE - charpos_enabled = !common->utf || !HAS_EXTRALEN(end[1]); -#else - charpos_enabled = TRUE; -#endif - if (charpos_enabled && *end == OP_CHARI && char_has_othercase(common, end + 1)) - { - charpos_othercasebit = char_get_othercase_bit(common, end + 1); - if (charpos_othercasebit == 0) - charpos_enabled = FALSE; - } + if (!use_tmp) + OP1(SLJIT_MOV, base, offset0, COUNT_MATCH, 0); - if (charpos_enabled) - { - charpos_char = end[1]; - /* Consume the OP_CHAR opcode. */ - end += 2; -#if PCRE2_CODE_UNIT_WIDTH == 8 - SLJIT_ASSERT((charpos_othercasebit >> 8) == 0); -#elif PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 - SLJIT_ASSERT((charpos_othercasebit >> 9) == 0); - if ((charpos_othercasebit & 0x100) != 0) - charpos_othercasebit = (charpos_othercasebit & 0xff) << 8; + OP1(SLJIT_MOV, use_tmp ? TMP3 : COUNT_MATCH, 0, STR_PTR, 0); + } #endif - if (charpos_othercasebit != 0) - charpos_char |= charpos_othercasebit; - BACKTRACK_AS(char_iterator_backtrack)->u.charpos.enabled = TRUE; - BACKTRACK_AS(char_iterator_backtrack)->u.charpos.chr = charpos_char; - BACKTRACK_AS(char_iterator_backtrack)->u.charpos.othercasebit = charpos_othercasebit; - } - } + if (opcode == OP_UPTO) + OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, exact == max ? -(sljit_sw)exact : (sljit_sw)max); - if (charpos_enabled) + if (opcode == OP_UPTO && exact > 0) { - if (opcode == OP_UPTO) - OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max + 1); - - /* Search the first instance of charpos_char. */ - jump = JUMP(SLJIT_JUMP); - label = LABEL(); - if (opcode == OP_UPTO) - { - OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); - add_jump(compiler, &backtrack->own_backtracks, JUMP(SLJIT_ZERO)); - } - compile_char1_matchingpath(common, type, cc, &backtrack->own_backtracks, FALSE); - if (early_fail_ptr != 0) - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); - JUMPHERE(jump); - - detect_partial_match(common, &backtrack->own_backtracks); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); - if (charpos_othercasebit != 0) - OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, charpos_othercasebit); - CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, charpos_char, label); - - if (private_data_ptr == 0) - allocate_stack(common, 2); - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - OP1(SLJIT_MOV, base, offset1, STR_PTR, 0); - - if (opcode == OP_UPTO) - { - OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); - add_jump(compiler, &no_match, JUMP(SLJIT_ZERO)); - } - - /* Search the last instance of charpos_char. */ label = LABEL(); - compile_char1_matchingpath(common, type, cc, &no_match, FALSE); - if (early_fail_ptr != 0) - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); detect_partial_match(common, &no_match); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); - if (charpos_othercasebit != 0) - OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, charpos_othercasebit); + compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 + if (common->utf) + OP1(SLJIT_MOV, use_tmp ? TMP3 : COUNT_MATCH, 0, STR_PTR, 0); +#endif - if (opcode == OP_STAR) + if (exact == max) { - CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, charpos_char, label); - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - JUMPTO(SLJIT_JUMP, label); + OP2(SLJIT_ADD | SLJIT_SET_Z, TMP3, 0, TMP3, 0, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); } else { - jump = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, charpos_char); - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - JUMPHERE(jump); - OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); - JUMPTO(SLJIT_NOT_ZERO, label); + OP2(SLJIT_SUB | SLJIT_SET_Z, TMP3, 0, TMP3, 0, SLJIT_IMM, 1); + add_jump(compiler, &no_match, JUMP(SLJIT_ZERO)); + CMPTO(SLJIT_NOT_EQUAL, TMP3, 0, SLJIT_IMM, max - exact, label); } - set_jumps(no_match, LABEL()); - OP2(SLJIT_ADD, STR_PTR, 0, base, offset0, SLJIT_IMM, IN_UCHARS(1)); - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + OP1(SLJIT_MOV, base, offset1, STR_PTR, 0); + JUMPTO(SLJIT_JUMP, label); } else { - if (private_data_ptr == 0) - allocate_stack(common, 2); - OP1(SLJIT_MOV, base, offset1, STR_PTR, 0); -#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 - use_tmp = (!HAS_VIRTUAL_REGISTERS && opcode == OP_STAR); - SLJIT_ASSERT(!use_tmp || tmp_base == TMP3); - - if (common->utf) - OP1(SLJIT_MOV, use_tmp ? TMP3 : base, use_tmp ? 0 : offset0, STR_PTR, 0); -#endif - if (opcode == OP_UPTO) - OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max); detect_partial_match(common, &no_match); label = LABEL(); compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 if (common->utf) - OP1(SLJIT_MOV, use_tmp ? TMP3 : base, use_tmp ? 0 : offset0, STR_PTR, 0); + OP1(SLJIT_MOV, use_tmp ? TMP3 : COUNT_MATCH, 0, STR_PTR, 0); #endif if (opcode == OP_UPTO) { - OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); + OP2(SLJIT_SUB | SLJIT_SET_Z, TMP3, 0, TMP3, 0, SLJIT_IMM, 1); add_jump(compiler, &no_match, JUMP(SLJIT_ZERO)); } detect_partial_match_to(common, label); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + } - set_jumps(no_char1_match, LABEL()); #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 - if (common->utf) + if (common->utf) + { + set_jumps(no_char1_match, LABEL()); + set_jumps(no_match, LABEL()); + if (use_tmp) { - set_jumps(no_match, LABEL()); - if (use_tmp) - { - OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0); - OP1(SLJIT_MOV, base, offset0, TMP3, 0); - } - else - OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); + OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0); + OP1(SLJIT_MOV, base, offset0, TMP3, 0); } else -#endif { - OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); - set_jumps(no_match, LABEL()); + OP1(SLJIT_MOV, STR_PTR, 0, COUNT_MATCH, 0); + OP1(SLJIT_MOV, COUNT_MATCH, 0, base, offset0); OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); } + } + else +#endif + { + if (opcode != OP_UPTO || exact == 0) + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + set_jumps(no_char1_match, LABEL()); - if (early_fail_ptr != 0) - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + set_jumps(no_match, LABEL()); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + } + + if (opcode == OP_UPTO) + { + if (exact > 0) + { + if (max == exact) + jump = CMP(SLJIT_GREATER_EQUAL, TMP3, 0, SLJIT_IMM, -(sljit_sw)exact); + else + jump = CMP(SLJIT_GREATER, TMP3, 0, SLJIT_IMM, max - exact); + + add_jump(compiler, &backtrack->own_backtracks, jump); + } } + else if (exact == 1) + add_jump(compiler, &backtrack->own_backtracks, CMP(SLJIT_EQUAL, base, offset1, STR_PTR, 0)); + + if (early_fail_ptr != 0) + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL(); break; - case OP_MINSTAR: + case OP_QUERY: + SLJIT_ASSERT(backtrack != NULL && early_fail_ptr == 0); if (private_data_ptr == 0) allocate_stack(common, 1); OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + compile_char1_matchingpath(common, type, cc, &backtrack->own_backtracks, TRUE); BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL(); + break; + + case OP_MINSTAR: + case OP_MINQUERY: + SLJIT_ASSERT(backtrack != NULL && (opcode == OP_MINSTAR || early_fail_ptr == 0)); + if (private_data_ptr == 0) + allocate_stack(common, 1); + + if (exact >= 1) + { + if (exact >= 2) + { + /* Extuni has a separate exact opcode. */ + SLJIT_ASSERT(tmp_base == TMP3 && early_fail_ptr == 0); + OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, exact); + } + + if (opcode == OP_MINQUERY) + OP1(SLJIT_MOV, base, offset0, SLJIT_IMM, -1); + + label = LABEL(); + BACKTRACK_AS(char_iterator_backtrack)->matchingpath = label; + + compile_char1_matchingpath(common, type, cc, &backtrack->own_backtracks, TRUE); + + if (exact >= 2) + { + OP2(SLJIT_SUB | SLJIT_SET_Z, TMP3, 0, TMP3, 0, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + } + + if (opcode == OP_MINQUERY) + OP2(SLJIT_AND, base, offset0, base, offset0, STR_PTR, 0); + else + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + } + else + { + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL(); + } + if (early_fail_ptr != 0) OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); break; case OP_MINUPTO: - SLJIT_ASSERT(early_fail_ptr == 0); + SLJIT_ASSERT(backtrack != NULL && early_fail_ptr == 0); if (private_data_ptr == 0) allocate_stack(common, 2); - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + OP1(SLJIT_MOV, base, offset1, SLJIT_IMM, max + 1); - BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL(); - break; - case OP_QUERY: - case OP_MINQUERY: - SLJIT_ASSERT(early_fail_ptr == 0); - if (private_data_ptr == 0) - allocate_stack(common, 1); + if (exact == 0) + { + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL(); + break; + } + + if (exact >= 2) + { + /* Extuni has a separate exact opcode. */ + SLJIT_ASSERT(tmp_base == TMP3); + OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, exact); + } + + label = LABEL(); + BACKTRACK_AS(char_iterator_backtrack)->matchingpath = label; + + compile_char1_matchingpath(common, type, cc, &backtrack->own_backtracks, TRUE); + + if (exact >= 2) + { + OP2(SLJIT_SUB | SLJIT_SET_Z, TMP3, 0, TMP3, 0, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + } + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - if (opcode == OP_QUERY) - compile_char1_matchingpath(common, type, cc, &BACKTRACK_AS(char_iterator_backtrack)->u.backtracks, TRUE); - BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL(); break; case OP_EXACT: + SLJIT_ASSERT(backtrack == NULL); break; case OP_POSSTAR: + SLJIT_ASSERT(backtrack == NULL); #if defined SUPPORT_UNICODE if (type == OP_ALLANY && !common->invalid_utf) #else if (type == OP_ALLANY) #endif { + if (exact == 1) + detect_partial_match(common, prev_backtracks); + OP1(SLJIT_MOV, STR_PTR, 0, STR_END, 0); process_partial_match(common); if (early_fail_ptr != 0) @@ -12223,98 +11393,150 @@ switch(opcode) } #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 - if (type == OP_EXTUNI || common->utf) + if (common->utf) { - OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); + SLJIT_ASSERT(tmp_base == TMP3 || common->locals_size >= 3 * SSIZE_OF(sw)); + + if (tmp_base != TMP3) + { + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCAL2, COUNT_MATCH, 0); + tmp_base = COUNT_MATCH; + } + + OP1(SLJIT_MOV, tmp_base, 0, exact == 1 ? SLJIT_IMM : STR_PTR, 0); detect_partial_match(common, &no_match); label = LABEL(); compile_char1_matchingpath(common, type, cc, &no_match, FALSE); - OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); + OP1(SLJIT_MOV, tmp_base, 0, STR_PTR, 0); detect_partial_match_to(common, label); set_jumps(no_match, LABEL()); - OP1(SLJIT_MOV, STR_PTR, 0, tmp_base, tmp_offset); + OP1(SLJIT_MOV, STR_PTR, 0, tmp_base, 0); + + if (tmp_base != TMP3) + OP1(SLJIT_MOV, COUNT_MATCH, 0, SLJIT_MEM1(SLJIT_SP), LOCAL2); + + if (exact == 1) + add_jump(compiler, prev_backtracks, CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0)); + if (early_fail_ptr != 0) - { - if (!HAS_VIRTUAL_REGISTERS && tmp_base == TMP3) - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, TMP3, 0); - else - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); - } + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); break; } #endif + if (exact == 1) + OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); + detect_partial_match(common, &no_match); label = LABEL(); + /* Extuni never fails, so no_char1_match is not used in that case. + Anynl optionally reads an extra character on success. */ compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); detect_partial_match_to(common, label); - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + if (type != OP_EXTUNI) + OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); set_jumps(no_char1_match, LABEL()); - OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + if (type != OP_EXTUNI) + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); + set_jumps(no_match, LABEL()); + + if (exact == 1) + add_jump(compiler, prev_backtracks, CMP(SLJIT_EQUAL, tmp_base, tmp_offset, STR_PTR, 0)); + if (early_fail_ptr != 0) OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); break; case OP_POSUPTO: - SLJIT_ASSERT(early_fail_ptr == 0); + SLJIT_ASSERT(backtrack == NULL && early_fail_ptr == 0); + max += exact; + #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 - if (common->utf) + if (type == OP_EXTUNI || common->utf) +#else + if (type == OP_EXTUNI) +#endif { - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, STR_PTR, 0); - OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max); - - detect_partial_match(common, &no_match); - label = LABEL(); - compile_char1_matchingpath(common, type, cc, &no_match, FALSE); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, STR_PTR, 0); - OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); - add_jump(compiler, &no_match, JUMP(SLJIT_ZERO)); - detect_partial_match_to(common, label); + SLJIT_ASSERT(common->locals_size >= 3 * SSIZE_OF(sw)); - set_jumps(no_match, LABEL()); - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1); - break; - } -#endif + /* Count match is not modified by compile_char1_matchingpath. */ + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCAL2, COUNT_MATCH, 0); + OP1(SLJIT_MOV, COUNT_MATCH, 0, SLJIT_IMM, exact == max ? 0 : max); - if (type == OP_ALLANY) - { - OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(max)); + label = LABEL(); + /* Extuni only modifies TMP3 on successful match. */ + OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0); + compile_char1_matchingpath(common, type, cc, &no_match, TRUE); - if (common->mode == PCRE2_JIT_COMPLETE) + if (exact == max) { - OP2U(SLJIT_SUB | SLJIT_SET_GREATER, STR_PTR, 0, STR_END, 0); - SELECT(SLJIT_GREATER, STR_PTR, STR_END, 0, STR_PTR); + OP2(SLJIT_ADD, COUNT_MATCH, 0, COUNT_MATCH, 0, SLJIT_IMM, 1); + JUMPTO(SLJIT_JUMP, label); } else { - jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, STR_END, 0); - process_partial_match(common); - JUMPHERE(jump); + OP2(SLJIT_SUB | SLJIT_SET_Z, COUNT_MATCH, 0, COUNT_MATCH, 0, SLJIT_IMM, 1); + JUMPTO(SLJIT_NOT_ZERO, label); + OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0); + } + + set_jumps(no_match, LABEL()); + + if (exact > 0) + { + if (exact == max) + OP2U(SLJIT_SUB | SLJIT_SET_LESS, COUNT_MATCH, 0, SLJIT_IMM, exact); + else + OP2U(SLJIT_SUB | SLJIT_SET_GREATER, COUNT_MATCH, 0, SLJIT_IMM, max - exact); } + + OP1(SLJIT_MOV, COUNT_MATCH, 0, SLJIT_MEM1(SLJIT_SP), LOCAL2); + + if (exact > 0) + add_jump(compiler, prev_backtracks, JUMP(exact == max ? SLJIT_LESS : SLJIT_GREATER)); + OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0); break; } - OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max); + SLJIT_ASSERT(tmp_base == TMP3); + + OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, exact == max ? 0 : max); detect_partial_match(common, &no_match); label = LABEL(); compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); - OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1); - add_jump(compiler, &no_match, JUMP(SLJIT_ZERO)); + + if (exact == max) + OP2(SLJIT_ADD, TMP3, 0, TMP3, 0, SLJIT_IMM, 1); + else + { + OP2(SLJIT_SUB | SLJIT_SET_Z, TMP3, 0, TMP3, 0, SLJIT_IMM, 1); + add_jump(compiler, &no_match, JUMP(SLJIT_ZERO)); + } detect_partial_match_to(common, label); OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); set_jumps(no_char1_match, LABEL()); OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); set_jumps(no_match, LABEL()); + + if (exact > 0) + { + if (exact == max) + jump = CMP(SLJIT_LESS, TMP3, 0, SLJIT_IMM, exact); + else + jump = CMP(SLJIT_GREATER, TMP3, 0, SLJIT_IMM, max - exact); + + add_jump(compiler, prev_backtracks, jump); + } break; case OP_POSQUERY: - SLJIT_ASSERT(early_fail_ptr == 0); + SLJIT_ASSERT(backtrack == NULL && early_fail_ptr == 0); + SLJIT_ASSERT(tmp_base == TMP3 || common->locals_size >= 3 * SSIZE_OF(sw)); OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); compile_char1_matchingpath(common, type, cc, &no_match, TRUE); OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0); @@ -12391,7 +11613,7 @@ static SLJIT_INLINE PCRE2_SPTR compile_close_matchingpath(compiler_common *commo { DEFINE_COMPILER; int offset = GET2(cc, 1); -BOOL optimized_cbracket = common->optimized_cbracket[offset] != 0; +BOOL optimized_cbracket = is_optimized_cbracket(common, offset); /* Data will be discarded anyway... */ if (common->currententry != NULL) @@ -12477,6 +11699,7 @@ DEFINE_COMPILER; backtrack_common *backtrack; BOOL has_then_trap = FALSE; then_trap_backtrack *save_then_trap = NULL; +size_t op_len; SLJIT_ASSERT(*ccend == OP_END || (*ccend >= OP_ALT && *ccend <= OP_KETRPOS)); @@ -12612,21 +11835,23 @@ while (cc < ccend) case OP_TYPEPOSPLUS: case OP_TYPEPOSQUERY: case OP_TYPEPOSUPTO: - cc = compile_iterator_matchingpath(common, cc, parent); + cc = compile_iterator_matchingpath(common, cc, parent, parent->top != NULL ? &parent->top->simple_backtracks : &parent->own_backtracks); break; case OP_CLASS: case OP_NCLASS: if (cc[1 + (32 / sizeof(PCRE2_UCHAR))] >= OP_CRSTAR && cc[1 + (32 / sizeof(PCRE2_UCHAR))] <= OP_CRPOSRANGE) - cc = compile_iterator_matchingpath(common, cc, parent); + cc = compile_iterator_matchingpath(common, cc, parent, parent->top != NULL ? &parent->top->simple_backtracks : &parent->own_backtracks); else cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->simple_backtracks : &parent->own_backtracks, TRUE); break; #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 case OP_XCLASS: - if (*(cc + GET(cc, 1)) >= OP_CRSTAR && *(cc + GET(cc, 1)) <= OP_CRPOSRANGE) - cc = compile_iterator_matchingpath(common, cc, parent); + case OP_ECLASS: + op_len = GET(cc, 1); + if (cc[op_len] >= OP_CRSTAR && cc[op_len] <= OP_CRPOSRANGE) + cc = compile_iterator_matchingpath(common, cc, parent, parent->top != NULL ? &parent->top->simple_backtracks : &parent->own_backtracks); else cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->simple_backtracks : &parent->own_backtracks, TRUE); break; @@ -12634,24 +11859,26 @@ while (cc < ccend) case OP_REF: case OP_REFI: - if (cc[1 + IMM2_SIZE] >= OP_CRSTAR && cc[1 + IMM2_SIZE] <= OP_CRPOSRANGE) + op_len = PRIV(OP_lengths)[*cc]; + if (cc[op_len] >= OP_CRSTAR && cc[op_len] <= OP_CRPOSRANGE) cc = compile_ref_iterator_matchingpath(common, cc, parent); else { compile_ref_matchingpath(common, cc, parent->top != NULL ? &parent->top->simple_backtracks : &parent->own_backtracks, TRUE, FALSE); - cc += 1 + IMM2_SIZE; + cc += op_len; } break; case OP_DNREF: case OP_DNREFI: - if (cc[1 + 2 * IMM2_SIZE] >= OP_CRSTAR && cc[1 + 2 * IMM2_SIZE] <= OP_CRPOSRANGE) + op_len = PRIV(OP_lengths)[*cc]; + if (cc[op_len] >= OP_CRSTAR && cc[op_len] <= OP_CRPOSRANGE) cc = compile_ref_iterator_matchingpath(common, cc, parent); else { compile_dnref_search(common, cc, parent->top != NULL ? &parent->top->simple_backtracks : &parent->own_backtracks); compile_ref_matchingpath(common, cc, parent->top != NULL ? &parent->top->simple_backtracks : &parent->own_backtracks, TRUE, FALSE); - cc += 1 + 2 * IMM2_SIZE; + cc += op_len; } break; @@ -12692,6 +11919,7 @@ while (cc < ccend) case OP_ASSERT_NA: case OP_ASSERTBACK_NA: + case OP_ASSERT_SCS: case OP_ONCE: case OP_SCRIPT_RUN: case OP_BRA: @@ -12803,6 +12031,28 @@ SLJIT_ASSERT(cc == ccend); #define CURRENT_AS(type) ((type *)current) +static void compile_newline_move_back(compiler_common *common) +{ +DEFINE_COMPILER; +struct sljit_jump *jump; + +OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); +jump = CMP(SLJIT_LESS_EQUAL, TMP1, 0, TMP2, 0); +/* All newlines are single byte, or their last byte +is not equal to CHAR_NL/CHAR_CR even if UTF is enabled. */ +OP1(MOV_UCHAR, SLJIT_TMP_DEST_REG, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2)); +OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); +OP2(SLJIT_SHL, SLJIT_TMP_DEST_REG, 0, SLJIT_TMP_DEST_REG, 0, SLJIT_IMM, 8); +OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_TMP_DEST_REG, 0); +OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, CHAR_CR << 8 | CHAR_NL); +OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL); +#if PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32 +OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT); +#endif +OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP1, 0); +JUMPHERE(jump); +} + static void compile_iterator_backtrackingpath(compiler_common *common, struct backtrack_common *current) { DEFINE_COMPILER; @@ -12825,52 +12075,104 @@ switch(opcode) { case OP_STAR: case OP_UPTO: - if (type == OP_ANYNL || type == OP_EXTUNI) + if (type == OP_EXTUNI) { SLJIT_ASSERT(private_data_ptr == 0); - set_jumps(CURRENT_AS(char_iterator_backtrack)->u.backtracks, LABEL()); + set_jumps(current->own_backtracks, LABEL()); OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); free_stack(common, 1); CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0, CURRENT_AS(char_iterator_backtrack)->matchingpath); } else { - if (CURRENT_AS(char_iterator_backtrack)->u.charpos.enabled) + if (CURRENT_AS(char_iterator_backtrack)->charpos.charpos_enabled) { OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); OP1(SLJIT_MOV, TMP2, 0, base, offset1); - OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP2, 0); label = LABEL(); - OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1)); - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - if (CURRENT_AS(char_iterator_backtrack)->u.charpos.othercasebit != 0) - OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, CURRENT_AS(char_iterator_backtrack)->u.charpos.othercasebit); - CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CURRENT_AS(char_iterator_backtrack)->u.charpos.chr, CURRENT_AS(char_iterator_backtrack)->matchingpath); + if (type == OP_ANYNL) + compile_newline_move_back(common); move_back(common, NULL, TRUE); - CMPTO(SLJIT_GREATER, STR_PTR, 0, TMP2, 0, label); + + OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0)); + if (CURRENT_AS(char_iterator_backtrack)->charpos.othercasebit != 0) + OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, CURRENT_AS(char_iterator_backtrack)->charpos.othercasebit); + CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CURRENT_AS(char_iterator_backtrack)->charpos.chr, CURRENT_AS(char_iterator_backtrack)->matchingpath); + /* The range beginning must match, no need to compare. */ + JUMPTO(SLJIT_JUMP, label); + + set_jumps(current->own_backtracks, LABEL()); + current->own_backtracks = NULL; } else { OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); - jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, base, offset1); - move_back(common, NULL, TRUE); + + if (opcode == OP_STAR && exact == 1) + { + if (type == OP_ANYNL) + { + OP1(SLJIT_MOV, TMP2, 0, base, offset1); + compile_newline_move_back(common); + } + + move_back(common, NULL, TRUE); + jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, base, offset1); + } + else + { + if (type == OP_ANYNL) + { + OP1(SLJIT_MOV, TMP2, 0, base, offset1); + jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP2, 0); + compile_newline_move_back(common); + } + else + jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, base, offset1); + + move_back(common, NULL, TRUE); + } + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); + + set_jumps(current->own_backtracks, LABEL()); } + JUMPHERE(jump); if (private_data_ptr == 0) free_stack(common, 2); } break; + case OP_QUERY: + OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); + OP1(SLJIT_MOV, base, offset0, SLJIT_IMM, 0); + CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0, CURRENT_AS(char_iterator_backtrack)->matchingpath); + jump = JUMP(SLJIT_JUMP); + set_jumps(current->own_backtracks, LABEL()); + OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); + OP1(SLJIT_MOV, base, offset0, SLJIT_IMM, 0); + JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); + JUMPHERE(jump); + if (private_data_ptr == 0) + free_stack(common, 1); + break; + case OP_MINSTAR: OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); - compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + if (exact == 0) + { + compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + } + else if (exact > 1) + OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, 1); + JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); - set_jumps(jumplist, LABEL()); + set_jumps(exact > 0 ? current->own_backtracks : jumplist, LABEL()); if (private_data_ptr == 0) free_stack(common, 1); break; @@ -12879,56 +12181,60 @@ switch(opcode) OP1(SLJIT_MOV, TMP1, 0, base, offset1); OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); OP2(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, TMP1, 0, SLJIT_IMM, 1); - add_jump(compiler, &jumplist, JUMP(SLJIT_ZERO)); - OP1(SLJIT_MOV, base, offset1, TMP1, 0); - compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); - OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); - JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); + if (exact == 0) + { + add_jump(compiler, &jumplist, JUMP(SLJIT_ZERO)); - set_jumps(jumplist, LABEL()); - if (private_data_ptr == 0) - free_stack(common, 2); - break; + OP1(SLJIT_MOV, base, offset1, TMP1, 0); + compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); + OP1(SLJIT_MOV, base, offset0, STR_PTR, 0); + JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); + + set_jumps(jumplist, LABEL()); + } + else + { + if (exact > 1) + OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, 1); + OP1(SLJIT_MOV, base, offset1, TMP1, 0); + JUMPTO(SLJIT_NOT_ZERO, CURRENT_AS(char_iterator_backtrack)->matchingpath); + + set_jumps(current->own_backtracks, LABEL()); + } - case OP_QUERY: - OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); - OP1(SLJIT_MOV, base, offset0, SLJIT_IMM, 0); - CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0, CURRENT_AS(char_iterator_backtrack)->matchingpath); - jump = JUMP(SLJIT_JUMP); - set_jumps(CURRENT_AS(char_iterator_backtrack)->u.backtracks, LABEL()); - OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); - OP1(SLJIT_MOV, base, offset0, SLJIT_IMM, 0); - JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); - JUMPHERE(jump); if (private_data_ptr == 0) - free_stack(common, 1); + free_stack(common, 2); break; case OP_MINQUERY: OP1(SLJIT_MOV, STR_PTR, 0, base, offset0); OP1(SLJIT_MOV, base, offset0, SLJIT_IMM, 0); - jump = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0); - compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); - JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); - set_jumps(jumplist, LABEL()); - JUMPHERE(jump); + + if (exact >= 1) + { + if (exact >= 2) + OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, 1); + CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0, CURRENT_AS(char_iterator_backtrack)->matchingpath); + set_jumps(current->own_backtracks, LABEL()); + } + else + { + jump = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0); + compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); + JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath); + set_jumps(jumplist, LABEL()); + JUMPHERE(jump); + } + if (private_data_ptr == 0) free_stack(common, 1); break; - case OP_EXACT: - case OP_POSSTAR: - case OP_POSQUERY: - case OP_POSUPTO: - break; - default: SLJIT_UNREACHABLE(); break; } - -set_jumps(current->own_backtracks, LABEL()); } static SLJIT_INLINE void compile_ref_iterator_backtrackingpath(compiler_common *common, struct backtrack_common *current) @@ -12938,7 +12244,13 @@ PCRE2_SPTR cc = current->cc; BOOL ref = (*cc == OP_REF || *cc == OP_REFI); PCRE2_UCHAR type; -type = cc[ref ? 1 + IMM2_SIZE : 1 + 2 * IMM2_SIZE]; +type = cc[PRIV(OP_lengths)[*cc]]; + +if (CURRENT_AS(ref_iterator_backtrack)->possessive_or_exact) + { + set_jumps(current->own_backtracks, LABEL()); + return; + } if ((type & 0x1) == 0) { @@ -13057,7 +12369,7 @@ PCRE2_SPTR ccbegin; PCRE2_SPTR ccprev; PCRE2_UCHAR bra = OP_BRA; PCRE2_UCHAR ket; -assert_backtrack *assert; +const assert_backtrack *assert; BOOL has_alternatives; BOOL needs_control_head = FALSE; BOOL has_vreverse; @@ -13093,7 +12405,7 @@ ccbegin = cc; cc += GET(cc, 1); has_alternatives = *cc == OP_ALT; if (SLJIT_UNLIKELY(opcode == OP_COND) || SLJIT_UNLIKELY(opcode == OP_SCOND)) - has_alternatives = (ccbegin[1 + LINK_SIZE] >= OP_ASSERT && ccbegin[1 + LINK_SIZE] <= OP_ASSERTBACK_NOT) || CURRENT_AS(bracket_backtrack)->u.condfailed != NULL; + has_alternatives = (ccbegin[1 + LINK_SIZE] >= OP_ASSERT && ccbegin[1 + LINK_SIZE] <= OP_ASSERTBACK_NOT) || CURRENT_AS(bracket_backtrack)->u.no_capture != NULL; if (opcode == OP_CBRA || opcode == OP_SCBRA) offset = (GET2(ccbegin, 1 + LINK_SIZE)) << 1; if (SLJIT_UNLIKELY(opcode == OP_COND) && (*cc == OP_KETRMAX || *cc == OP_KETRMIN)) @@ -13178,7 +12490,7 @@ if (offset != 0) { if (common->capture_last_ptr != 0) { - SLJIT_ASSERT(common->optimized_cbracket[offset >> 1] == 0); + SLJIT_ASSERT(!is_optimized_cbracket(common, offset >> 1)); OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), STACK(1)); OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, TMP1, 0); @@ -13187,7 +12499,7 @@ if (offset != 0) OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset), TMP2, 0); OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1), TMP1, 0); } - else if (common->optimized_cbracket[offset >> 1] == 0) + else if (!is_optimized_cbracket(common, offset >> 1)) { OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), STACK(1)); @@ -13196,14 +12508,29 @@ if (offset != 0) OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1), TMP2, 0); } } +else if (SLJIT_UNLIKELY(opcode == OP_ASSERT_SCS)) + { + OP1(SLJIT_MOV, TMP1, 0, STR_END, 0); + OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr + sizeof(sljit_sw)); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr + sizeof(sljit_sw), TMP1, 0); + + /* Nested scs blocks will not update this variable. */ + if (common->restore_end_ptr == 0) + common->restore_end_ptr = private_data_ptr + sizeof(sljit_sw); + } +else if (SLJIT_UNLIKELY(opcode == OP_ASSERTBACK_NA) && PRIVATE_DATA(ccbegin + 1)) + OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); if (SLJIT_UNLIKELY(opcode == OP_ONCE)) { - if (CURRENT_AS(bracket_backtrack)->u.framesize >= 0) + int framesize = CURRENT_AS(bracket_backtrack)->u.framesize; + + SLJIT_ASSERT(framesize != 0); + if (framesize > 0) { OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); - OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (CURRENT_AS(bracket_backtrack)->u.framesize - 1) * sizeof(sljit_sw)); + OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (framesize - 1) * sizeof(sljit_sw)); } once = JUMP(SLJIT_JUMP); } @@ -13228,8 +12555,8 @@ else if (has_alternatives) { sljit_emit_ijump(compiler, SLJIT_JUMP, TMP1, 0); - SLJIT_ASSERT(CURRENT_AS(bracket_backtrack)->u.matching_mov_addr); - sljit_set_label(CURRENT_AS(bracket_backtrack)->u.matching_mov_addr, LABEL()); + SLJIT_ASSERT(CURRENT_AS(bracket_backtrack)->matching_mov_addr != NULL); + sljit_set_label(CURRENT_AS(bracket_backtrack)->matching_mov_addr, LABEL()); sljit_emit_op0(compiler, SLJIT_ENDBR); } else @@ -13247,7 +12574,8 @@ if (SLJIT_UNLIKELY(opcode == OP_COND) || SLJIT_UNLIKELY(opcode == OP_SCOND)) { SLJIT_ASSERT(has_alternatives); assert = CURRENT_AS(bracket_backtrack)->u.assert; - if (assert->framesize >= 0 && (ccbegin[1 + LINK_SIZE] == OP_ASSERT || ccbegin[1 + LINK_SIZE] == OP_ASSERTBACK)) + SLJIT_ASSERT(assert->framesize != 0); + if (assert->framesize > 0 && (ccbegin[1 + LINK_SIZE] == OP_ASSERT || ccbegin[1 + LINK_SIZE] == OP_ASSERTBACK)) { OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), assert->private_data_ptr); add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); @@ -13258,11 +12586,11 @@ if (SLJIT_UNLIKELY(opcode == OP_COND) || SLJIT_UNLIKELY(opcode == OP_SCOND)) cond = JUMP(SLJIT_JUMP); set_jumps(CURRENT_AS(bracket_backtrack)->u.assert->condfailed, LABEL()); } - else if (CURRENT_AS(bracket_backtrack)->u.condfailed != NULL) + else if (CURRENT_AS(bracket_backtrack)->u.no_capture != NULL) { SLJIT_ASSERT(has_alternatives); cond = JUMP(SLJIT_JUMP); - set_jumps(CURRENT_AS(bracket_backtrack)->u.condfailed, LABEL()); + set_jumps(CURRENT_AS(bracket_backtrack)->u.no_capture, LABEL()); } else SLJIT_ASSERT(!has_alternatives); @@ -13283,26 +12611,33 @@ if (has_alternatives) cc += GET(cc, 1); has_vreverse = FALSE; - if (opcode == OP_ASSERTBACK || opcode == OP_ASSERTBACK_NA) - { - SLJIT_ASSERT(private_data_ptr != 0); - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); - has_vreverse = (*ccprev == OP_VREVERSE); - if (*ccprev == OP_REVERSE || has_vreverse) - ccprev = compile_reverse_matchingpath(common, ccprev, current); - } - else if (opcode != OP_COND && opcode != OP_SCOND) + switch (opcode) { - if (opcode != OP_ONCE) - { + case OP_ASSERTBACK: + case OP_ASSERTBACK_NA: + SLJIT_ASSERT(private_data_ptr != 0); + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); + + has_vreverse = (*ccprev == OP_VREVERSE); + if (*ccprev == OP_REVERSE || has_vreverse) + ccprev = compile_reverse_matchingpath(common, ccprev, current); + break; + case OP_ASSERT_SCS: + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(2)); + break; + case OP_ONCE: + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(needs_control_head ? 1 : 0)); + break; + case OP_COND: + case OP_SCOND: + break; + default: if (private_data_ptr != 0) OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr); else OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); - } - else - OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(needs_control_head ? 1 : 0)); + break; } compile_matchingpath(common, ccprev, cc, current); @@ -13348,7 +12683,7 @@ if (has_alternatives) { if (common->capture_last_ptr != 0) stacksize++; - if (common->optimized_cbracket[offset >> 1] == 0) + if (!is_optimized_cbracket(common, offset >> 1)) stacksize += 2; } if (opcode != OP_ONCE) @@ -13382,10 +12717,10 @@ if (has_alternatives) if (alt_max <= 3) OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(stacksize), SLJIT_IMM, alt_count); else - mov_addr = sljit_emit_mov_addr(compiler, SLJIT_MEM1(STACK_TOP), STACK(stacksize)); + mov_addr = sljit_emit_op_addr(compiler, SLJIT_MOV_ADDR, SLJIT_MEM1(STACK_TOP), STACK(stacksize)); } - if (offset != 0 && ket == OP_KETRMAX && common->optimized_cbracket[offset >> 1] != 0) + if (offset != 0 && ket == OP_KETRMAX && is_optimized_cbracket(common, offset >> 1)) { /* If ket is not OP_KETRMAX, this code path is executed after the jump to alternative_matchingpath. */ SLJIT_ASSERT(private_data_ptr == OVECTOR(offset + 0)); @@ -13423,14 +12758,18 @@ if (has_alternatives) if (cond != NULL) { SLJIT_ASSERT(opcode == OP_COND || opcode == OP_SCOND); - assert = CURRENT_AS(bracket_backtrack)->u.assert; - if ((ccbegin[1 + LINK_SIZE] == OP_ASSERT_NOT || ccbegin[1 + LINK_SIZE] == OP_ASSERTBACK_NOT) && assert->framesize >= 0) + if (ccbegin[1 + LINK_SIZE] == OP_ASSERT_NOT || ccbegin[1 + LINK_SIZE] == OP_ASSERTBACK_NOT) { - OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), assert->private_data_ptr); - add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(-2)); - OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (assert->framesize - 1) * sizeof(sljit_sw)); - OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), assert->private_data_ptr, TMP1, 0); + assert = CURRENT_AS(bracket_backtrack)->u.assert; + SLJIT_ASSERT(assert->framesize != 0); + if (assert->framesize > 0) + { + OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), assert->private_data_ptr); + add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(-2)); + OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (assert->framesize - 1) * sizeof(sljit_sw)); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), assert->private_data_ptr, TMP1, 0); + } } JUMPHERE(cond); } @@ -13443,7 +12782,7 @@ if (has_alternatives) if (offset != 0) { /* Using both tmp register is better for instruction scheduling. */ - if (common->optimized_cbracket[offset >> 1] != 0) + if (is_optimized_cbracket(common, offset >> 1)) { OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), STACK(1)); @@ -13472,6 +12811,21 @@ else if (opcode == OP_ASSERT_NA || opcode == OP_ASSERTBACK_NA || opcode == OP_SC OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_MEM1(STACK_TOP), STACK(0)); free_stack(common, 1); } +else if (opcode == OP_ASSERT_SCS) + { + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), STACK(1)); + OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr + sizeof(sljit_sw)); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, TMP1, 0); + OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr + sizeof(sljit_sw), TMP2, 0); + free_stack(common, has_alternatives ? 3 : 2); + + set_jumps(CURRENT_AS(bracket_backtrack)->u.no_capture, LABEL()); + + /* Nested scs blocks will not update this variable. */ + if (common->restore_end_ptr == private_data_ptr + SSIZE_OF(sw)) + common->restore_end_ptr = 0; + } else if (opcode == OP_ONCE) { cc = ccbegin + GET(ccbegin, 1); @@ -13606,6 +12960,8 @@ if (current->cc[1] > OP_ASSERTBACK_NOT) { /* Manual call of compile_bracket_matchingpath and compile_bracket_backtrackingpath. */ compile_bracket_matchingpath(common, current->cc, current); + if (SLJIT_UNLIKELY(sljit_get_compiler_error(common->compiler))) + return; compile_bracket_backtrackingpath(common, current->top); } else @@ -13615,6 +12971,8 @@ else backtrack.matchingpath = CURRENT_AS(braminzero_backtrack)->matchingpath; /* Manual call of compile_assert_matchingpath. */ compile_assert_matchingpath(common, current->cc, &backtrack, FALSE); + if (SLJIT_UNLIKELY(sljit_get_compiler_error(common->compiler))) + return; } SLJIT_ASSERT(!current->simple_backtracks && !current->own_backtracks); } @@ -13652,6 +13010,9 @@ if (opcode == OP_THEN || opcode == OP_THEN_ARG) } } +if (common->restore_end_ptr != 0 && opcode != OP_SKIP_ARG) + OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->restore_end_ptr); + if (common->local_quit_available) { /* Abort match with a fail. */ @@ -13669,8 +13030,18 @@ if (opcode == OP_SKIP_ARG) OP1(SLJIT_MOV, SLJIT_R1, 0, SLJIT_IMM, (sljit_sw)(current->cc + 2)); sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS2(W, W, W), SLJIT_IMM, SLJIT_FUNC_ADDR(do_search_mark)); + if (common->restore_end_ptr == 0) + { + OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_R0, 0); + add_jump(compiler, &common->reset_match, CMP(SLJIT_NOT_EQUAL, SLJIT_R0, 0, SLJIT_IMM, 0)); + return; + } + + jump = CMP(SLJIT_EQUAL, SLJIT_R0, 0, SLJIT_IMM, 0); OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_R0, 0); - add_jump(compiler, &common->reset_match, CMP(SLJIT_NOT_EQUAL, SLJIT_R0, 0, SLJIT_IMM, 0)); + OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->restore_end_ptr); + add_jump(compiler, &common->reset_match, JUMP(SLJIT_JUMP)); + JUMPHERE(jump); return; } @@ -13702,6 +13073,7 @@ static SLJIT_INLINE void compile_then_trap_backtrackingpath(compiler_common *com { DEFINE_COMPILER; struct sljit_jump *jump; +int framesize; int size; if (CURRENT_AS(then_trap_backtrack)->then_trap) @@ -13718,11 +13090,15 @@ free_stack(common, size); jump = JUMP(SLJIT_JUMP); set_jumps(CURRENT_AS(then_trap_backtrack)->quit, LABEL()); + +framesize = CURRENT_AS(then_trap_backtrack)->framesize; +SLJIT_ASSERT(framesize != 0); + /* STACK_TOP is set by THEN. */ -if (CURRENT_AS(then_trap_backtrack)->framesize >= 0) +if (framesize > 0) { add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); - OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (CURRENT_AS(then_trap_backtrack)->framesize - 1) * sizeof(sljit_sw)); + OP2(SLJIT_ADD, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, (framesize - 1) * sizeof(sljit_sw)); } OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); free_stack(common, 3); @@ -13813,10 +13189,13 @@ while (current) case OP_TYPEPOSPLUS: case OP_TYPEPOSQUERY: case OP_TYPEPOSUPTO: + /* Since classes has no backtracking path, this + backtrackingpath was pushed by an iterator. */ case OP_CLASS: case OP_NCLASS: #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8 case OP_XCLASS: + case OP_ECLASS: #endif compile_iterator_backtrackingpath(common, current); break; @@ -13841,6 +13220,7 @@ while (current) case OP_ASSERT_NA: case OP_ASSERTBACK_NA: + case OP_ASSERT_SCS: case OP_ONCE: case OP_SCRIPT_RUN: case OP_BRA: @@ -13892,8 +13272,12 @@ while (current) case OP_COMMIT: case OP_COMMIT_ARG: + if (common->restore_end_ptr != 0) + OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->restore_end_ptr); + if (!common->local_quit_available) OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH); + if (common->quit_label == NULL) add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP)); else @@ -14003,7 +13387,7 @@ while (1) if (alt_max > 1 || (recurse_flags & recurse_flag_accept_found)) { if (alt_max > 3) - mov_addr = sljit_emit_mov_addr(compiler, SLJIT_MEM1(STACK_TOP), STACK(1)); + mov_addr = sljit_emit_op_addr(compiler, SLJIT_MOV_ADDR, SLJIT_MEM1(STACK_TOP), STACK(1)); else OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, alt_count); } @@ -14154,8 +13538,7 @@ int private_data_size; PCRE2_SPTR ccend; executable_functions *functions; void *executable_func; -sljit_uw executable_size; -sljit_uw total_length; +sljit_uw executable_size, private_data_length, total_length; struct sljit_label *mainloop_label = NULL; struct sljit_label *continue_match_label; struct sljit_label *empty_match_found_label = NULL; @@ -14182,7 +13565,7 @@ memset(&rootbacktrack, 0, sizeof(backtrack_common)); memset(common, 0, sizeof(compiler_common)); common->re = re; common->name_table = (PCRE2_SPTR)((uint8_t *)re + sizeof(pcre2_real_code)); -rootbacktrack.cc = common->name_table + re->name_count * re->name_entry_size; +rootbacktrack.cc = (PCRE2_SPTR)((uint8_t *)re + re->code_start); #ifdef SUPPORT_UNICODE common->invalid_utf = (mode & PCRE2_JIT_INVALID_UTF) != 0; @@ -14230,7 +13613,7 @@ common->name_entry_size = re->name_entry_size; common->unset_backref = (re->overall_options & PCRE2_MATCH_UNSET_BACKREF) != 0; common->alt_circumflex = (re->overall_options & PCRE2_ALT_CIRCUMFLEX) != 0; #ifdef SUPPORT_UNICODE -/* PCRE_UTF[16|32] have the same value as PCRE_UTF8. */ +/* PCRE2_UTF[16|32] have the same value as PCRE2_UTF8. */ common->utf = (re->overall_options & PCRE2_UTF) != 0; common->ucp = (re->overall_options & PCRE2_UCP) != 0; if (common->utf) @@ -14262,15 +13645,33 @@ else ccend = bracketend(common->start); /* Calculate the local space size on the stack. */ -common->ovector_start = LIMIT_MATCH + sizeof(sljit_sw); -common->optimized_cbracket = (sljit_u8 *)SLJIT_MALLOC(re->top_bracket + 1, allocator_data); -if (!common->optimized_cbracket) +common->ovector_start = LOCAL0; +/* Allocate space for temporary data structures. */ +private_data_length = ccend - common->start; +/* The chance of overflow is very low, but might happen on 32 bit. */ +if (private_data_length > ~(sljit_uw)0 / sizeof(sljit_s32)) return PCRE2_ERROR_NOMEMORY; + +private_data_length *= sizeof(sljit_s32); +/* Align to 32 bit. */ +common->cbracket_bitset_length = ((re->top_bracket + 1) + (sljit_u32)7) & ~(sljit_u32)7; +total_length = common->cbracket_bitset_length << 1; +if (~(sljit_uw)0 - private_data_length < total_length) + return PCRE2_ERROR_NOMEMORY; + +total_length += private_data_length; +common->private_data_ptrs = (sljit_s32*)SLJIT_MALLOC(total_length, allocator_data); +if (!common->private_data_ptrs) + return PCRE2_ERROR_NOMEMORY; + +memset(common->private_data_ptrs, 0, private_data_length); +common->optimized_cbrackets = ((sljit_u8 *)common->private_data_ptrs) + private_data_length; #if defined DEBUG_FORCE_UNOPTIMIZED_CBRAS && DEBUG_FORCE_UNOPTIMIZED_CBRAS == 1 -memset(common->optimized_cbracket, 0, re->top_bracket + 1); +memset(common->optimized_cbrackets, 0, common->cbracket_bitset_length); #else -memset(common->optimized_cbracket, 1, re->top_bracket + 1); +memset(common->optimized_cbrackets, 0xff, common->cbracket_bitset_length); #endif +common->cbracket_bitset = common->optimized_cbrackets + common->cbracket_bitset_length; SLJIT_ASSERT(*common->start == OP_BRA && ccend[-(1 + LINK_SIZE)] == OP_KET); #if defined DEBUG_FORCE_UNOPTIMIZED_CBRAS && DEBUG_FORCE_UNOPTIMIZED_CBRAS == 2 @@ -14279,16 +13680,19 @@ common->ovector_start += sizeof(sljit_sw); #endif if (!check_opcode_types(common, common->start, ccend)) { - SLJIT_FREE(common->optimized_cbracket, allocator_data); - return PCRE2_ERROR_NOMEMORY; + SLJIT_FREE(common->private_data_ptrs, allocator_data); + return PCRE2_ERROR_JIT_UNSUPPORTED; } /* Checking flags and updating ovector_start. */ -if (mode == PCRE2_JIT_COMPLETE && (re->flags & PCRE2_LASTSET) != 0 && (re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0) +if (mode == PCRE2_JIT_COMPLETE && + (re->flags & PCRE2_LASTSET) != 0 && + (re->optimization_flags & PCRE2_OPTIM_START_OPTIMIZE) != 0) { common->req_char_ptr = common->ovector_start; common->ovector_start += sizeof(sljit_sw); } + if (mode != PCRE2_JIT_COMPLETE) { common->start_used_ptr = common->ovector_start; @@ -14299,19 +13703,23 @@ if (mode != PCRE2_JIT_COMPLETE) common->ovector_start += sizeof(sljit_sw); } } + if ((re->overall_options & (PCRE2_FIRSTLINE | PCRE2_USE_OFFSET_LIMIT)) != 0) { common->match_end_ptr = common->ovector_start; common->ovector_start += sizeof(sljit_sw); } + #if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD common->control_head_ptr = 1; #endif + if (common->control_head_ptr != 0) { common->control_head_ptr = common->ovector_start; common->ovector_start += sizeof(sljit_sw); } + if (common->has_set_som) { /* Saving the real start pointer is necessary. */ @@ -14328,23 +13736,15 @@ if (common->start_ptr == 0) /* Capturing brackets cannot be optimized if callouts are allowed. */ if (common->capture_last_ptr != 0) - memset(common->optimized_cbracket, 0, re->top_bracket + 1); + memset(common->optimized_cbrackets, 0, common->cbracket_bitset_length); SLJIT_ASSERT(!(common->req_char_ptr != 0 && common->start_used_ptr != 0)); 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); -if (!common->private_data_ptrs) - { - SLJIT_FREE(common->optimized_cbracket, allocator_data); - return PCRE2_ERROR_NOMEMORY; - } -memset(common->private_data_ptrs, 0, total_length * sizeof(sljit_s32)); - private_data_size = common->cbra_ptr + (re->top_bracket + 1) * sizeof(sljit_sw); -if ((re->overall_options & PCRE2_ANCHORED) == 0 && (re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0 && !common->has_skip_in_assert_back) +if ((re->overall_options & PCRE2_ANCHORED) == 0 && + (re->optimization_flags & PCRE2_OPTIM_START_OPTIMIZE) != 0 && + !common->has_skip_in_assert_back) detect_early_fail(common, common->start, &private_data_size, 0, 0); set_private_data_ptrs(common, &private_data_size, ccend); @@ -14354,13 +13754,18 @@ SLJIT_ASSERT(common->early_fail_start_ptr <= common->early_fail_end_ptr); if (private_data_size > 65536) { SLJIT_FREE(common->private_data_ptrs, allocator_data); - SLJIT_FREE(common->optimized_cbracket, allocator_data); - return PCRE2_ERROR_NOMEMORY; + return PCRE2_ERROR_JIT_UNSUPPORTED; } if (common->has_then) { - common->then_offsets = (sljit_u8 *)(common->private_data_ptrs + total_length); + total_length = ccend - common->start; + common->then_offsets = (sljit_u8 *)SLJIT_MALLOC(total_length, allocator_data); + if (!common->then_offsets) + { + SLJIT_FREE(common->private_data_ptrs, allocator_data); + return PCRE2_ERROR_NOMEMORY; + } memset(common->then_offsets, 0, total_length); set_then_offsets(common, common->start, NULL); } @@ -14368,15 +13773,16 @@ if (common->has_then) compiler = sljit_create_compiler(allocator_data); if (!compiler) { - SLJIT_FREE(common->optimized_cbracket, allocator_data); SLJIT_FREE(common->private_data_ptrs, allocator_data); + if (common->has_then) + SLJIT_FREE(common->then_offsets, allocator_data); return PCRE2_ERROR_NOMEMORY; } common->compiler = compiler; /* Main pcre2_jit_exec entry. */ SLJIT_ASSERT((private_data_size & (sizeof(sljit_sw) - 1)) == 0); -sljit_emit_enter(compiler, 0, SLJIT_ARGS1(W, W), 5, 5, SLJIT_NUMBER_OF_SCRATCH_FLOAT_REGISTERS, 0, private_data_size); +sljit_emit_enter(compiler, 0, SLJIT_ARGS1(W, W), 5 | SLJIT_ENTER_VECTOR(SLJIT_NUMBER_OF_SCRATCH_VECTOR_REGISTERS), 5, private_data_size); /* Register init. */ reset_ovector(common, (re->top_bracket + 1) * 2); @@ -14410,7 +13816,7 @@ if ((re->overall_options & PCRE2_ANCHORED) == 0) mainloop_label = mainloop_entry(common); continue_match_label = LABEL(); /* Forward search if possible. */ - if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0) + if ((re->optimization_flags & PCRE2_OPTIM_START_OPTIMIZE) != 0) { if (mode == PCRE2_JIT_COMPLETE && fast_forward_first_n_chars(common)) ; @@ -14425,7 +13831,8 @@ if ((re->overall_options & PCRE2_ANCHORED) == 0) else continue_match_label = LABEL(); -if (mode == PCRE2_JIT_COMPLETE && re->minlength > 0 && (re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0) +if (mode == PCRE2_JIT_COMPLETE && re->minlength > 0 && + (re->optimization_flags & PCRE2_OPTIM_START_OPTIMIZE) != 0) { OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH); OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(re->minlength)); @@ -14460,8 +13867,9 @@ compile_matchingpath(common, common->start, ccend, &rootbacktrack); if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) { sljit_free_compiler(compiler); - SLJIT_FREE(common->optimized_cbracket, allocator_data); SLJIT_FREE(common->private_data_ptrs, allocator_data); + if (common->has_then) + SLJIT_FREE(common->then_offsets, allocator_data); PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); return PCRE2_ERROR_NOMEMORY; } @@ -14479,6 +13887,34 @@ common->accept_label = LABEL(); if (common->accept != NULL) set_jumps(common->accept, common->accept_label); +/* Fail if we detect that the start position was moved to be either after +the end position (\K in lookahead) or before the start offset (\K in +lookbehind). */ + +if (common->has_set_som && + (common->re->extra_options & PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK) == 0) + { + if (HAS_VIRTUAL_REGISTERS) + { + OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str)); + } + else + { + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, str)); + } + OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0)); + + /* (ovector[0] < jit_arguments->str)? */ + OP2U(SLJIT_SUB | SLJIT_SET_LESS, TMP2, 0, TMP1, 0); + /* Unconditionally set R0 (aka TMP1), in between the comparison that needs to + use TMP1, but before the jump. */ + OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_BAD_BACKSLASH_K); + add_jump(compiler, &common->abort, JUMP(SLJIT_LESS)); + /* (ovector[0] > STR_PTR)? NB. ovector[1] hasn't yet been set to STR_PTR. */ + add_jump(compiler, &common->abort, CMP(SLJIT_GREATER, TMP2, 0, STR_PTR, 0)); + } + /* This means we have a match. Update the ovector. */ copy_ovector(common, re->top_bracket + 1); common->quit_label = common->abort_label = LABEL(); @@ -14516,8 +13952,9 @@ compile_backtrackingpath(common, rootbacktrack.top); if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) { sljit_free_compiler(compiler); - SLJIT_FREE(common->optimized_cbracket, allocator_data); SLJIT_FREE(common->private_data_ptrs, allocator_data); + if (common->has_then) + SLJIT_FREE(common->then_offsets, allocator_data); PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); return PCRE2_ERROR_NOMEMORY; } @@ -14598,6 +14035,8 @@ common->early_fail_end_ptr = 0; common->currententry = common->entries; common->local_quit_available = TRUE; quit_label = common->quit_label; +SLJIT_ASSERT(common->restore_end_ptr == 0); + if (common->currententry != NULL) { /* A free bit for each private data. */ @@ -14627,26 +14066,43 @@ if (common->currententry != NULL) 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); + if (common->has_then) + SLJIT_FREE(common->then_offsets, allocator_data); PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); return PCRE2_ERROR_NOMEMORY; } } + common->local_quit_available = FALSE; common->quit_label = quit_label; +SLJIT_ASSERT(common->restore_end_ptr == 0); -/* Allocating stack, returns with PCRE_ERROR_JIT_STACKLIMIT if fails. */ +/* Allocating stack, returns with PCRE2_ERROR_JIT_STACKLIMIT if fails. */ /* This is a (really) rare case. */ set_jumps(common->stackalloc, LABEL()); /* RETURN_ADDR is not a saved register. */ -sljit_emit_op_dst(compiler, SLJIT_FAST_ENTER, SLJIT_MEM1(SLJIT_SP), LOCALS0); +SLJIT_ASSERT(common->locals_size >= 2 * SSIZE_OF(sw)); +sljit_emit_op_dst(compiler, SLJIT_FAST_ENTER, SLJIT_MEM1(SLJIT_SP), LOCAL0); SLJIT_ASSERT(TMP1 == SLJIT_R0 && STR_PTR == SLJIT_R1); -OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, STR_PTR, 0); +OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCAL1, STR_PTR, 0); OP1(SLJIT_MOV, SLJIT_R0, 0, ARGUMENTS, 0); -OP2(SLJIT_SUB, SLJIT_R1, 0, STACK_LIMIT, 0, SLJIT_IMM, STACK_GROWTH_RATE); +if (common->large_stack_allocation) + { + SLJIT_COMPILE_ASSERT((STACK_GROWTH_RATE & (STACK_GROWTH_RATE - 1)) == 0, stack_growth_must_be_power_of_2); + // Negative difference. The positive difference would also use the same amount + // of operations, but the last subtraction emits several instructions on x86. + OP2(SLJIT_SUB, SLJIT_R1, 0, STACK_TOP, 0, STACK_LIMIT, 0); + // Minimum extra space after allocation. + OP2(SLJIT_SUB, SLJIT_R1, 0, SLJIT_R1, 0, SLJIT_IMM, (STACK_GROWTH_RATE / 2)); + // Rounds down negative numbers. + OP2(SLJIT_AND, SLJIT_R1, 0, SLJIT_R1, 0, SLJIT_IMM, ~(STACK_GROWTH_RATE - 1)); + OP2(SLJIT_ADD, SLJIT_R1, 0, SLJIT_R1, 0, STACK_LIMIT, 0); + } +else + OP2(SLJIT_SUB, SLJIT_R1, 0, STACK_LIMIT, 0, SLJIT_IMM, STACK_GROWTH_RATE); OP1(SLJIT_MOV, SLJIT_R0, 0, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, stack)); OP1(SLJIT_MOV, STACK_LIMIT, 0, TMP2, 0); @@ -14655,8 +14111,8 @@ sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS2(W, W, W), SLJIT_IMM, SLJIT_FU jump = CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0); OP1(SLJIT_MOV, TMP2, 0, STACK_LIMIT, 0); OP1(SLJIT_MOV, STACK_LIMIT, 0, SLJIT_RETURN_REG, 0); -OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); -OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1); +OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCAL0); +OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCAL1); OP_SRC(SLJIT_FAST_RETURN, TMP1, 0); /* Allocation failed. */ @@ -14777,8 +14233,9 @@ if (common->getucdtype != NULL) } #endif /* SUPPORT_UNICODE */ -SLJIT_FREE(common->optimized_cbracket, allocator_data); SLJIT_FREE(common->private_data_ptrs, allocator_data); +if (common->has_then) + SLJIT_FREE(common->then_offsets, allocator_data); executable_func = sljit_generate_code(compiler, 0, NULL); executable_size = sljit_get_generated_code_size(compiler); @@ -14848,9 +14305,36 @@ pcre2_jit_compile(pcre2_code *code, uint32_t options) { pcre2_real_code *re = (pcre2_real_code *)code; #ifdef SUPPORT_JIT +void *exec_memory; executable_functions *functions; static int executable_allocator_is_working = -1; + +if (executable_allocator_is_working == -1) + { + /* Checks whether the executable allocator is working. This check + might run multiple times in multi-threaded environments, but the + result should not be affected by it. */ + exec_memory = SLJIT_MALLOC_EXEC(32, NULL); + if (exec_memory != NULL) + { + SLJIT_FREE_EXEC(((sljit_u8*)(exec_memory)) + SLJIT_EXEC_OFFSET(exec_memory), NULL); + executable_allocator_is_working = 1; + } + else executable_allocator_is_working = 0; + } +#endif + +if (options & PCRE2_JIT_TEST_ALLOC) + { + if (options != PCRE2_JIT_TEST_ALLOC) + return PCRE2_ERROR_JIT_BADOPTION; + +#ifdef SUPPORT_JIT + return executable_allocator_is_working ? 0 : PCRE2_ERROR_NOMEMORY; +#else + return PCRE2_ERROR_JIT_UNSUPPORTED; #endif + } if (code == NULL) return PCRE2_ERROR_NULL; @@ -14912,20 +14396,6 @@ return PCRE2_ERROR_JIT_BADOPTION; if ((re->flags & PCRE2_NOJIT) != 0) return 0; -if (executable_allocator_is_working == -1) - { - /* Checks whether the executable allocator is working. This check - might run multiple times in multi-threaded environments, but the - result should not be affected by it. */ - void *ptr = SLJIT_MALLOC_EXEC(32, NULL); - if (ptr != NULL) - { - SLJIT_FREE_EXEC(((sljit_u8*)(ptr)) + SLJIT_EXEC_OFFSET(ptr), NULL); - executable_allocator_is_working = 1; - } - else executable_allocator_is_working = 0; - } - if (!executable_allocator_is_working) return PCRE2_ERROR_NOMEMORY; @@ -14966,7 +14436,7 @@ return 0; #define INCLUDED_FROM_PCRE2_JIT_COMPILE -#include "pcre2_jit_match.c" -#include "pcre2_jit_misc.c" +#include "pcre2_jit_match_inc.h" +#include "pcre2_jit_misc_inc.h" /* End of pcre2_jit_compile.c */ diff --git a/std/regex/pcre2/pcre2_jit_match.c b/std/regex/pcre2/pcre2_jit_match_inc.h similarity index 89% rename from std/regex/pcre2/pcre2_jit_match.c rename to std/regex/pcre2/pcre2_jit_match_inc.h index ae5903e20..ba210007e 100644 --- a/std/regex/pcre2/pcre2_jit_match.c +++ b/std/regex/pcre2/pcre2_jit_match_inc.h @@ -83,7 +83,7 @@ return executable_func(arguments); Returns: > 0 => success; value is the number of ovector pairs filled = 0 => success, but ovector is not big enough - -1 => failed to match (PCRE_ERROR_NOMATCH) + -1 => failed to match (PCRE2_ERROR_NOMATCH) < -1 => some kind of unexpected problem */ @@ -99,9 +99,8 @@ pcre2_jit_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length, (void)length; (void)start_offset; (void)options; -(void)match_data; (void)mcontext; -return PCRE2_ERROR_JIT_BADOPTION; +return match_data->rc = PCRE2_ERROR_JIT_BADOPTION; #else /* SUPPORT_JIT */ @@ -118,13 +117,24 @@ jit_arguments arguments; int rc; int index = 0; +/* The same check is performed by jit_check_exec(). */ if ((options & PCRE2_PARTIAL_HARD) != 0) index = 2; else if ((options & PCRE2_PARTIAL_SOFT) != 0) index = 1; if (functions == NULL || functions->executable_funcs[index] == NULL) - return PCRE2_ERROR_JIT_BADOPTION; + return match_data->rc = PCRE2_ERROR_JIT_BADOPTION; + +/* If the match data block was previously used with PCRE2_COPY_MATCHED_SUBJECT, +free the memory that was obtained. */ + +if ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0) + { + match_data->memctl.free((void *)match_data->subject, + match_data->memctl.memory_data); + match_data->flags &= ~PCRE2_MD_COPIED_SUBJECT; + } /* Sanity checks should be handled by pcre2_match. */ arguments.str = subject + start_offset; @@ -176,14 +186,17 @@ else if (rc > (int)oveccount) rc = 0; match_data->code = re; -match_data->subject = (rc >= 0 || rc == PCRE2_ERROR_PARTIAL)? subject : NULL; +match_data->subject = + (rc >= 0 || rc == PCRE2_ERROR_NOMATCH || rc == PCRE2_ERROR_PARTIAL)? subject : NULL; match_data->subject_length = length; +match_data->start_offset = start_offset; match_data->rc = rc; match_data->startchar = arguments.startchar_ptr - subject; match_data->leftchar = 0; match_data->rightchar = 0; match_data->mark = arguments.mark_ptr; match_data->matchedby = PCRE2_MATCHEDBY_JIT; +match_data->options = options; #if defined(__has_feature) #if __has_feature(memory_sanitizer) @@ -197,4 +210,4 @@ return match_data->rc; #endif /* SUPPORT_JIT */ } -/* End of pcre2_jit_match.c */ +/* End of pcre2_jit_match_inc.h */ diff --git a/std/regex/pcre2/pcre2_jit_misc.c b/std/regex/pcre2/pcre2_jit_misc_inc.h similarity index 91% rename from std/regex/pcre2/pcre2_jit_misc.c rename to std/regex/pcre2/pcre2_jit_misc_inc.h index c3abc0b33..16c230e9b 100644 --- a/std/regex/pcre2/pcre2_jit_misc.c +++ b/std/regex/pcre2/pcre2_jit_misc_inc.h @@ -200,17 +200,28 @@ if (jit_stack != NULL) /************************************************* -* Get target CPU type * +* Checks function compilation * *************************************************/ -const char* -PRIV(jit_get_target)(void) +BOOL +PRIV(jit_check_exec)(void *executable_jit, uint32_t options) { #ifndef SUPPORT_JIT -return "JIT is not supported"; +(void)executable_jit; +(void)options; +return FALSE; #else /* SUPPORT_JIT */ -return sljit_get_platform_name(); -#endif /* SUPPORT_JIT */ +/* The same check is performed at the beginning of pcre2_jit_match(). */ +executable_functions *functions = (executable_functions *)executable_jit; +int index = 0; + +if ((options & PCRE2_PARTIAL_HARD) != 0) + index = 2; +else if ((options & PCRE2_PARTIAL_SOFT) != 0) + index = 1; + +return functions->executable_funcs[index] != NULL; +#endif } @@ -231,4 +242,19 @@ return executable_sizes[0] + executable_sizes[1] + executable_sizes[2]; #endif } -/* End of pcre2_jit_misc.c */ +/************************************************* +* Get target CPU type * +*************************************************/ + +const char* +PRIV(jit_get_target)(void) +{ +#ifndef SUPPORT_JIT +return "JIT is not supported"; +#else /* SUPPORT_JIT */ +return sljit_get_platform_name(); +#endif /* SUPPORT_JIT */ +} + + +/* End of pcre2_jit_misc_inc.h */ diff --git a/std/regex/pcre2/pcre2_maketables.c b/std/regex/pcre2/pcre2_maketables.c index ac8b63b80..0f6c5110a 100644 --- a/std/regex/pcre2/pcre2_maketables.c +++ b/std/regex/pcre2/pcre2_maketables.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2020 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -45,13 +45,13 @@ own as part of the PCRE2 library. It is also included in the compilation of pcre2_dftables.c as a freestanding program, in which case the macro PCRE2_DFTABLES is defined. */ + #ifndef PCRE2_DFTABLES /* Compiling the library */ -# ifdef HAVE_CONFIG_H -# include "config.h" -# endif -# include "pcre2_internal.h" +#include "pcre2_internal.h" #endif + + /************************************************* * Create PCRE2 character tables * *************************************************/ @@ -64,14 +64,15 @@ supplied, but when PCRE2_DFTABLES is defined (when compiling the pcre2_dftables freestanding auxiliary program) malloc() is used, and the function has a different name so as not to clash with the prototype in pcre2.h. -Arguments: none when PCRE2_DFTABLES is defined +Arguments: pointers to character-transforming functions when PCRE2_DFTABLES is + defined; else a PCRE2 general context or NULL -Returns: pointer to the contiguous block of data +Returns: pointer to the contiguous block of data; else NULL if memory allocation failed */ #ifdef PCRE2_DFTABLES /* Included in freestanding pcre2_dftables program */ -static const uint8_t *maketables(void) +static const uint8_t *maketables(int (*charfn_to)(int), int (*charfn_from)(int)) { uint8_t *yield = (uint8_t *)malloc(TABLES_LENGTH); @@ -82,6 +83,9 @@ pcre2_maketables(pcre2_general_context *gcontext) uint8_t *yield = (uint8_t *)((gcontext != NULL)? gcontext->memctl.malloc(TABLES_LENGTH, gcontext->memctl.memory_data) : malloc(TABLES_LENGTH)); + +#define charfn_to(c) (c) +#define charfn_from(c) (c) #endif /* PCRE2_DFTABLES */ int i; @@ -92,13 +96,18 @@ p = yield; /* First comes the lower casing table */ -for (i = 0; i < 256; i++) *p++ = tolower(i); +for (i = 0; i < 256; i++) + { + int c = charfn_from(tolower(charfn_to(i))); + *p++ = (c < 256)? c : i; + } /* Next the case-flipping table */ for (i = 0; i < 256; i++) { - int c = islower(i)? toupper(i) : tolower(i); + int c = charfn_from(islower(charfn_to(i))? toupper(charfn_to(i)) + : tolower(charfn_to(i))); *p++ = (c < 256)? c : i; } @@ -118,17 +127,17 @@ test for alnum specially. */ memset(p, 0, cbit_length); for (i = 0; i < 256; i++) { - if (isdigit(i)) p[cbit_digit + i/8] |= 1u << (i&7); - if (isupper(i)) p[cbit_upper + i/8] |= 1u << (i&7); - if (islower(i)) p[cbit_lower + i/8] |= 1u << (i&7); - if (isalnum(i)) p[cbit_word + i/8] |= 1u << (i&7); - if (i == '_') p[cbit_word + i/8] |= 1u << (i&7); - if (isspace(i)) p[cbit_space + i/8] |= 1u << (i&7); - if (isxdigit(i)) p[cbit_xdigit + i/8] |= 1u << (i&7); - if (isgraph(i)) p[cbit_graph + i/8] |= 1u << (i&7); - if (isprint(i)) p[cbit_print + i/8] |= 1u << (i&7); - if (ispunct(i)) p[cbit_punct + i/8] |= 1u << (i&7); - if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1u << (i&7); + if (isdigit(charfn_to(i))) p[cbit_digit + i/8] |= 1u << (i&7); + if (isupper(charfn_to(i))) p[cbit_upper + i/8] |= 1u << (i&7); + if (islower(charfn_to(i))) p[cbit_lower + i/8] |= 1u << (i&7); + if (isalnum(charfn_to(i))) p[cbit_word + i/8] |= 1u << (i&7); + if (i == CHAR_UNDERSCORE) p[cbit_word + i/8] |= 1u << (i&7); + if (isspace(charfn_to(i))) p[cbit_space + i/8] |= 1u << (i&7); + if (isxdigit(charfn_to(i))) p[cbit_xdigit + i/8] |= 1u << (i&7); + if (isgraph(charfn_to(i))) p[cbit_graph + i/8] |= 1u << (i&7); + if (isprint(charfn_to(i))) p[cbit_print + i/8] |= 1u << (i&7); + if (ispunct(charfn_to(i))) p[cbit_punct + i/8] |= 1u << (i&7); + if (iscntrl(charfn_to(i))) p[cbit_cntrl + i/8] |= 1u << (i&7); } p += cbit_length; @@ -140,11 +149,11 @@ changed at release 8.34 and it's always been this way for PCRE2. */ for (i = 0; i < 256; i++) { int x = 0; - if (isspace(i)) x += ctype_space; - if (isalpha(i)) x += ctype_letter; - if (islower(i)) x += ctype_lcletter; - if (isdigit(i)) x += ctype_digit; - if (isalnum(i) || i == '_') x += ctype_word; + if (isspace(charfn_to(i))) x += ctype_space; + if (isalpha(charfn_to(i))) x += ctype_letter; + if (islower(charfn_to(i))) x += ctype_lcletter; + if (isdigit(charfn_to(i))) x += ctype_digit; + if (isalnum(charfn_to(i)) || i == CHAR_UNDERSCORE) x += ctype_word; *p++ = x; } @@ -152,13 +161,16 @@ return yield; } #ifndef PCRE2_DFTABLES /* Compiling the library */ +#undef charfn_to +#undef charfn_from + PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION pcre2_maketables_free(pcre2_general_context *gcontext, const uint8_t *tables) { - if (gcontext) - gcontext->memctl.free((void *)tables, gcontext->memctl.memory_data); - else - free((void *)tables); +if (gcontext != NULL) + gcontext->memctl.free((void *)tables, gcontext->memctl.memory_data); +else + free((void *)tables); } #endif diff --git a/std/regex/pcre2/pcre2_match.c b/std/regex/pcre2/pcre2_match.c index 6c422c2e5..966576e19 100644 --- a/std/regex/pcre2/pcre2_match.c +++ b/std/regex/pcre2/pcre2_match.c @@ -39,12 +39,10 @@ POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" + + /* These defines enable debugging code */ /* #define DEBUG_FRAMES_DISPLAY */ @@ -155,25 +153,25 @@ changed, the code at RETURN_SWITCH below must be updated in sync. */ enum { RM1=1, RM2, RM3, RM4, RM5, RM6, RM7, RM8, RM9, RM10, RM11, RM12, RM13, RM14, RM15, RM16, RM17, RM18, RM19, RM20, RM21, RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30, - RM31, RM32, RM33, RM34, RM35, RM36, RM37 }; + RM31, RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39 }; #ifdef SUPPORT_WIDE_CHARS -enum { RM100=100, RM101 }; +enum { RM100=100, RM101, RM102, RM103 }; #endif #ifdef SUPPORT_UNICODE enum { RM200=200, RM201, RM202, RM203, RM204, RM205, RM206, RM207, RM208, RM209, RM210, RM211, RM212, RM213, RM214, RM215, RM216, RM217, RM218, RM219, RM220, RM221, RM222, RM223, - RM224, RM225 }; + RM224 }; #endif /* Define short names for general fields in the current backtrack frame, which is always pointed to by the F variable. Occasional references to fields in other frames are written out explicitly. There are also some fields in the -current frame whose names start with "temp" that are used for short-term, -localised backtracking memory. These are #defined with Lxxx names at the point -of use and undefined afterwards. */ +current frame that are used for short-term, localised backtracking memory. +These are members of the fields union and #defined with Lxxx names at the +point of use and undefined afterwards. */ #define Fback_frame F->back_frame #define Fcapture_last F->capture_last @@ -182,12 +180,10 @@ of use and undefined afterwards. */ #define Feptr F->eptr #define Fgroup_frame_type F->group_frame_type #define Flast_group_offset F->last_group_offset -#define Flength F->length #define Fmark F->mark #define Frdepth F->rdepth #define Fstart_match F->start_match #define Foffset_top F->offset_top -#define Foccu F->occu #define Fop F->op #define Fovector F->ovector #define Freturn_id F->return_id @@ -348,6 +344,7 @@ seems unlikely.) Arguments: offset index into the offset vector caseless TRUE if caseless + caseopts bitmask of REFI_FLAG_XYZ values F the current backtracking frame pointer mb points to match block lengthptr pointer for returning the length matched @@ -358,14 +355,18 @@ Returns: = 0 sucessful match; number of code units matched is set */ static int -match_ref(PCRE2_SIZE offset, BOOL caseless, heapframe *F, match_block *mb, - PCRE2_SIZE *lengthptr) +match_ref(PCRE2_SIZE offset, BOOL caseless, int caseopts, heapframe *F, + match_block *mb, PCRE2_SIZE *lengthptr) { PCRE2_SPTR p; PCRE2_SIZE length; PCRE2_SPTR eptr; PCRE2_SPTR eptr_start; +#ifndef SUPPORT_UNICODE +(void)caseopts; /* Avoid compiler warning. */ +#endif + /* Deal with an unset group. The default is no match, but there is an option to match an empty string. */ @@ -384,11 +385,14 @@ if (offset >= Foffset_top || Fovector[offset] == PCRE2_UNSET) eptr = eptr_start = Feptr; p = mb->start_subject + Fovector[offset]; length = Fovector[offset+1] - Fovector[offset]; +PCRE2_ASSERT(eptr <= mb->end_subject); if (caseless) { #if defined SUPPORT_UNICODE BOOL utf = (mb->poptions & PCRE2_UTF) != 0; + BOOL caseless_restrict = (caseopts & REFI_FLAG_CASELESS_RESTRICT) != 0; + BOOL turkish_casing = !caseless_restrict && (caseopts & REFI_FLAG_TURKISH_CASING) != 0; if (utf || (mb->poptions & PCRE2_UCP) != 0) { @@ -401,7 +405,7 @@ if (caseless) bytes in UTF-8); a sequence of 3 of the former uses 6 bytes, as does a sequence of two of the latter. It is important, therefore, to check the length along the reference, not along the subject (earlier code did this - wrong). UCP without uses Unicode properties but without UTF encoding. */ + wrong). UCP uses Unicode properties but without UTF encoding. */ while (p < endptr) { @@ -420,10 +424,20 @@ if (caseless) d = *p++; } - ur = GET_UCD(d); - if (c != d && c != (uint32_t)((int)d + ur->other_case)) + if (turkish_casing && UCD_ANY_I(d)) + { + c = UCD_FOLD_I_TURKISH(c); + d = UCD_FOLD_I_TURKISH(d); + if (c != d) return -1; /* No match */ + } + else if (c != d && c != (uint32_t)((int)d + (ur = GET_UCD(d))->other_case)) { const uint32_t *pp = PRIV(ucd_caseless_sets) + ur->caseset; + + /* When PCRE2_EXTRA_CASELESS_RESTRICT is set, ignore any caseless sets + that start with an ASCII character. */ + if (caseless_restrict && *pp < 128) return -1; /* No match */ + for (;;) { if (c < *pp) return -1; /* No match */ @@ -441,8 +455,8 @@ if (caseless) { uint32_t cc, cp; if (eptr >= mb->end_subject) return 1; /* Partial match */ - cc = UCHAR21TEST(eptr); - cp = UCHAR21TEST(p); + cc = *eptr; + cp = *p; if (TABLE_GET(cp, mb->lcc, cp) != TABLE_GET(cc, mb->lcc, cc)) return -1; /* No match */ p++; @@ -462,7 +476,7 @@ else for (; length > 0; length--) { if (eptr >= mb->end_subject) return 1; /* Partial match */ - if (UCHAR21INCTEST(p) != UCHAR21INCTEST(eptr)) return -1; /* No match */ + if (*p++ != *eptr++) return -1; /* No match */ } } @@ -470,8 +484,8 @@ else else { - if ((PCRE2_SIZE)(mb->end_subject - eptr) < length) return 1; /* Partial */ - if (memcmp(p, eptr, CU2BYTES(length)) != 0) return -1; /* No match */ + if ((PCRE2_SIZE)(mb->end_subject - eptr) < length || + memcmp(p, eptr, CU2BYTES(length)) != 0) return -1; /* No match */ eptr += length; } } @@ -482,6 +496,75 @@ return 0; /* Match */ +/************************************************* +* Restore offsets after a recurse * +*************************************************/ + +/* This function restores the ovector values when +a recursive block reaches its end, and the triggering +recurse has and argument list. + +Arguments: + F the current backtracking frame pointer + P the previous backtracking frame pointer +*/ + +static void +recurse_update_offsets(heapframe *F, heapframe *P) +{ +PCRE2_SIZE *dst = F->ovector; +PCRE2_SIZE *src = P->ovector; +/* The first bracket has offset 2, because +offset 0 is reserved for the full match. */ +PCRE2_SIZE offset = 2; +PCRE2_SIZE offset_top = Foffset_top + 2; +PCRE2_SIZE diff; +PCRE2_SPTR ecode = Fecode; + +do + { + diff = (GET2(ecode, 1) << 1) - offset; + ecode += 1 + IMM2_SIZE; + + if (offset + diff >= offset_top) + { + /* Some OP_CREF opcodes are not + processed, they must be skipped. */ + while (*ecode == OP_CREF) ecode += 1 + IMM2_SIZE; + break; + } + + if (diff == 2) + { + dst[0] = src[0]; + dst[1] = src[1]; + } + else if (diff >= 4) + memcpy(dst, src, diff * sizeof(PCRE2_SIZE)); + + /* Skip the unmodified entry. */ + diff += 2; + offset += diff; + dst += diff; + src += diff; + } +while (*ecode == OP_CREF); + +diff = offset_top - offset; +if (diff == 2) + { + dst[0] = src[0]; + dst[1] = src[1]; + } +else if (diff >= 4) + memcpy(dst, src, diff * sizeof(PCRE2_SIZE)); + +Fecode = ecode; +Foffset_top = (offset <= P->offset_top) ? P->offset_top : (offset - 2); +} + + + /****************************************************************************** ******************************************************************************* "Recursion" in the match() function @@ -528,38 +611,46 @@ For hard partial matching, we immediately return a partial match. Otherwise, carrying on means that a complete match on the current subject will be sought. A partial match is returned only if no complete match can be found. */ -#define CHECK_PARTIAL()\ - if (Feptr >= mb->end_subject) \ - { \ - SCHECK_PARTIAL(); \ - } - -#define SCHECK_PARTIAL()\ - if (mb->partial != 0 && \ - (Feptr > mb->start_used_ptr || mb->allowemptypartial)) \ - { \ - mb->hitend = TRUE; \ - if (mb->partial > 1) return PCRE2_ERROR_PARTIAL; \ - } +#define CHECK_PARTIAL() \ + do { \ + if (Feptr >= mb->end_subject) \ + { \ + SCHECK_PARTIAL(); \ + } \ + } \ + while (0) + +#define SCHECK_PARTIAL() \ + do { \ + if (mb->partial != 0 && \ + (Feptr > mb->start_used_ptr || mb->allowemptypartial)) \ + { \ + mb->hitend = TRUE; \ + if (mb->partial > 1) return PCRE2_ERROR_PARTIAL; \ + } \ + } \ + while (0) /* These macros are used to implement backtracking. They simulate a recursive call to the match() function by means of a local vector of frames which remember the backtracking points. */ -#define RMATCH(ra,rb)\ - {\ - start_ecode = ra;\ - Freturn_id = rb;\ - goto MATCH_RECURSE;\ - L_##rb:;\ - } +#define RMATCH(ra,rb) \ + do { \ + start_ecode = ra; \ + Freturn_id = rb; \ + goto MATCH_RECURSE; \ + L_##rb:; \ + } \ + while (0) -#define RRETURN(ra)\ - {\ - rrc = ra;\ - goto RETURN_SWITCH;\ - } +#define RRETURN(ra) \ + do { \ + rrc = ra; \ + goto RETURN_SWITCH; \ + } \ + while (0) @@ -604,7 +695,7 @@ heapframe *frames_top; /* End of frames vector */ heapframe *assert_accept_frame = NULL; /* For passing back a frame with captures */ PCRE2_SIZE frame_copy_size; /* Amount to copy when creating a new frame */ -/* Local variables that do not need to be preserved over calls to RRMATCH(). */ +/* Local variables that do not need to be preserved over calls to RMATCH(). */ PCRE2_SPTR branch_end = NULL; PCRE2_SPTR branch_start; @@ -723,11 +814,11 @@ if (group_frame_type != 0) break; case GF_NOCAPTURE: - fprintf(stderr, "nocapture op=%d", GF_DATAMASK(group_frame_type)); + fprintf(stderr, "nocapture op=%d", Fop); break; case GF_CONDASSERT: - fprintf(stderr, "condassert op=%d", GF_DATAMASK(group_frame_type)); + fprintf(stderr, "condassert op=%d", Fop); break; case GF_RECURSE: @@ -813,7 +904,10 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, offset = Flast_group_offset; for(;;) { + /* Corrupted heapframes?. Trigger an assert and return an error */ + PCRE2_ASSERT(offset != PCRE2_UNSET); if (offset == PCRE2_UNSET) return PCRE2_ERROR_INTERNAL; + N = (heapframe *)((char *)match_data->heapframes + offset); P = (heapframe *)((char *)N - frame_size); if (N->group_frame_type == (GF_CAPTURE | number)) break; @@ -852,7 +946,10 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, offset = Flast_group_offset; for(;;) { + /* Corrupted heapframes?. Trigger an assert and return an error */ + PCRE2_ASSERT(offset != PCRE2_UNSET); if (offset == PCRE2_UNSET) return PCRE2_ERROR_INTERNAL; + N = (heapframe *)((char *)match_data->heapframes + offset); P = (heapframe *)((char *)N - frame_size); if (GF_IDMASK(N->group_frame_type) == GF_RECURSE) break; @@ -871,7 +968,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, Fecode += 1 + LINK_SIZE; continue; } - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* OP_END itself can never be reached within a recursion because that is picked up when the OP_KET that always precedes OP_END is reached. */ @@ -911,11 +1008,28 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, } #ifdef DEBUG_SHOW_OPS - fprintf(stderr, "++ Failed ACCEPT not at end (endanchnored set)\n"); + fprintf(stderr, "++ Failed ACCEPT not at end (endanchored set)\n"); #endif return MATCH_NOMATCH; /* (*ACCEPT) */ } + /* Fail if we detect that the start position was moved to be either after + the end position (\K in lookahead) or before the start offset (\K in + lookbehind). If this occurs, the pattern must have used \K in a somewhat + sneaky way (e.g. by pattern recursion), because if the \K is actually + syntactically inside the lookaround, it's blocked at compile-time. */ + + if (Fstart_match < mb->start_subject + mb->start_offset || + Fstart_match > Feptr) + { + /* The \K expression is fairly rare. We assert it was used so that we + catch any unexpected invalid data in start_match. */ + PCRE2_ASSERT(mb->hasbsk); + + if (!mb->allowlookaroundbsk) + return PCRE2_ERROR_BAD_BACKSLASH_K; + } + /* We have a successful match of the whole pattern. Record the result and then do a direct return from the function. If there is space in the offset vector, set any pairs that follow the highest-numbered captured string but @@ -950,12 +1064,12 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, Feptr == mb->end_subject - 1 && NLBLOCK->nltype == NLTYPE_FIXED && NLBLOCK->nllen == 2 && - UCHAR21TEST(Feptr) == NLBLOCK->nl[0]) + *Feptr == NLBLOCK->nl[0]) { mb->hitend = TRUE; if (mb->partial > 1) return PCRE2_ERROR_PARTIAL; } - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* Match any single character whatsoever. */ @@ -996,17 +1110,17 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, #ifdef SUPPORT_UNICODE if (utf) { - Flength = 1; + length = 1; Fecode++; - GETCHARLEN(fc, Fecode, Flength); - if (Flength > (PCRE2_SIZE)(mb->end_subject - Feptr)) + GETCHARLEN(fc, Fecode, length); + if (length > (PCRE2_SIZE)(mb->end_subject - Feptr)) { CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */ RRETURN(MATCH_NOMATCH); } - for (; Flength > 0; Flength--) + for (; length > 0; length--) { - if (*Fecode++ != UCHAR21INC(Feptr)) RRETURN(MATCH_NOMATCH); + if (*Fecode++ != *Feptr++) RRETURN(MATCH_NOMATCH); } } else @@ -1041,9 +1155,9 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, #ifdef SUPPORT_UNICODE if (utf) { - Flength = 1; + length = 1; Fecode++; - GETCHARLEN(fc, Fecode, Flength); + GETCHARLEN(fc, Fecode, length); /* If the pattern character's value is < 128, we know that its other case (if any) is also < 128 (and therefore only one code unit long in all @@ -1052,7 +1166,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if (fc < 128) { - uint32_t cc = UCHAR21(Feptr); + uint32_t cc = *Feptr; if (mb->lcc[fc] != TABLE_GET(cc, mb->lcc, cc)) RRETURN(MATCH_NOMATCH); Fecode++; Feptr++; @@ -1060,14 +1174,14 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, /* Otherwise we must pick up the subject character and use Unicode property support to test its other case. Note that we cannot use the - value of "Flength" to check for sufficient bytes left, because the other + value of "length" to check for sufficient bytes left, because the other case of the character may have more or fewer code units. */ else { uint32_t dc; GETCHARINC(dc, Feptr); - Fecode += Flength; + Fecode += length; if (dc != fc && dc != UCD_OTHERCASE(fc)) RRETURN(MATCH_NOMATCH); } } @@ -1077,7 +1191,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, else if (ucp) { - uint32_t cc = UCHAR21(Feptr); + uint32_t cc = *Feptr; fc = Fecode[1]; if (fc < 128) { @@ -1141,7 +1255,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, else if (ucp) { uint32_t ch; - fc = UCHAR21INC(Feptr); + fc = *Feptr++; ch = Fecode[1]; Fecode += 2; @@ -1166,7 +1280,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, { uint32_t ch = Fecode[1]; - fc = UCHAR21INC(Feptr); + fc = *Feptr++; if (ch == fc || (Fop == OP_NOTI && TABLE_GET(ch, mb->fcc, ch) == fc)) RRETURN(MATCH_NOMATCH); Fecode += 2; @@ -1177,13 +1291,15 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, /* ===================================================================== */ /* Match a single character repeatedly. */ -#define Loclength F->temp_size -#define Lstart_eptr F->temp_sptr[0] -#define Lcharptr F->temp_sptr[1] -#define Lmin F->temp_32[0] -#define Lmax F->temp_32[1] -#define Lc F->temp_32[2] -#define Loc F->temp_32[3] +#define Llength F->byte1 +#define Loclength F->byte2 +#define Lstart_eptr F->fields.char_repeat.start_eptr +#define Lcharptr F->fields.char_repeat.charptr +#define Lmin F->fields.char_repeat.min +#define Lmax F->fields.char_repeat.max +#define Lc F->fields.char_repeat.c +#define Loc F->fields.char_repeat.oc.oc +#define Loccu F->fields.char_repeat.oc.occu case OP_EXACT: case OP_EXACTI: @@ -1277,29 +1393,30 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, #ifdef SUPPORT_UNICODE if (utf) { - Flength = 1; + length = 1; Lcharptr = Fecode; - GETCHARLEN(fc, Fecode, Flength); - Fecode += Flength; + GETCHARLEN(fc, Fecode, length); + Fecode += length; + Llength = (uint8_t)length; /* Handle multi-code-unit character matching, caseful and caseless. */ - if (Flength > 1) + if (length > 1) { uint32_t othercase; if (Fop >= OP_STARI && /* Caseless */ (othercase = UCD_OTHERCASE(fc)) != fc) - Loclength = PRIV(ord2utf)(othercase, Foccu); + Loclength = (uint8_t)PRIV(ord2utf)(othercase, Loccu); else Loclength = 0; for (i = 1; i <= Lmin; i++) { - if (Feptr <= mb->end_subject - Flength && - memcmp(Feptr, Lcharptr, CU2BYTES(Flength)) == 0) Feptr += Flength; + if (Feptr <= mb->end_subject - length && + memcmp(Feptr, Lcharptr, CU2BYTES(length)) == 0) Feptr += length; else if (Loclength > 0 && Feptr <= mb->end_subject - Loclength && - memcmp(Feptr, Foccu, CU2BYTES(Loclength)) == 0) + memcmp(Feptr, Loccu, CU2BYTES(Loclength)) == 0) Feptr += Loclength; else { @@ -1317,11 +1434,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, RMATCH(Fecode, RM202); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); - if (Feptr <= mb->end_subject - Flength && - memcmp(Feptr, Lcharptr, CU2BYTES(Flength)) == 0) Feptr += Flength; + if (Feptr <= mb->end_subject - Llength && + memcmp(Feptr, Lcharptr, CU2BYTES(Llength)) == 0) Feptr += Llength; else if (Loclength > 0 && Feptr <= mb->end_subject - Loclength && - memcmp(Feptr, Foccu, CU2BYTES(Loclength)) == 0) + memcmp(Feptr, Loccu, CU2BYTES(Loclength)) == 0) Feptr += Loclength; else { @@ -1329,20 +1446,19 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, RRETURN(MATCH_NOMATCH); } } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ } - else /* Maximize */ { Lstart_eptr = Feptr; for (i = Lmin; i < Lmax; i++) { - if (Feptr <= mb->end_subject - Flength && - memcmp(Feptr, Lcharptr, CU2BYTES(Flength)) == 0) - Feptr += Flength; + if (Feptr <= mb->end_subject - Llength && + memcmp(Feptr, Lcharptr, CU2BYTES(Llength)) == 0) + Feptr += Llength; else if (Loclength > 0 && Feptr <= mb->end_subject - Loclength && - memcmp(Feptr, Foccu, CU2BYTES(Loclength)) == 0) + memcmp(Feptr, Loccu, CU2BYTES(Loclength)) == 0) Feptr += Loclength; else { @@ -1407,7 +1523,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, SCHECK_PARTIAL(); RRETURN(MATCH_NOMATCH); } - cc = UCHAR21TEST(Feptr); + cc = *Feptr; if (Lc != cc && Loc != cc) RRETURN(MATCH_NOMATCH); Feptr++; } @@ -1426,11 +1542,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, SCHECK_PARTIAL(); RRETURN(MATCH_NOMATCH); } - cc = UCHAR21TEST(Feptr); + cc = *Feptr; if (Lc != cc && Loc != cc) RRETURN(MATCH_NOMATCH); Feptr++; } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ } else /* Maximize */ @@ -1444,7 +1560,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, SCHECK_PARTIAL(); break; } - cc = UCHAR21TEST(Feptr); + cc = *Feptr; if (Lc != cc && Loc != cc) break; Feptr++; } @@ -1469,7 +1585,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, SCHECK_PARTIAL(); RRETURN(MATCH_NOMATCH); } - if (Lc != UCHAR21INCTEST(Feptr)) RRETURN(MATCH_NOMATCH); + if (Lc != *Feptr++) RRETURN(MATCH_NOMATCH); } if (Lmin == Lmax) continue; @@ -1486,9 +1602,9 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, SCHECK_PARTIAL(); RRETURN(MATCH_NOMATCH); } - if (Lc != UCHAR21INCTEST(Feptr)) RRETURN(MATCH_NOMATCH); + if (Lc != *Feptr++) RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ } else /* Maximize */ { @@ -1501,7 +1617,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, break; } - if (Lc != UCHAR21TEST(Feptr)) break; + if (Lc != *Feptr) break; Feptr++; } @@ -1516,6 +1632,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, } break; +#undef Llength #undef Loclength #undef Lstart_eptr #undef Lcharptr @@ -1523,6 +1640,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, #undef Lmax #undef Lc #undef Loc +#undef Loccu /* ===================================================================== */ @@ -1533,11 +1651,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, very much to the time taken, but character matching *is* what this is all about... */ -#define Lstart_eptr F->temp_sptr[0] -#define Lmin F->temp_32[0] -#define Lmax F->temp_32[1] -#define Lc F->temp_32[2] -#define Loc F->temp_32[3] +#define Lstart_eptr F->fields.charnot_repeat.start_eptr +#define Lmin F->fields.charnot_repeat.min +#define Lmax F->fields.charnot_repeat.max +#define Lc F->fields.charnot_repeat.c +#define Loc F->fields.charnot_repeat.oc case OP_NOTEXACT: case OP_NOTEXACTI: @@ -1706,7 +1824,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, Feptr++; } } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ } /* Maximize case */ @@ -1844,7 +1962,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if (Lc == *Feptr++) RRETURN(MATCH_NOMATCH); } } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ } /* Maximize case */ @@ -1924,11 +2042,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, OP_CLASS and OP_NCLASS occurs when a data character outside the range is encountered. */ -#define Lmin F->temp_32[0] -#define Lmax F->temp_32[1] -#define Lstart_eptr F->temp_sptr[0] -#define Lbyte_map_address F->temp_sptr[1] -#define Lbyte_map ((unsigned char *)Lbyte_map_address) +#define Lbyte_map_address F->fields.class_repeat.byte_map_address +#define Lbyte_map ((const unsigned char *)Lbyte_map_address) +#define Lstart_eptr F->fields.class_repeat.start_eptr +#define Lmin F->fields.class_repeat.min +#define Lmax F->fields.class_repeat.max case OP_NCLASS: case OP_CLASS: @@ -2071,7 +2189,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH); } } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ } /* If maximizing, find the longest possible run, then work backwards. */ @@ -2151,7 +2269,8 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, RRETURN(MATCH_NOMATCH); } } - /* Control never gets here */ + + PCRE2_UNREACHABLE(); /* Control never reaches here */ #undef Lbyte_map_address #undef Lbyte_map @@ -2166,10 +2285,10 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, 32-bit libraries, codepoints greater than 255 may be encountered even when UTF is not supported. */ -#define Lstart_eptr F->temp_sptr[0] -#define Lxclass_data F->temp_sptr[1] -#define Lmin F->temp_32[0] -#define Lmax F->temp_32[1] +#define Lstart_eptr F->fields.xclass_repeat.start_eptr +#define Lxclass_data F->fields.xclass_repeat.xclass_data +#define Lmin F->fields.xclass_repeat.min +#define Lmax F->fields.xclass_repeat.max #ifdef SUPPORT_WIDE_CHARS case OP_XCLASS: @@ -2219,7 +2338,9 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(fc, Feptr); - if (!PRIV(xclass)(fc, Lxclass_data, utf)) RRETURN(MATCH_NOMATCH); + if (!PRIV(xclass)(fc, Lxclass_data, + (const uint8_t*)mb->start_code, utf)) + RRETURN(MATCH_NOMATCH); } /* If Lmax == Lmin we can just continue with the main loop. */ @@ -2242,9 +2363,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(fc, Feptr); - if (!PRIV(xclass)(fc, Lxclass_data, utf)) RRETURN(MATCH_NOMATCH); + if (!PRIV(xclass)(fc, Lxclass_data, + (const uint8_t*)mb->start_code, utf)) + RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ } /* If maximizing, find the longest possible run, then work backwards. */ @@ -2265,7 +2388,8 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, #else fc = *Feptr; #endif - if (!PRIV(xclass)(fc, Lxclass_data, utf)) break; + if (!PRIV(xclass)(fc, Lxclass_data, + (const uint8_t*)mb->start_code, utf)) break; Feptr += len; } @@ -2287,7 +2411,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ } #endif /* SUPPORT_WIDE_CHARS: end of XCLASS */ @@ -2297,6 +2421,151 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, #undef Lmax + /* ===================================================================== */ + /* Match a complex, set-based character class. This opcodes are used when + there is complex nesting or logical operations within the character + class. */ + +#define Lstart_eptr F->fields.eclass_repeat.start_eptr +#define Leclass_data F->fields.eclass_repeat.eclass_data +#define Leclass_len F->fields.eclass_repeat.eclass_len +#define Lmin F->fields.eclass_repeat.min +#define Lmax F->fields.eclass_repeat.max + +#ifdef SUPPORT_WIDE_CHARS + case OP_ECLASS: + { + Leclass_data = Fecode + 1 + LINK_SIZE; /* Save for matching */ + Fecode += GET(Fecode, 1); /* Advance past the item */ + Leclass_len = (PCRE2_SIZE)(Fecode - Leclass_data); + + switch (*Fecode) + { + case OP_CRSTAR: + case OP_CRMINSTAR: + case OP_CRPLUS: + case OP_CRMINPLUS: + case OP_CRQUERY: + case OP_CRMINQUERY: + case OP_CRPOSSTAR: + case OP_CRPOSPLUS: + case OP_CRPOSQUERY: + fc = *Fecode++ - OP_CRSTAR; + Lmin = rep_min[fc]; + Lmax = rep_max[fc]; + reptype = rep_typ[fc]; + break; + + case OP_CRRANGE: + case OP_CRMINRANGE: + case OP_CRPOSRANGE: + Lmin = GET2(Fecode, 1); + Lmax = GET2(Fecode, 1 + IMM2_SIZE); + if (Lmax == 0) Lmax = UINT32_MAX; /* Max 0 => infinity */ + reptype = rep_typ[*Fecode - OP_CRSTAR]; + Fecode += 1 + 2 * IMM2_SIZE; + break; + + default: /* No repeat follows */ + Lmin = Lmax = 1; + break; + } + + /* First, ensure the minimum number of matches are present. */ + + for (i = 1; i <= Lmin; i++) + { + if (Feptr >= mb->end_subject) + { + SCHECK_PARTIAL(); + RRETURN(MATCH_NOMATCH); + } + GETCHARINCTEST(fc, Feptr); + if (!PRIV(eclass)(fc, Leclass_data, Leclass_data + Leclass_len, + (const uint8_t*)mb->start_code, utf)) + RRETURN(MATCH_NOMATCH); + } + + /* If Lmax == Lmin we can just continue with the main loop. */ + + if (Lmin == Lmax) continue; + + /* If minimizing, keep testing the rest of the expression and advancing + the pointer while it matches the class. */ + + if (reptype == REPTYPE_MIN) + { + for (;;) + { + RMATCH(Fecode, RM102); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); + if (Feptr >= mb->end_subject) + { + SCHECK_PARTIAL(); + RRETURN(MATCH_NOMATCH); + } + GETCHARINCTEST(fc, Feptr); + if (!PRIV(eclass)(fc, Leclass_data, Leclass_data + Leclass_len, + (const uint8_t*)mb->start_code, utf)) + RRETURN(MATCH_NOMATCH); + } + PCRE2_UNREACHABLE(); /* Control never reaches here */ + } + + /* If maximizing, find the longest possible run, then work backwards. */ + + else + { + Lstart_eptr = Feptr; + for (i = Lmin; i < Lmax; i++) + { + int len = 1; + if (Feptr >= mb->end_subject) + { + SCHECK_PARTIAL(); + break; + } +#ifdef SUPPORT_UNICODE + GETCHARLENTEST(fc, Feptr, len); +#else + fc = *Feptr; +#endif + if (!PRIV(eclass)(fc, Leclass_data, Leclass_data + Leclass_len, + (const uint8_t*)mb->start_code, utf)) + break; + Feptr += len; + } + + if (reptype == REPTYPE_POS) continue; /* No backtracking */ + + /* After \C in UTF mode, Lstart_eptr might be in the middle of a + Unicode character. Use <= Lstart_eptr to ensure backtracking doesn't + go too far. */ + + for(;;) + { + RMATCH(Fecode, RM103); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (Feptr-- <= Lstart_eptr) break; /* Tried at original position */ +#ifdef SUPPORT_UNICODE + if (utf) BACKCHAR(Feptr); +#endif + } + RRETURN(MATCH_NOMATCH); + } + + PCRE2_UNREACHABLE(); /* Control never reaches here */ + } +#endif /* SUPPORT_WIDE_CHARS: end of ECLASS */ + +#undef Lstart_eptr +#undef Leclass_data +#undef Leclass_len +#undef Lmin +#undef Lmax + + /* ===================================================================== */ /* Match various character types when PCRE2_UCP is not set. These opcodes are not generated when PCRE2_UCP is set - instead appropriate property @@ -2390,7 +2659,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, { SCHECK_PARTIAL(); } - else if (UCHAR21TEST(Feptr) == CHAR_LF) Feptr++; + else if (*Feptr == CHAR_LF) Feptr++; break; case CHAR_LF: @@ -2492,10 +2761,6 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, switch(Fecode[1]) { - case PT_ANY: - if (notmatch) RRETURN(MATCH_NOMATCH); - break; - case PT_LAMP: chartype = prop->chartype; if ((chartype == ucp_Lu || @@ -2605,8 +2870,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, /* This should never occur */ + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } Fecode += 3; @@ -2627,7 +2895,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, else { GETCHARINCTEST(fc, Feptr); - Feptr = PRIV(extuni)(fc, Feptr, mb->start_subject, mb->end_subject, utf, + Feptr = PRIV(extuni)(fc, Feptr, mb->check_subject, mb->end_subject, utf, NULL); } CHECK_PARTIAL(); @@ -2642,11 +2910,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, does not need to be in a stack frame as it is not used within an RMATCH() loop. */ -#define Lstart_eptr F->temp_sptr[0] -#define Lmin F->temp_32[0] -#define Lmax F->temp_32[1] -#define Lctype F->temp_32[2] -#define Lpropvalue F->temp_32[3] +#define Lstart_eptr F->fields.type_repeat.start_eptr +#define Lmin F->fields.type_repeat.min +#define Lmax F->fields.type_repeat.max +#define Lctype F->fields.type_repeat.ctype +#define Lpropvalue F->fields.type_repeat.propvalue case OP_TYPEEXACT: Lmin = Lmax = GET2(Fecode, 1); @@ -2728,19 +2996,6 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, BOOL notmatch = Lctype == OP_NOTPROP; switch(proptype) { - case PT_ANY: - if (notmatch) RRETURN(MATCH_NOMATCH); - for (i = 1; i <= Lmin; i++) - { - if (Feptr >= mb->end_subject) - { - SCHECK_PARTIAL(); - RRETURN(MATCH_NOMATCH); - } - GETCHARINCTEST(fc, Feptr); - } - break; - case PT_LAMP: for (i = 1; i <= Lmin; i++) { @@ -2968,8 +3223,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, /* This should not occur */ + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } } @@ -2988,7 +3246,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, else { GETCHARINCTEST(fc, Feptr); - Feptr = PRIV(extuni)(fc, Feptr, mb->start_subject, + Feptr = PRIV(extuni)(fc, Feptr, mb->check_subject, mb->end_subject, utf, NULL); } CHECK_PARTIAL(); @@ -3015,7 +3273,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, Feptr + 1 >= mb->end_subject && NLBLOCK->nltype == NLTYPE_FIXED && NLBLOCK->nllen == 2 && - UCHAR21(Feptr) == NLBLOCK->nl[0]) + *Feptr == NLBLOCK->nl[0]) { mb->hitend = TRUE; if (mb->partial > 1) return PCRE2_ERROR_PARTIAL; @@ -3057,7 +3315,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, default: RRETURN(MATCH_NOMATCH); case CHAR_CR: - if (Feptr < mb->end_subject && UCHAR21(Feptr) == CHAR_LF) Feptr++; + if (Feptr < mb->end_subject && *Feptr == CHAR_LF) Feptr++; break; case CHAR_LF: @@ -3167,7 +3425,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, SCHECK_PARTIAL(); RRETURN(MATCH_NOMATCH); } - cc = UCHAR21(Feptr); + cc = *Feptr; if (cc >= 128 || (mb->ctypes[cc] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH); Feptr++; @@ -3184,7 +3442,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, SCHECK_PARTIAL(); RRETURN(MATCH_NOMATCH); } - cc = UCHAR21(Feptr); + cc = *Feptr; if (cc < 128 && (mb->ctypes[cc] & ctype_space) != 0) RRETURN(MATCH_NOMATCH); Feptr++; @@ -3201,7 +3459,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, SCHECK_PARTIAL(); RRETURN(MATCH_NOMATCH); } - cc = UCHAR21(Feptr); + cc = *Feptr; if (cc >= 128 || (mb->ctypes[cc] & ctype_space) == 0) RRETURN(MATCH_NOMATCH); Feptr++; @@ -3218,7 +3476,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, SCHECK_PARTIAL(); RRETURN(MATCH_NOMATCH); } - cc = UCHAR21(Feptr); + cc = *Feptr; if (cc < 128 && (mb->ctypes[cc] & ctype_word) != 0) RRETURN(MATCH_NOMATCH); Feptr++; @@ -3235,7 +3493,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, SCHECK_PARTIAL(); RRETURN(MATCH_NOMATCH); } - cc = UCHAR21(Feptr); + cc = *Feptr; if (cc >= 128 || (mb->ctypes[cc] & ctype_word) == 0) RRETURN(MATCH_NOMATCH); Feptr++; @@ -3243,8 +3501,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, } break; + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } /* End switch(Lctype) */ else @@ -3495,8 +3756,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, } break; + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } } @@ -3516,27 +3780,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, { switch(proptype) { - case PT_ANY: - for (;;) - { - RMATCH(Fecode, RM208); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); - if (Feptr >= mb->end_subject) - { - SCHECK_PARTIAL(); - RRETURN(MATCH_NOMATCH); - } - GETCHARINCTEST(fc, Feptr); - if (Lctype == OP_NOTPROP) RRETURN(MATCH_NOMATCH); - } - /* Control never gets here */ - case PT_LAMP: for (;;) { int chartype; - RMATCH(Fecode, RM209); + RMATCH(Fecode, RM208); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3551,12 +3799,12 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, chartype == ucp_Lt) == (Lctype == OP_NOTPROP)) RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ case PT_GC: for (;;) { - RMATCH(Fecode, RM210); + RMATCH(Fecode, RM209); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3568,12 +3816,12 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if ((UCD_CATEGORY(fc) == Lpropvalue) == (Lctype == OP_NOTPROP)) RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ case PT_PC: for (;;) { - RMATCH(Fecode, RM211); + RMATCH(Fecode, RM210); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3585,12 +3833,12 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if ((UCD_CHARTYPE(fc) == Lpropvalue) == (Lctype == OP_NOTPROP)) RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ case PT_SC: for (;;) { - RMATCH(Fecode, RM212); + RMATCH(Fecode, RM211); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3602,14 +3850,14 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if ((UCD_SCRIPT(fc) == Lpropvalue) == (Lctype == OP_NOTPROP)) RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ case PT_SCX: for (;;) { BOOL ok; const ucd_record *prop; - RMATCH(Fecode, RM225); + RMATCH(Fecode, RM224); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3624,13 +3872,13 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if (ok == (Lctype == OP_NOTPROP)) RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ case PT_ALNUM: for (;;) { int category; - RMATCH(Fecode, RM213); + RMATCH(Fecode, RM212); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3643,7 +3891,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if ((category == ucp_L || category == ucp_N) == (Lctype == OP_NOTPROP)) RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ /* Perl space used to exclude VT, but from Perl 5.18 it is included, which means that Perl space and POSIX space are now identical. PCRE @@ -3653,7 +3901,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, case PT_PXSPACE: /* POSIX space */ for (;;) { - RMATCH(Fecode, RM214); + RMATCH(Fecode, RM213); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3675,13 +3923,13 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, break; } } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ case PT_WORD: for (;;) { int chartype, category; - RMATCH(Fecode, RM215); + RMATCH(Fecode, RM214); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3698,13 +3946,13 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, chartype == ucp_Pc) == (Lctype == OP_NOTPROP)) RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ case PT_CLIST: for (;;) { const uint32_t *cp; - RMATCH(Fecode, RM216); + RMATCH(Fecode, RM215); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3735,12 +3983,12 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, } } } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ case PT_UCNC: for (;;) { - RMATCH(Fecode, RM217); + RMATCH(Fecode, RM216); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3754,12 +4002,12 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, fc >= 0xe000) == (Lctype == OP_NOTPROP)) RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ case PT_BIDICL: for (;;) { - RMATCH(Fecode, RM224); + RMATCH(Fecode, RM223); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3771,14 +4019,14 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if ((UCD_BIDICLASS(fc) == Lpropvalue) == (Lctype == OP_NOTPROP)) RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ case PT_BOOL: for (;;) { BOOL ok; const ucd_record *prop; - RMATCH(Fecode, RM223); + RMATCH(Fecode, RM222); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3793,11 +4041,15 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if (ok == (Lctype == OP_NOTPROP)) RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ /* This should never occur */ + + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } } @@ -3808,7 +4060,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, { for (;;) { - RMATCH(Fecode, RM218); + RMATCH(Fecode, RM217); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3819,7 +4071,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, else { GETCHARINCTEST(fc, Feptr); - Feptr = PRIV(extuni)(fc, Feptr, mb->start_subject, mb->end_subject, + Feptr = PRIV(extuni)(fc, Feptr, mb->check_subject, mb->end_subject, utf, NULL); } CHECK_PARTIAL(); @@ -3835,7 +4087,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, { for (;;) { - RMATCH(Fecode, RM219); + RMATCH(Fecode, RM218); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Feptr >= mb->end_subject) @@ -3869,7 +4121,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, default: RRETURN(MATCH_NOMATCH); case CHAR_CR: - if (Feptr < mb->end_subject && UCHAR21(Feptr) == CHAR_LF) Feptr++; + if (Feptr < mb->end_subject && *Feptr == CHAR_LF) Feptr++; break; case CHAR_LF: @@ -3950,8 +4202,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, RRETURN(MATCH_NOMATCH); break; + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } } } @@ -4094,12 +4349,16 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, RRETURN(MATCH_NOMATCH); break; + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } } } - /* Control never gets here */ + + PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */ } /* If maximizing, it is worth using inline code for speed, doing the type @@ -4117,21 +4376,6 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, BOOL notmatch = Lctype == OP_NOTPROP; switch(proptype) { - case PT_ANY: - for (i = Lmin; i < Lmax; i++) - { - int len = 1; - if (Feptr >= mb->end_subject) - { - SCHECK_PARTIAL(); - break; - } - GETCHARLENTEST(fc, Feptr, len); - if (notmatch) break; - Feptr+= len; - } - break; - case PT_LAMP: for (i = Lmin; i < Lmax; i++) { @@ -4376,8 +4620,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, } break; + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } /* Feptr is now past the end of the maximum run */ @@ -4391,7 +4638,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, for(;;) { if (Feptr <= Lstart_eptr) break; - RMATCH(Fecode, RM222); + RMATCH(Fecode, RM221); if (rrc != MATCH_NOMATCH) RRETURN(rrc); Feptr--; if (utf) BACKCHAR(Feptr); @@ -4413,7 +4660,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, else { GETCHARINCTEST(fc, Feptr); - Feptr = PRIV(extuni)(fc, Feptr, mb->start_subject, mb->end_subject, + Feptr = PRIV(extuni)(fc, Feptr, mb->check_subject, mb->end_subject, utf, NULL); } CHECK_PARTIAL(); @@ -4434,7 +4681,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, PCRE2_SPTR fptr; if (Feptr <= Lstart_eptr) break; /* At start of char run */ - RMATCH(Fecode, RM220); + RMATCH(Fecode, RM219); if (rrc != MATCH_NOMATCH) RRETURN(rrc); /* Backtracking over an extended grapheme cluster involves inspecting @@ -4487,7 +4734,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, Feptr + 1 >= mb->end_subject && NLBLOCK->nltype == NLTYPE_FIXED && NLBLOCK->nllen == 2 && - UCHAR21(Feptr) == NLBLOCK->nl[0]) + *Feptr == NLBLOCK->nl[0]) { mb->hitend = TRUE; if (mb->partial > 1) return PCRE2_ERROR_PARTIAL; @@ -4543,7 +4790,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if (fc == CHAR_CR) { if (++Feptr >= mb->end_subject) break; - if (UCHAR21(Feptr) == CHAR_LF) Feptr++; + if (*Feptr == CHAR_LF) Feptr++; } else { @@ -4694,8 +4941,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, } break; + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } if (reptype == REPTYPE_POS) continue; /* No backtracking */ @@ -4707,12 +4957,12 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, for(;;) { if (Feptr <= Lstart_eptr) break; - RMATCH(Fecode, RM221); + RMATCH(Fecode, RM220); if (rrc != MATCH_NOMATCH) RRETURN(rrc); Feptr--; BACKCHAR(Feptr); if (Lctype == OP_ANYNL && Feptr > Lstart_eptr && - UCHAR21(Feptr) == CHAR_NL && UCHAR21(Feptr - 1) == CHAR_CR) + *Feptr == CHAR_NL && Feptr[-1] == CHAR_CR) Feptr--; } } @@ -4951,8 +5201,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, } break; + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } if (reptype == REPTYPE_POS) continue; /* No backtracking */ @@ -4985,19 +5238,22 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, OP_DNREFI are used. In this case we must scan the list of groups to which the name refers, and use the first one that is set. */ -#define Lmin F->temp_32[0] -#define Lmax F->temp_32[1] -#define Lcaseless F->temp_32[2] -#define Lstart F->temp_sptr[0] -#define Loffset F->temp_size +#define Lstart F->fields.ref_repeat.start +#define Loffset F->fields.ref_repeat.offset +#define Llength F->fields.ref_repeat.length +#define Lmin F->fields.ref_repeat.min +#define Lmax F->fields.ref_repeat.max +#define Lcaseless F->byte1 +#define Lcaseopts F->byte2 case OP_DNREF: case OP_DNREFI: - Lcaseless = (Fop == OP_DNREFI); + Lcaseless = (uint8_t)(Fop == OP_DNREFI); + Lcaseopts = (uint8_t)((Fop == OP_DNREFI)? Fecode[1 + 2*IMM2_SIZE] : 0); { int count = GET2(Fecode, 1+IMM2_SIZE); PCRE2_SPTR slot = mb->name_table + GET2(Fecode, 1) * mb->name_entry_size; - Fecode += 1 + 2*IMM2_SIZE; + Fecode += 1 + 2*IMM2_SIZE + (Fop == OP_DNREFI? 1 : 0); while (count-- > 0) { @@ -5011,8 +5267,9 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, case OP_REF: case OP_REFI: Lcaseless = (Fop == OP_REFI); + Lcaseopts = (Fop == OP_REFI)? Fecode[1 + IMM2_SIZE] : 0; Loffset = (GET2(Fecode, 1) << 1) - 2; - Fecode += 1 + IMM2_SIZE; + Fecode += 1 + IMM2_SIZE + (Fop == OP_REFI? 1 : 0); /* Set up for repetition, or handle the non-repeated case. The maximum and minimum must be in the heap frame, but as they are short-term values, we @@ -5027,6 +5284,9 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, case OP_CRMINPLUS: case OP_CRQUERY: case OP_CRMINQUERY: + case OP_CRPOSSTAR: + case OP_CRPOSPLUS: + case OP_CRPOSQUERY: fc = *Fecode++ - OP_CRSTAR; Lmin = rep_min[fc]; Lmax = rep_max[fc]; @@ -5035,6 +5295,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, case OP_CRRANGE: case OP_CRMINRANGE: + case OP_CRPOSRANGE: Lmin = GET2(Fecode, 1); Lmax = GET2(Fecode, 1 + IMM2_SIZE); reptype = rep_typ[*Fecode - OP_CRSTAR]; @@ -5044,7 +5305,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, default: /* No repeat follows */ { - rrc = match_ref(Loffset, Lcaseless, F, mb, &length); + rrc = match_ref(Loffset, Lcaseless, Lcaseopts, F, mb, &length); if (rrc != 0) { if (rrc > 0) Feptr = mb->end_subject; /* Partial match */ @@ -5078,7 +5339,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, for (i = 1; i <= Lmin; i++) { PCRE2_SIZE slength; - rrc = match_ref(Loffset, Lcaseless, F, mb, &slength); + rrc = match_ref(Loffset, Lcaseless, Lcaseopts, F, mb, &slength); if (rrc != 0) { if (rrc > 0) Feptr = mb->end_subject; /* Partial match */ @@ -5102,7 +5363,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, RMATCH(Fecode, RM20); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); - rrc = match_ref(Loffset, Lcaseless, F, mb, &slength); + rrc = match_ref(Loffset, Lcaseless, Lcaseopts, F, mb, &slength); if (rrc != 0) { if (rrc > 0) Feptr = mb->end_subject; /* Partial match */ @@ -5111,7 +5372,8 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, } Feptr += slength; } - /* Control never gets here */ + + PCRE2_UNREACHABLE(); /* Control never reaches here */ } /* If maximizing, find the longest string and work backwards, as long as @@ -5121,12 +5383,12 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, { BOOL samelengths = TRUE; Lstart = Feptr; /* Starting position */ - Flength = Fovector[Loffset+1] - Fovector[Loffset]; + Llength = Fovector[Loffset+1] - Fovector[Loffset]; for (i = Lmin; i < Lmax; i++) { PCRE2_SIZE slength; - rrc = match_ref(Loffset, Lcaseless, F, mb, &slength); + rrc = match_ref(Loffset, Lcaseless, Lcaseopts, F, mb, &slength); if (rrc != 0) { /* Can't use CHECK_PARTIAL because we don't want to update Feptr in @@ -5141,10 +5403,13 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, break; } - if (slength != Flength) samelengths = FALSE; + if (slength != Llength) samelengths = FALSE; Feptr += slength; } + /* No recursion if the repeat type is possessive. */ + if (reptype == REPTYPE_POS) break; + /* If the length matched for each repetition is the same as the length of the captured group, we can easily work backwards. This is the normal case. However, in caseless UTF-8 mode there are pairs of case-equivalent @@ -5157,7 +5422,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, { RMATCH(Fecode, RM21); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - Feptr -= Flength; + Feptr -= Llength; } } @@ -5177,7 +5442,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, for (i = Lmin; i < Lmax; i++) { PCRE2_SIZE slength; - (void)match_ref(Loffset, Lcaseless, F, mb, &slength); + (void)match_ref(Loffset, Lcaseless, Lcaseopts, F, mb, &slength); Feptr += slength; } } @@ -5185,14 +5450,16 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ -#undef Lcaseless -#undef Lmin -#undef Lmax + PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */ + #undef Lstart #undef Loffset - +#undef Llength +#undef Lmin +#undef Lmax +#undef Lcaseless +#undef Lcaseopts /* ========================================================================= */ @@ -5219,30 +5486,37 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, number of copies, with the optional ones preceded by BRAZERO or BRAMINZERO. Possessive groups with possible zero repeats are preceded by BRAPOSZERO. */ -#define Lnext_ecode F->temp_sptr[0] - case OP_BRAZERO: - Lnext_ecode = Fecode + 1; - RMATCH(Lnext_ecode, RM9); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - do Lnext_ecode += GET(Lnext_ecode, 1); while (*Lnext_ecode == OP_ALT); - Fecode = Lnext_ecode + 1 + LINK_SIZE; + { + PCRE2_SPTR next_ecode; + + Fecode++; + RMATCH(Fecode, RM9); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + next_ecode = Fecode; + do next_ecode += GET(next_ecode, 1); while (*next_ecode == OP_ALT); + Fecode = next_ecode + 1 + LINK_SIZE; + } break; case OP_BRAMINZERO: - Lnext_ecode = Fecode + 1; - do Lnext_ecode += GET(Lnext_ecode, 1); while (*Lnext_ecode == OP_ALT); - RMATCH(Lnext_ecode + 1 + LINK_SIZE, RM10); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - Fecode++; - break; + { + PCRE2_SPTR next_ecode; -#undef Lnext_ecode + Fecode++; + next_ecode = Fecode; + do next_ecode += GET(next_ecode, 1); while (*next_ecode == OP_ALT); + RMATCH(next_ecode + 1 + LINK_SIZE, RM10); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + } + break; case OP_SKIPZERO: - Fecode++; - do Fecode += GET(Fecode,1); while (*Fecode == OP_ALT); - Fecode += 1 + LINK_SIZE; + { + PCRE2_SPTR next_ecode = Fecode + 1; + do next_ecode += GET(next_ecode, 1); while (*next_ecode == OP_ALT); + Fecode = next_ecode + 1 + LINK_SIZE; + } break; @@ -5251,11 +5525,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, brackets will always be OP_KETRPOS, which returns MATCH_KETRPOS without going further in the pattern. */ -#define Lframe_type F->temp_32[0] -#define Lmatched_once F->temp_32[1] -#define Lzero_allowed F->temp_32[2] -#define Lstart_eptr F->temp_sptr[0] -#define Lstart_group F->temp_sptr[1] +#define Lstart_eptr F->fields.op_brapos.start_eptr +#define Lstart_group F->fields.op_brapos.start_group +#define Lframe_type F->fields.op_brapos.frame_type +#define Lmatched_once F->byte1 +#define Lzero_allowed F->byte2 case OP_BRAPOSZERO: Lzero_allowed = TRUE; /* Zero repeat is allowed */ @@ -5327,11 +5601,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, RRETURN(MATCH_NOMATCH); -#undef Lmatched_once -#undef Lzero_allowed -#undef Lframe_type #undef Lstart_eptr #undef Lstart_group +#undef Lframe_type +#undef Lmatched_once +#undef Lzero_allowed /* ===================================================================== */ @@ -5343,8 +5617,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, however, because that would make handling assertions and once-only brackets messier when there is nothing to go back to. */ -#define Lframe_type F->temp_32[0] /* Set for all that use GROUPLOOP */ -#define Lnext_branch F->temp_sptr[0] /* Used only in OP_BRA handling */ +#define Lframe_type F->fields.op_bra.frame_type case OP_BRA: if (mb->hasthen || Frdepth == 0) @@ -5355,24 +5628,31 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, for (;;) { - Lnext_branch = Fecode + GET(Fecode, 1); - if (*Lnext_branch != OP_ALT) break; + PCRE2_SPTR current_branch = Fecode; + PCRE2_SPTR next_branch = current_branch + GET(current_branch, 1); + + if (*next_branch != OP_ALT) break; /* This is never the final branch. We do not need to test for MATCH_THEN here because this code is not used when there is a THEN in the pattern. */ - RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM1); + Fecode = next_branch; + PCRE2_ASSERT((*current_branch == OP_BRA || *current_branch == OP_ALT) && + PRIV(OP_lengths)[OP_BRA] == 1 + LINK_SIZE && + PRIV(OP_lengths)[OP_ALT] == 1 + LINK_SIZE); + + RMATCH(current_branch + 1 + LINK_SIZE, RM1); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - Fecode = Lnext_branch; } /* Hit the start of the final branch. Continue at this level. */ - Fecode += PRIV(OP_lengths)[*Fecode]; + PCRE2_ASSERT((*Fecode == OP_BRA || *Fecode == OP_ALT) && + PRIV(OP_lengths)[OP_BRA] == 1 + LINK_SIZE && + PRIV(OP_lengths)[OP_ALT] == 1 + LINK_SIZE); + Fecode += 1 + LINK_SIZE; break; -#undef Lnext_branch - /* ===================================================================== */ /* Handle a capturing bracket, other than those that are possessive with an @@ -5391,7 +5671,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, case OP_ONCE: case OP_SCRIPT_RUN: case OP_SBRA: - Lframe_type = GF_NOCAPTURE | Fop; + Lframe_type = GF_NOCAPTURE; GROUPLOOP: for (;;) @@ -5409,7 +5689,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, Fecode += GET(Fecode, 1); if (*Fecode != OP_ALT) RRETURN(MATCH_NOMATCH); } - /* Control never reaches here. */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ #undef Lframe_type @@ -5421,8 +5701,8 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, subpatterns. For a whole-pattern recursion, we have to infer the number zero. */ -#define Lframe_type F->temp_32[0] -#define Lstart_branch F->temp_sptr[0] +#define Lstart_branch F->fields.op_recurse.start_branch +#define Lframe_type F->fields.op_recurse.frame_type case OP_RECURSE: bracode = mb->start_code + GET(Fecode, 1); @@ -5494,10 +5774,10 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, Lstart_branch = next_ecode; if (*Lstart_branch != OP_ALT) RRETURN(MATCH_NOMATCH); } - /* Control never reaches here. */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ -#undef Lframe_type #undef Lstart_branch +#undef Lframe_type /* ===================================================================== */ @@ -5506,16 +5786,13 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, treated as NOMATCH. (*ACCEPT) is treated as successful assertion, with its captures and mark retained. Any other return is an error. */ -#define Lframe_type F->temp_32[0] - case OP_ASSERT: case OP_ASSERTBACK: case OP_ASSERT_NA: case OP_ASSERTBACK_NA: - Lframe_type = GF_NOCAPTURE | Fop; for (;;) { - group_frame_type = Lframe_type; + group_frame_type = GF_NOCAPTURE; RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM3); if (rrc == MATCH_ACCEPT) { @@ -5535,22 +5812,16 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, Fecode += 1 + LINK_SIZE; break; -#undef Lframe_type - /* ===================================================================== */ /* Handle negative assertions. Loop for each non-matching branch as for positive assertions. */ -#define Lframe_type F->temp_32[0] - case OP_ASSERT_NOT: case OP_ASSERTBACK_NOT: - Lframe_type = GF_NOCAPTURE | Fop; - for (;;) { - group_frame_type = Lframe_type; + group_frame_type = GF_NOCAPTURE; RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM4); switch(rrc) { @@ -5583,7 +5854,131 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, Fecode += 1 + LINK_SIZE; break; -#undef Lframe_type + + /* ===================================================================== */ + /* Handle scan substring operation. */ + +#define Lsaved_end_subject F->fields.op_assert_scs.saved_end_subject +#define Lsaved_eptr F->fields.op_assert_scs.saved_eptr +#define Ltrue_end_extra F->fields.op_assert_scs.true_end_extra +#define Lextra_size F->fields.op_assert_scs.extra_size +#define Lsaved_moptions F->fields.op_assert_scs.saved_moptions + + case OP_ASSERT_SCS: + length = 0; + { + PCRE2_SPTR ecode = Fecode + 1 + LINK_SIZE; + int count; + PCRE2_SPTR slot; + + /* Disable compiler warning. */ + offset = 0; + (void)offset; + + for (;;) + { + if (*ecode == OP_CREF) + { + length += 1+IMM2_SIZE; + offset = (GET2(ecode, 1) << 1) - 2; + ecode += 1+IMM2_SIZE; + if (offset < Foffset_top && Fovector[offset] != PCRE2_UNSET) + goto SCS_OFFSET_FOUND; + continue; + } + + if (*ecode != OP_DNCREF) RRETURN(MATCH_NOMATCH); + + count = GET2(ecode, 1 + IMM2_SIZE); + slot = mb->name_table + GET2(ecode, 1) * mb->name_entry_size; + length += 1+2*IMM2_SIZE; + ecode += 1+2*IMM2_SIZE; + + while (count > 0) + { + offset = (GET2(slot, 0) << 1) - 2; + if (offset < Foffset_top && Fovector[offset] != PCRE2_UNSET) + goto SCS_OFFSET_FOUND; + slot += mb->name_entry_size; + count--; + } + } + + SCS_OFFSET_FOUND: + + /* Skip remaining options. */ + for (;;) + { + if (*ecode == OP_CREF) + { + length += 1+IMM2_SIZE; + ecode += 1+IMM2_SIZE; + } + else if (*ecode == OP_DNCREF) + { + length += 1+2*IMM2_SIZE; + ecode += 1+2*IMM2_SIZE; + } + else break; + } + } + + Lsaved_end_subject = mb->end_subject; + Ltrue_end_extra = mb->true_end_subject - mb->end_subject; + Lsaved_eptr = Feptr; + Lsaved_moptions = mb->moptions; + + Feptr = mb->start_subject + Fovector[offset]; + mb->true_end_subject = mb->end_subject = + mb->start_subject + Fovector[offset + 1]; + mb->moptions &= ~PCRE2_NOTEOL; + + for (;;) + { + group_frame_type = GF_NOCAPTURE; + RMATCH(Fecode + 1 + LINK_SIZE + length, RM38); + if (rrc == MATCH_ACCEPT) + { + memcpy(Fovector, + (char *)assert_accept_frame + offsetof(heapframe, ovector), + assert_accept_frame->offset_top * sizeof(PCRE2_SIZE)); + Foffset_top = assert_accept_frame->offset_top; + Fmark = assert_accept_frame->mark; + mb->end_subject = Lsaved_end_subject; + mb->true_end_subject = mb->end_subject + Ltrue_end_extra; + mb->moptions = Lsaved_moptions; + break; + } + + if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) + { + mb->end_subject = Lsaved_end_subject; + mb->true_end_subject = mb->end_subject + Ltrue_end_extra; + mb->moptions = Lsaved_moptions; + RRETURN(rrc); + } + + Fecode += GET(Fecode, 1); + if (*Fecode != OP_ALT) + { + mb->end_subject = Lsaved_end_subject; + mb->true_end_subject = mb->end_subject + Ltrue_end_extra; + mb->moptions = Lsaved_moptions; + RRETURN(MATCH_NOMATCH); + } + length = 0; + } + + do Fecode += GET(Fecode, 1); while (*Fecode == OP_ALT); + Fecode += 1 + LINK_SIZE; + Feptr = Lsaved_eptr; + break; + +#undef Lsaved_end_subject +#undef Lsaved_eptr +#undef Ltrue_end_extra +#undef Lextra_size +#undef Lsave_moptions /* ===================================================================== */ @@ -5606,18 +6001,22 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, past the end of the item if there is only one branch, but that's exactly what we want. */ +#define Lstart_branch F->fields.op_cond.start_branch +#define Llength F->fields.op_cond.length +#define Lpositive F->byte1 + case OP_COND: case OP_SCOND: - /* The variable Flength will be added to Fecode when the condition is + /* The variable Llength will be added to Fecode when the condition is false, to get to the second branch. Setting it to the offset to the ALT or KET, then incrementing Fecode achieves this effect. However, if the second branch is non-existent, we must point to the KET so that the end of the group is correctly processed. We now have Fecode pointing to the condition or callout. */ - Flength = GET(Fecode, 1); /* Offset to the second branch */ - if (Fecode[Flength] != OP_ALT) Flength -= 1 + LINK_SIZE; + Llength = GET(Fecode, 1); /* Offset to the second branch */ + if (Fecode[Llength] != OP_ALT) Llength -= 1 + LINK_SIZE; Fecode += 1 + LINK_SIZE; /* From this opcode */ /* Because of the way auto-callout works during compile, a callout item is @@ -5631,10 +6030,10 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if (rrc < 0) RRETURN(rrc); /* Advance Fecode past the callout, so it now points to the condition. We - must adjust Flength so that the value of Fecode+Flength is unchanged. */ + must adjust Llength so that the value of Fecode+Llength is unchanged. */ Fecode += length; - Flength -= length; + Llength -= length; } /* Test the various possible conditions */ @@ -5695,16 +6094,14 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, /* The condition is an assertion. Run code similar to the assertion code above. */ -#define Lpositive F->temp_32[0] -#define Lstart_branch F->temp_sptr[0] default: - Lpositive = (*Fecode == OP_ASSERT || *Fecode == OP_ASSERTBACK); + Lpositive = (uint8_t)(*Fecode == OP_ASSERT || *Fecode == OP_ASSERTBACK); Lstart_branch = Fecode; for (;;) { - group_frame_type = GF_CONDASSERT | *Fecode; + group_frame_type = GF_CONDASSERT; RMATCH(Lstart_branch + PRIV(OP_lengths)[*Lstart_branch], RM5); switch(rrc) @@ -5715,7 +6112,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, assert_accept_frame->offset_top * sizeof(PCRE2_SIZE)); Foffset_top = assert_accept_frame->offset_top; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* In the case of a match, the captures have already been put into the current frame. */ @@ -5757,12 +6154,9 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, break; /* End of assertion condition */ } -#undef Lpositive -#undef Lstart_branch - /* Choose branch according to the condition. */ - Fecode += condition? PRIV(OP_lengths)[*Fecode] : Flength; + Fecode += condition? PRIV(OP_lengths)[*Fecode] : Llength; /* If the opcode is OP_SCOND it means we are at a repeated conditional group that might match an empty string. We must therefore descend a level @@ -5771,12 +6165,15 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if (Fop == OP_SCOND) { - group_frame_type = GF_NOCAPTURE | Fop; + group_frame_type = GF_NOCAPTURE; RMATCH(Fecode, RM35); RRETURN(rrc); } break; +#undef Lstart_branch +#undef Llength +#undef Lpositive /* ========================================================================= */ @@ -5795,8 +6192,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, #ifdef SUPPORT_UNICODE if (utf) { - while (number-- > 0) + /* We used to do a simpler `while (number-- > 0)` but that triggers + clang's unsigned integer overflow sanitizer. */ + while (number > 0) { + --number; if (Feptr <= mb->check_subject) RRETURN(MATCH_NOMATCH); Feptr--; BACKCHAR(Feptr); @@ -5827,14 +6227,12 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, the start to move back even the minimum amount, fail. When working with UTF-8 we move back a number of characters, not bytes. */ -#define Lmin F->temp_32[0] -#define Lmax F->temp_32[1] -#define Leptr F->temp_sptr[0] +#define Lmin F->fields.op_vreverse.min +#define Lmax F->fields.op_vreverse.max case OP_VREVERSE: Lmin = GET2(Fecode, 1); Lmax = GET2(Fecode, 1 + IMM2_SIZE); - Leptr = Feptr; /* Move back by the maximum branch length and then work forwards. This ensures that items such as \d{3,5} get the maximum length, which is @@ -5845,7 +6243,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, { for (i = 0; i < Lmax; i++) { - if (Feptr == mb->start_subject) + if (Feptr <= mb->check_subject) { if (i < Lmin) RRETURN(MATCH_NOMATCH); Lmax = i; @@ -5869,7 +6267,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, } /* Now try matching, moving forward one character on failure, until we - reach the mimimum back length. */ + reach the minimum back length. */ for (;;) { @@ -5881,11 +6279,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if (utf) { FORWARDCHARTEST(Feptr, mb->end_subject); } #endif } - /* Control never reaches here */ + PCRE2_UNREACHABLE(); /* Control never reaches here */ #undef Lmin #undef Lmax -#undef Leptr + /* ===================================================================== */ /* An alternation is the end of a branch; scan along to find the end of the @@ -5931,14 +6329,20 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, (char *)P->eptr - (char *)mb->start_subject); #endif - /* If we are at the end of an assertion that is a condition, return a - match, discarding any intermediate backtracking points. Copy back the - mark setting and the captures into the frame before N so that they are - set on return. Doing this for all assertions, both positive and negative, - seems to match what Perl does. */ + /* If we are at the end of an assertion that is a condition, first check + to see if we are at the end of a variable-length branch in a lookbehind. + If this is the case and we have not landed on the current character, + return no match. Compare code below for non-condition lookbehinds. In + other cases, return a match, discarding any intermediate backtracking + points. Copy back the mark setting and the captures into the frame before + N so that they are set on return. Doing this for all assertions, both + positive and negative, seems to match what Perl does. */ - if (GF_IDMASK(N->group_frame_type) == GF_CONDASSERT) + if (N->group_frame_type == GF_CONDASSERT) { + if ((*bracode == OP_ASSERTBACK || *bracode == OP_ASSERTBACK_NOT) && + branch_start[1 + LINK_SIZE] == OP_VREVERSE && Feptr != P->eptr) + RRETURN(MATCH_NOMATCH); memcpy((char *)P + offsetof(heapframe, ovector), Fovector, Foffset_top * sizeof(PCRE2_SIZE)); P->offset_top = Foffset_top; @@ -5967,7 +6371,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, /* It is the end of whole-pattern recursion. */ offset = Flast_group_offset; + + /* Corrupted heapframes?. Trigger an assert and return an error */ + PCRE2_ASSERT(offset != PCRE2_UNSET); if (offset == PCRE2_UNSET) return PCRE2_ERROR_INTERNAL; + N = (heapframe *)((char *)match_data->heapframes + offset); P = (heapframe *)((char *)N - frame_size); Flast_group_offset = P->last_group_offset; @@ -5975,12 +6383,18 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, /* Reinstate the previous set of captures and then carry on after the recursion call. */ - memcpy((char *)F + offsetof(heapframe, ovector), P->ovector, - Foffset_top * sizeof(PCRE2_SIZE)); - Foffset_top = P->offset_top; + Fecode = P->ecode + 1 + LINK_SIZE; + + if (*Fecode != OP_CREF) + { + memcpy(F->ovector, P->ovector, Foffset_top * sizeof(PCRE2_SIZE)); + Foffset_top = P->offset_top; + } + else + recurse_update_offsets(F, P); + Fcapture_last = P->capture_last; Fcurrent_recurse = P->current_recurse; - Fecode = P->ecode + 1 + LINK_SIZE; continue; /* With next opcode */ case OP_COND: /* No need to do anything for these */ @@ -5994,7 +6408,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, case OP_ASSERTBACK_NA: if (branch_start[1 + LINK_SIZE] == OP_VREVERSE && Feptr != P->eptr) RRETURN(MATCH_NOMATCH); - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_ASSERT_NA: if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr; @@ -6008,12 +6422,12 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, case OP_ASSERTBACK: if (branch_start[1 + LINK_SIZE] == OP_VREVERSE && Feptr != P->eptr) RRETURN(MATCH_NOMATCH); - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_ASSERT: if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr; Feptr = P->eptr; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* For an atomic group, discard internal backtracking points. We must also ensure that any remaining branches within the top-level of the group @@ -6037,11 +6451,28 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, case OP_ASSERTBACK_NOT: if (branch_start[1 + LINK_SIZE] == OP_VREVERSE && Feptr != P->eptr) RRETURN(MATCH_NOMATCH); - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_ASSERT_NOT: RRETURN(MATCH_MATCH); + /* A scan substring group must preserve the current end_subject, + and restore it before the backtracking is performed into its sub + pattern. */ + + case OP_ASSERT_SCS: + F->fields.op_assert_scs.saved_end_subject = mb->end_subject; + mb->end_subject = P->fields.op_assert_scs.saved_end_subject; + mb->true_end_subject = mb->end_subject + P->fields.op_assert_scs.true_end_extra; + Feptr = P->fields.op_assert_scs.saved_eptr; + + RMATCH(Fecode + 1 + LINK_SIZE, RM39); + + mb->end_subject = F->fields.op_assert_scs.saved_end_subject; + mb->true_end_subject = mb->end_subject; + RRETURN(rrc); + break; + /* At the end of a script run, apply the script-checking rules. This code will never by exercised if Unicode support it not compiled, because in that environment script runs cause an error at compile time. */ @@ -6065,12 +6496,18 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if (Fcurrent_recurse == number) { P = (heapframe *)((char *)N - frame_size); - memcpy((char *)F + offsetof(heapframe, ovector), P->ovector, - Foffset_top * sizeof(PCRE2_SIZE)); - Foffset_top = P->offset_top; + Fecode = P->ecode + 1 + LINK_SIZE; + + if (*Fecode != OP_CREF) + { + memcpy(F->ovector, P->ovector, Foffset_top * sizeof(PCRE2_SIZE)); + Foffset_top = P->offset_top; + } + else + recurse_update_offsets(F, P); + Fcapture_last = P->capture_last; Fcurrent_recurse = P->current_recurse; - Fecode = P->ecode + 1 + LINK_SIZE; continue; /* With next opcode */ } @@ -6148,7 +6585,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, if ((mb->moptions & PCRE2_NOTEOL) != 0) RRETURN(MATCH_NOMATCH); if ((mb->poptions & PCRE2_DOLLAR_ENDONLY) == 0) goto ASSERT_NL_OR_EOS; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* Unconditional end of subject assertion (\z). */ case OP_EOD: @@ -6165,14 +6602,14 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, case OP_EODN: ASSERT_NL_OR_EOS: - if (Feptr < mb->end_subject && - (!IS_NEWLINE(Feptr) || Feptr != mb->end_subject - mb->nllen)) + if (Feptr < mb->true_end_subject && + (!IS_NEWLINE(Feptr) || Feptr != mb->true_end_subject - mb->nllen)) { if (mb->partial != 0 && Feptr + 1 >= mb->end_subject && NLBLOCK->nltype == NLTYPE_FIXED && NLBLOCK->nllen == 2 && - UCHAR21TEST(Feptr) == NLBLOCK->nl[0]) + *Feptr == NLBLOCK->nl[0]) { mb->hitend = TRUE; if (mb->partial > 1) return PCRE2_ERROR_PARTIAL; @@ -6220,7 +6657,7 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, Feptr + 1 >= mb->end_subject && NLBLOCK->nltype == NLTYPE_FIXED && NLBLOCK->nllen == 2 && - UCHAR21TEST(Feptr) == NLBLOCK->nl[0]) + *Feptr == NLBLOCK->nl[0]) { mb->hitend = TRUE; if (mb->partial > 1) return PCRE2_ERROR_PARTIAL; @@ -6446,8 +6883,11 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, /* There's been some horrible disaster. Arrival here can only mean there is something seriously wrong in the code above or the OP_xxx definitions. */ + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } /* Do not insert any code in here without much thought; it is assumed @@ -6455,8 +6895,8 @@ fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode, loop. */ } /* End of main loop */ -/* Control never reaches here */ +PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */ /* ========================================================================= */ /* The RRETURN() macro jumps here. The number that is saved in Freturn_id @@ -6482,21 +6922,24 @@ switch (Freturn_id) LBL( 9) LBL(10) LBL(11) LBL(12) LBL(13) LBL(14) LBL(15) LBL(16) LBL(17) LBL(18) LBL(19) LBL(20) LBL(21) LBL(22) LBL(23) LBL(24) LBL(25) LBL(26) LBL(27) LBL(28) LBL(29) LBL(30) LBL(31) LBL(32) - LBL(33) LBL(34) LBL(35) LBL(36) LBL(37) + LBL(33) LBL(34) LBL(35) LBL(36) LBL(37) LBL(38) LBL(39) #ifdef SUPPORT_WIDE_CHARS - LBL(100) LBL(101) + LBL(100) LBL(101) LBL(102) LBL(103) #endif #ifdef SUPPORT_UNICODE LBL(200) LBL(201) LBL(202) LBL(203) LBL(204) LBL(205) LBL(206) LBL(207) LBL(208) LBL(209) LBL(210) LBL(211) LBL(212) LBL(213) LBL(214) LBL(215) LBL(216) LBL(217) LBL(218) LBL(219) LBL(220) - LBL(221) LBL(222) LBL(223) LBL(224) LBL(225) + LBL(221) LBL(222) LBL(223) LBL(224) #endif + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } #undef LBL } @@ -6532,9 +6975,9 @@ pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length, pcre2_match_context *mcontext) { int rc; -int was_zero_terminated = 0; const uint8_t *start_bits = NULL; const pcre2_real_code *re = (const pcre2_real_code *)code; +uint32_t original_options = options; BOOL anchored; BOOL firstline; @@ -6552,6 +6995,8 @@ PCRE2_UCHAR first_cu2 = 0; PCRE2_UCHAR req_cu = 0; PCRE2_UCHAR req_cu2 = 0; +PCRE2_UCHAR null_str[1] = { 0xcd }; +PCRE2_SPTR original_subject = subject; PCRE2_SPTR bumpalong_limit; PCRE2_SPTR end_subject; PCRE2_SPTR true_end_subject; @@ -6560,10 +7005,6 @@ PCRE2_SPTR req_cu_ptr; PCRE2_SPTR start_partial; PCRE2_SPTR match_partial; -#ifdef SUPPORT_JIT -BOOL use_jit; -#endif - /* This flag is needed even when Unicode is not supported for convenience (it is used by the IS_NEWLINE macro). */ @@ -6573,9 +7014,6 @@ BOOL utf = FALSE; BOOL ucp = FALSE; BOOL allow_invalid; uint32_t fragment_options = 0; -#ifdef SUPPORT_JIT -BOOL jit_checked_utf = FALSE; -#endif #endif /* SUPPORT_UNICODE */ PCRE2_SIZE frame_size; @@ -6590,38 +7028,40 @@ match_block *mb = &actual_match_block; /* Recognize NULL, length 0 as an empty string. */ -if (subject == NULL && length == 0) subject = (PCRE2_SPTR)""; +if (subject == NULL && length == 0) subject = null_str; /* Plausibility checks */ -if ((options & ~PUBLIC_MATCH_OPTIONS) != 0) return PCRE2_ERROR_BADOPTION; -if (code == NULL || subject == NULL || match_data == NULL) - return PCRE2_ERROR_NULL; +if (match_data == NULL) return PCRE2_ERROR_NULL; +if (code == NULL || subject == NULL) + return match_data->rc = PCRE2_ERROR_NULL; +if ((options & ~PUBLIC_MATCH_OPTIONS) != 0) + return match_data->rc = PCRE2_ERROR_BADOPTION; start_match = subject + start_offset; req_cu_ptr = start_match - 1; if (length == PCRE2_ZERO_TERMINATED) { length = PRIV(strlen)(subject); - was_zero_terminated = 1; } true_end_subject = end_subject = subject + length; -if (start_offset > length) return PCRE2_ERROR_BADOFFSET; +if (start_offset > length) return match_data->rc = PCRE2_ERROR_BADOFFSET; /* Check that the first field in the block is the magic number. */ -if (re->magic_number != MAGIC_NUMBER) return PCRE2_ERROR_BADMAGIC; +if (re->magic_number != MAGIC_NUMBER) + return match_data->rc = PCRE2_ERROR_BADMAGIC; /* Check the code unit width. */ if ((re->flags & PCRE2_MODE_MASK) != PCRE2_CODE_UNIT_WIDTH/8) - return PCRE2_ERROR_BADMODE; + return match_data->rc = PCRE2_ERROR_BADMODE; /* PCRE2_NOTEMPTY and PCRE2_NOTEMPTY_ATSTART are match-time flags in the options variable for this function. Users of PCRE2 who are not calling the function directly would like to have a way of setting these flags, in the same -way that they can set pcre2_compile() flags like PCRE2_NO_AUTOPOSSESS with +way that they can set pcre2_compile() flags like PCRE2_NO_AUTO_POSSESS with constructions like (*NO_AUTOPOSSESS). To enable this, (*NOTEMPTY) and (*NOTEMPTY_ATSTART) set bits in the pattern's "flag" function which we now transfer to the options for this function. The bits are guaranteed to be @@ -6636,15 +7076,6 @@ options |= (re->flags & FF) / ((FF & (~FF+1)) / (OO & (~OO+1))); #undef FF #undef OO -/* If the pattern was successfully studied with JIT support, we will run the -JIT executable instead of the rest of this function. Most options must be set -at compile time for the JIT code to be usable. */ - -#ifdef SUPPORT_JIT -use_jit = (re->executable_jit != NULL && - (options & ~PUBLIC_JIT_MATCH_OPTIONS) == 0); -#endif - /* Initialize UTF/UCP parameters. */ #ifdef SUPPORT_UNICODE @@ -6663,17 +7094,18 @@ time. */ if (mb->partial != 0 && ((re->overall_options | options) & PCRE2_ENDANCHORED) != 0) - return PCRE2_ERROR_BADOPTION; + return match_data->rc = PCRE2_ERROR_BADOPTION; /* It is an error to set an offset limit without setting the flag at compile time. */ if (mcontext != NULL && mcontext->offset_limit != PCRE2_UNSET && (re->overall_options & PCRE2_USE_OFFSET_LIMIT) == 0) - return PCRE2_ERROR_BADOFFSETLIMIT; + return match_data->rc = PCRE2_ERROR_BADOFFSETLIMIT; /* If the match data block was previously used with PCRE2_COPY_MATCHED_SUBJECT, -free the memory that was obtained. Set the field to NULL for no match cases. */ +free the memory that was obtained. Set the field to NULL for match error +cases. */ if ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0) { @@ -6690,34 +7122,36 @@ match_data->startchar = 0; /* ============================= JIT matching ============================== */ -/* Prepare for JIT matching. Check a UTF string for validity unless no check is -requested or invalid UTF can be handled. We check only the portion of the -subject that might be be inspected during matching - from the offset minus the -maximum lookbehind to the given length. This saves time when a small part of a -large subject is being matched by the use of a starting offset. Note that the -maximum lookbehind is a number of characters, not code units. */ +/* If the pattern was successfully studied with JIT support, we will run the +JIT executable instead of the rest of this function. Most options must be set +at compile time for the JIT code to be usable. */ #ifdef SUPPORT_JIT -if (use_jit) +if (re->executable_jit != NULL && + (options & ~PUBLIC_JIT_MATCH_OPTIONS) == 0 && + PRIV(jit_check_exec)(re->executable_jit, options)) { + /* Prepare for JIT matching. Check a UTF string for validity unless no check + is requested or invalid UTF can be handled. We check only the portion of the + subject that might be be inspected during matching - from the offset minus + the maximum lookbehind to the given length. This saves time when a small part + of a large subject is being matched by the use of a starting offset. Note that + the maximum lookbehind is a number of characters, not code units. */ + #ifdef SUPPORT_UNICODE if (utf && (options & PCRE2_NO_UTF_CHECK) == 0 && !allow_invalid) { -#if PCRE2_CODE_UNIT_WIDTH != 32 - unsigned int i; -#endif - /* For 8-bit and 16-bit UTF, check that the first code unit is a valid character start. */ #if PCRE2_CODE_UNIT_WIDTH != 32 if (start_match < end_subject && NOT_FIRSTCU(*start_match)) { - if (start_offset > 0) return PCRE2_ERROR_BADUTFOFFSET; + if (start_offset > 0) return match_data->rc = PCRE2_ERROR_BADUTFOFFSET; #if PCRE2_CODE_UNIT_WIDTH == 8 - return PCRE2_ERROR_UTF8_ERR20; /* Isolated 0x80 byte */ + return match_data->rc = PCRE2_ERROR_UTF8_ERR20; /* Isolated 0x80 byte */ #else - return PCRE2_ERROR_UTF16_ERR3; /* Isolated low surrogate */ + return match_data->rc = PCRE2_ERROR_UTF16_ERR3; /* Isolated low surrogate */ #endif } #endif /* WIDTH != 32 */ @@ -6726,7 +7160,7 @@ if (use_jit) start of matching. */ #if PCRE2_CODE_UNIT_WIDTH != 32 - for (i = re->max_lookbehind; i > 0 && start_match > subject; i--) + for (unsigned int i = re->max_lookbehind; i > 0 && start_match > subject; i--) { start_match--; while (start_match > subject && @@ -6752,36 +7186,43 @@ if (use_jit) /* Validate the relevant portion of the subject. Adjust the offset of an invalid code point to be an absolute offset in the whole string. */ - match_data->rc = PRIV(valid_utf)(start_match, + rc = PRIV(valid_utf)(start_match, length - (start_match - subject), &(match_data->startchar)); - if (match_data->rc != 0) + if (rc != 0) { match_data->startchar += start_match - subject; - return match_data->rc; + return match_data->rc = rc; } - jit_checked_utf = TRUE; } #endif /* SUPPORT_UNICODE */ - /* If JIT returns BADOPTION, which means that the selected complete or - partial matching mode was not compiled, fall through to the interpreter. */ - rc = pcre2_jit_match(code, subject, length, start_offset, options, match_data, mcontext); - if (rc != PCRE2_ERROR_JIT_BADOPTION) + /* JIT must be able to perform the match. */ + PCRE2_ASSERT(rc != PCRE2_ERROR_JIT_BADOPTION); + + match_data->options = original_options; + if (rc >= 0 && (options & PCRE2_COPY_MATCHED_SUBJECT) != 0) { - match_data->subject_length = length; - if (rc >= 0 && (options & PCRE2_COPY_MATCHED_SUBJECT) != 0) + if (length != 0) { - length = CU2BYTES(length + was_zero_terminated); - match_data->subject = match_data->memctl.malloc(length, + match_data->subject = match_data->memctl.malloc(CU2BYTES(length), match_data->memctl.memory_data); - if (match_data->subject == NULL) return PCRE2_ERROR_NOMEMORY; - memcpy((void *)match_data->subject, subject, length); - match_data->flags |= PCRE2_MD_COPIED_SUBJECT; + if (match_data->subject == NULL) + return match_data->rc = PCRE2_ERROR_NOMEMORY; + memcpy((void *)match_data->subject, subject, CU2BYTES(length)); } - return rc; + else + match_data->subject = NULL; + match_data->flags |= PCRE2_MD_COPIED_SUBJECT; } + else + { + /* When pcre2_jit_match sets the subject, it doesn't know what the + original passed-in pointer was. */ + if (match_data->subject != NULL) match_data->subject = original_subject; + } + return rc; } #endif /* SUPPORT_JIT */ @@ -6794,12 +7235,8 @@ this. */ mb->check_subject = subject; -/* If a UTF subject string was not checked for validity in the JIT code above, -check it here, and handle support for invalid UTF strings. The check above -happens only when invalid UTF is not supported and PCRE2_NO_CHECK_UTF is unset. -If we get here in those circumstances, it means the subject string is valid, -but for some reason JIT matching was not successful. There is no need to check -the subject again. +/* Check the validity of UTF subject strings. The check happens only when +PCRE2_NO_CHECK_UTF is unset. We check only the portion of the subject that might be be inspected during matching - from the offset minus the maximum lookbehind to the given length. @@ -6811,11 +7248,7 @@ Note also that support for invalid UTF forces a check, overriding the setting of PCRE2_NO_CHECK_UTF. */ #ifdef SUPPORT_UNICODE -if (utf && -#ifdef SUPPORT_JIT - !jit_checked_utf && -#endif - ((options & PCRE2_NO_UTF_CHECK) == 0 || allow_invalid)) +if (utf && ((options & PCRE2_NO_UTF_CHECK) == 0 || allow_invalid)) { #if PCRE2_CODE_UNIT_WIDTH != 32 BOOL skipped_bad_start = FALSE; @@ -6836,11 +7269,11 @@ if (utf && } else if (start_match < end_subject && NOT_FIRSTCU(*start_match)) { - if (start_offset > 0) return PCRE2_ERROR_BADUTFOFFSET; + if (start_offset > 0) return match_data->rc = PCRE2_ERROR_BADUTFOFFSET; #if PCRE2_CODE_UNIT_WIDTH == 8 - return PCRE2_ERROR_UTF8_ERR20; /* Isolated 0x80 byte */ + return match_data->rc = PCRE2_ERROR_UTF8_ERR20; /* Isolated 0x80 byte */ #else - return PCRE2_ERROR_UTF16_ERR3; /* Isolated low surrogate */ + return match_data->rc = PCRE2_ERROR_UTF16_ERR3; /* Isolated low surrogate */ #endif } #endif /* WIDTH != 32 */ @@ -6888,10 +7321,10 @@ if (utf && for (;;) { - match_data->rc = PRIV(valid_utf)(mb->check_subject, + rc = PRIV(valid_utf)(mb->check_subject, length - (mb->check_subject - subject), &(match_data->startchar)); - if (match_data->rc == 0) break; /* Valid UTF string */ + if (rc == 0) break; /* Valid UTF string */ /* Invalid UTF string. Adjust the offset to be an absolute offset in the whole string. If we are handling invalid UTF strings, set end_subject to @@ -6899,7 +7332,7 @@ if (utf && Otherwise return the error. */ match_data->startchar += mb->check_subject - subject; - if (!allow_invalid || match_data->rc > 0) return match_data->rc; + if (!allow_invalid || rc > 0) return match_data->rc = rc; end_subject = subject + match_data->startchar; /* If the end precedes start_match, it means there is invalid UTF in the @@ -6964,8 +7397,11 @@ mb->start_offset = start_offset; mb->end_subject = end_subject; mb->true_end_subject = true_end_subject; mb->hasthen = (re->flags & PCRE2_HASTHEN) != 0; +mb->hasbsk = (re->flags & PCRE2_HASBSK) != 0; mb->allowemptypartial = (re->max_lookbehind > 0) || (re->flags & PCRE2_MATCH_EMPTY) != 0; +mb->allowlookaroundbsk = + (re->extra_options & PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK) != 0; mb->poptions = re->overall_options; /* Pattern options */ mb->ignore_skip_arg = 0; mb->mark = mb->nomatch_mark = NULL; /* In case never set */ @@ -6973,10 +7409,10 @@ mb->mark = mb->nomatch_mark = NULL; /* In case never set */ /* The name table is needed for finding all the numbers associated with a given name, for condition testing. The code follows the name table. */ -mb->name_table = (PCRE2_UCHAR *)((uint8_t *)re + sizeof(pcre2_real_code)); +mb->name_table = (PCRE2_SPTR)((const uint8_t *)re + sizeof(pcre2_real_code)); mb->name_count = re->name_count; mb->name_entry_size = re->name_entry_size; -mb->start_code = mb->name_table + re->name_count * re->name_entry_size; +mb->start_code = (PCRE2_SPTR)((const uint8_t *)re + re->code_start); /* Process the \R and newline settings. */ @@ -7013,7 +7449,11 @@ switch(re->newline_convention) mb->nltype = NLTYPE_ANYCRLF; break; - default: return PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_START */ + default: + PCRE2_DEBUG_UNREACHABLE(); + return match_data->rc = PCRE2_ERROR_INTERNAL; + /* LCOV_EXCL_STOP */ } /* The backtracking frames have fixed data at the front, and a PCRE2_SIZE @@ -7055,7 +7495,7 @@ if (heapframes_size < START_FRAMES_SIZE) heapframes_size = START_FRAMES_SIZE; if (heapframes_size / 1024 > mb->heap_limit) { PCRE2_SIZE max_size = 1024 * mb->heap_limit; - if (max_size < frame_size) return PCRE2_ERROR_HEAPLIMIT; + if (max_size < frame_size) return match_data->rc = PCRE2_ERROR_HEAPLIMIT; heapframes_size = max_size; } @@ -7071,7 +7511,7 @@ if (match_data->heapframes_size < heapframes_size) if (match_data->heapframes == NULL) { match_data->heapframes_size = 0; - return PCRE2_ERROR_NOMEMORY; + return match_data->rc = PCRE2_ERROR_NOMEMORY; } match_data->heapframes_size = heapframes_size; } @@ -7159,7 +7599,7 @@ for(;;) However, there is an option (settable at compile time) that disables these, for testing and for ensuring that all callouts do actually occur. */ - if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0) + if ((re->optimization_flags & PCRE2_OPTIM_START_OPTIMIZE) != 0) { /* If firstline is TRUE, the start of the match is constrained to the first line of a multiline string. That is, the match must be before or at the @@ -7196,7 +7636,7 @@ for(;;) BOOL ok = start_match < end_subject; if (ok) { - PCRE2_UCHAR c = UCHAR21TEST(start_match); + PCRE2_UCHAR c = *start_match; ok = has_first_cu && (c == first_cu || c == first_cu2); if (!ok && start_bits != NULL) { @@ -7228,7 +7668,7 @@ for(;;) #if PCRE2_CODE_UNIT_WIDTH != 8 PCRE2_UCHAR smc; while (start_match < end_subject && - (smc = UCHAR21TEST(start_match)) != first_cu && + (smc = *start_match) != first_cu && smc != first_cu2) start_match++; #else @@ -7288,7 +7728,7 @@ for(;;) else { #if PCRE2_CODE_UNIT_WIDTH != 8 - while (start_match < end_subject && UCHAR21TEST(start_match) != + while (start_match < end_subject && *start_match != first_cu) start_match++; #else @@ -7343,7 +7783,7 @@ for(;;) if (start_match[-1] == CHAR_CR && (mb->nltype == NLTYPE_ANY || mb->nltype == NLTYPE_ANYCRLF) && start_match < end_subject && - UCHAR21TEST(start_match) == CHAR_NL) + *start_match == CHAR_NL) start_match++; } } @@ -7357,7 +7797,7 @@ for(;;) { while (start_match < end_subject) { - uint32_t c = UCHAR21TEST(start_match); + uint32_t c = *start_match; #if PCRE2_CODE_UNIT_WIDTH != 8 if (c > 255) c = 255; #endif @@ -7431,7 +7871,7 @@ for(;;) #if PCRE2_CODE_UNIT_WIDTH != 8 while (p < end_subject) { - uint32_t pp = UCHAR21INCTEST(p); + uint32_t pp = *p++; if (pp == req_cu || pp == req_cu2) { p--; break; } } #else /* 8-bit code units */ @@ -7452,7 +7892,7 @@ for(;;) #if PCRE2_CODE_UNIT_WIDTH != 8 while (p < end_subject) { - if (UCHAR21INCTEST(p) == req_cu) { p--; break; } + if (*p++ == req_cu) { p--; break; } } #else /* 8-bit code units */ @@ -7547,7 +7987,7 @@ for(;;) new_start_match = mb->verb_skip_ptr; break; } - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* NOMATCH and PRUNE advance by one character. THEN at this level acts exactly like PRUNE. Unset ignore SKIP-with-argument. */ @@ -7705,6 +8145,7 @@ if (utf && end_subject != true_end_subject && match_data->code = re; match_data->mark = mb->mark; match_data->matchedby = PCRE2_MATCHEDBY_INTERPRETER; +match_data->options = original_options; /* Handle a fully successful match. Set the return code to the number of captured strings, or 0 if there were too many to fit into the ovector, and then @@ -7716,20 +8157,26 @@ if (rc == MATCH_MATCH) match_data->rc = ((int)mb->end_offset_top >= 2 * match_data->oveccount)? 0 : (int)mb->end_offset_top/2 + 1; match_data->subject_length = length; + match_data->start_offset = start_offset; match_data->startchar = start_match - subject; match_data->leftchar = mb->start_used_ptr - subject; match_data->rightchar = ((mb->last_used_ptr > mb->end_match_ptr)? mb->last_used_ptr : mb->end_match_ptr) - subject; if ((options & PCRE2_COPY_MATCHED_SUBJECT) != 0) { - length = CU2BYTES(length + was_zero_terminated); - match_data->subject = match_data->memctl.malloc(length, - match_data->memctl.memory_data); - if (match_data->subject == NULL) return PCRE2_ERROR_NOMEMORY; - memcpy((void *)match_data->subject, subject, length); + if (length != 0) + { + match_data->subject = match_data->memctl.malloc(CU2BYTES(length), + match_data->memctl.memory_data); + if (match_data->subject == NULL) + return match_data->rc = PCRE2_ERROR_NOMEMORY; + memcpy((void *)match_data->subject, subject, CU2BYTES(length)); + } + else + match_data->subject = NULL; match_data->flags |= PCRE2_MD_COPIED_SUBJECT; } - else match_data->subject = subject; + else match_data->subject = original_subject; return match_data->rc; } @@ -7751,8 +8198,9 @@ PCRE2_ERROR_PARTIAL. */ else if (match_partial != NULL) { - match_data->subject = subject; + match_data->subject = original_subject; match_data->subject_length = length; + match_data->start_offset = start_offset; match_data->ovector[0] = match_partial - subject; match_data->ovector[1] = end_subject - subject; match_data->startchar = match_partial - subject; @@ -7763,7 +8211,13 @@ else if (match_partial != NULL) /* Else this is the classic nomatch case. */ -else match_data->rc = PCRE2_ERROR_NOMATCH; +else + { + match_data->subject = original_subject; + match_data->subject_length = length; + match_data->start_offset = start_offset; + match_data->rc = PCRE2_ERROR_NOMATCH; + } return match_data->rc; } diff --git a/std/regex/pcre2/pcre2_match_data.c b/std/regex/pcre2/pcre2_match_data.c index 757dab9df..fade67ae5 100644 --- a/std/regex/pcre2/pcre2_match_data.c +++ b/std/regex/pcre2/pcre2_match_data.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2022 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -39,10 +39,6 @@ POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" @@ -77,14 +73,17 @@ return yield; * Create a match data block using pattern data * *************************************************/ -/* If no context is supplied, use the memory allocator from the code. */ +/* If no context is supplied, use the memory allocator from the code. This code +assumes that a general context contains nothing other than a memory allocator. +If that ever changes, this code will need fixing. */ PCRE2_EXP_DEFN pcre2_match_data * PCRE2_CALL_CONVENTION pcre2_match_data_create_from_pattern(const pcre2_code *code, pcre2_general_context *gcontext) { +if (code == NULL) return NULL; if (gcontext == NULL) gcontext = (pcre2_general_context *)code; -return pcre2_match_data_create(((pcre2_real_code *)code)->top_bracket + 1, +return pcre2_match_data_create(((const pcre2_real_code *)code)->top_bracket + 1, gcontext); } diff --git a/std/regex/pcre2/pcre2_match_next.c b/std/regex/pcre2/pcre2_match_next.c new file mode 100644 index 000000000..ecd21d380 --- /dev/null +++ b/std/regex/pcre2/pcre2_match_next.c @@ -0,0 +1,171 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* PCRE 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. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge + +----------------------------------------------------------------------------- +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 its + 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. +----------------------------------------------------------------------------- +*/ + + +#include "pcre2_internal.h" + + + +/* Advance the offset by one code unit, and return the new value. +It is only called when the offset is not at the end of the subject. */ + +static PCRE2_SIZE do_bumpalong(pcre2_match_data *match_data, + PCRE2_SIZE offset) +{ +PCRE2_SPTR subject = match_data->subject; +PCRE2_SIZE subject_length = match_data->subject_length; +#ifdef SUPPORT_UNICODE +BOOL utf = (match_data->code->overall_options & PCRE2_UTF) != 0; +#endif + +/* Skip over CRLF as an atomic sequence, if CRLF is configured as a newline +sequence. */ + +if (subject[offset] == CHAR_CR && offset + 1 < subject_length && + subject[offset + 1] == CHAR_LF) + { + switch(match_data->code->newline_convention) + { + case PCRE2_NEWLINE_CRLF: + case PCRE2_NEWLINE_ANY: + case PCRE2_NEWLINE_ANYCRLF: + return offset + 2; + } + } + +/* Advance by one full character if in UTF mode. */ + +#ifdef SUPPORT_UNICODE +if (utf) + { + PCRE2_SPTR next = subject + offset + 1; + PCRE2_SPTR subject_end = subject + subject_length; + + (void)subject_end; /* Suppress warning; 32-bit FORWARDCHARTEST ignores this */ + FORWARDCHARTEST(next, subject_end); + return next - subject; + } +#endif + +return offset + 1; +} + + + +/************************************************* +* Advance the match * +*************************************************/ + +PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION +pcre2_next_match(pcre2_match_data *match_data, PCRE2_SIZE *pstart_offset, + uint32_t *poptions) +{ +int rc = match_data->rc; +PCRE2_SIZE start_offset = match_data->start_offset; +PCRE2_SIZE *ovector = match_data->ovector; + +/* Match error, or no match: no further iteration possible. In previous versions +of PCRE2, we recommended that clients use a strategy which involved retrying in +certain cases after PCRE2_ERROR_NOMATCH, but this is no longer required. */ + +if (rc < 0) + return FALSE; + +/* Match succeeded: get the start offset for the next match */ + +/* Although \K can affect the position of ovector[0], there are no ways to do +anything surprising with ovector[1], which must always be >= start_offset. */ + +PCRE2_ASSERT(ovector[1] >= start_offset); + +/* Special handling for patterns which contain \K in a lookaround, which enables +the match start to be pushed back to before the starting search offset +(ovector[0] < start_offset) or after the match ends (ovector[0] > ovector[1]). +This is not a problem if ovector[1] > start_offset, because in this case, we can +just attempt the next match at ovector[1]: we are making progress, which is all +that we require. + +However, if we have ovector[1] == start_offset, then we have a very rare case +which must be handled specially, because it's a non-empty match which +nonetheless fails to make progress through the subject. */ + +if (ovector[0] != start_offset && ovector[1] == start_offset) + { + /* If the match end is at the end of the subject, we are done. */ + + if (start_offset >= match_data->subject_length) + return FALSE; + + /* Otherwise, bump along by one code unit, and do a normal search. */ + + *pstart_offset = do_bumpalong(match_data, ovector[1]); + *poptions = 0; + return TRUE; + } + +/* If the previous match was for an empty string, we are finished if we are at +the end of the subject. Otherwise, arrange to run another match at the same +point to see if a non-empty match can be found. */ + +if (ovector[0] == ovector[1]) + { + /* If the match is at the end of the subject, we are done. */ + + if (ovector[0] >= match_data->subject_length) + return FALSE; + + /* Otherwise, continue at this exact same point, but we must set the flag + which ensures that we don't return the exact same empty match again. */ + + *pstart_offset = ovector[1]; + *poptions = PCRE2_NOTEMPTY_ATSTART; + return TRUE; + } + +/* Finally, we must be in the happy state of a non-empty match, where the end of +the match is further on in the subject than start_offset, so we are easily able +to continue and make progress. */ + +*pstart_offset = ovector[1]; +*poptions = 0; +return TRUE; +} + +/* End of pcre2_match_next.c */ diff --git a/std/regex/pcre2/pcre2_newline.c b/std/regex/pcre2/pcre2_newline.c index 6e9366db9..a7c929921 100644 --- a/std/regex/pcre2/pcre2_newline.c +++ b/std/regex/pcre2/pcre2_newline.c @@ -48,10 +48,6 @@ and NLTYPE_ANY. The full list of Unicode newline characters is taken from http://unicode.org/unicode/reports/tr18/. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" diff --git a/std/regex/pcre2/pcre2_ord2utf.c b/std/regex/pcre2/pcre2_ord2utf.c index 140373099..3b8aead75 100644 --- a/std/regex/pcre2/pcre2_ord2utf.c +++ b/std/regex/pcre2/pcre2_ord2utf.c @@ -43,13 +43,10 @@ POSSIBILITY OF SUCH DAMAGE. into a UTF string. The behaviour is different for each code unit width. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" + /* If SUPPORT_UNICODE is not defined, this function will never be called. Supply a dummy function because some compilers do not like empty source modules. */ @@ -83,16 +80,17 @@ PRIV(ord2utf)(uint32_t cvalue, PCRE2_UCHAR *buffer) /* Convert to UTF-8 */ #if PCRE2_CODE_UNIT_WIDTH == 8 -int i, j; +unsigned int i; + for (i = 0; i < PRIV(utf8_table1_size); i++) if ((int)cvalue <= PRIV(utf8_table1)[i]) break; buffer += i; -for (j = i; j > 0; j--) +for (unsigned int j = i; j != 0; j--) { *buffer-- = 0x80 | (cvalue & 0x3f); cvalue >>= 6; } -*buffer = PRIV(utf8_table2)[i] | cvalue; +*buffer = (PCRE2_UCHAR)(PRIV(utf8_table2)[i] | (int)cvalue); return i + 1; /* Convert to UTF-16 */ @@ -117,4 +115,4 @@ return 1; } #endif /* SUPPORT_UNICODE */ -/* End of pcre_ord2utf.c */ +/* End of pcre2_ord2utf.c */ diff --git a/std/regex/pcre2/pcre2_pattern_info.c b/std/regex/pcre2/pcre2_pattern_info.c index a29f5eff6..e0bd83a90 100644 --- a/std/regex/pcre2/pcre2_pattern_info.c +++ b/std/regex/pcre2/pcre2_pattern_info.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -39,13 +39,10 @@ POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" + /************************************************* * Return info about compiled pattern * *************************************************/ @@ -64,7 +61,7 @@ Returns: 0 when data returned PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION pcre2_pattern_info(const pcre2_code *code, uint32_t what, void *where) { -const pcre2_real_code *re = (pcre2_real_code *)code; +const pcre2_real_code *re = (const pcre2_real_code *)code; if (where == NULL) /* Requests field length */ { @@ -230,7 +227,8 @@ switch(what) break; case PCRE2_INFO_NAMETABLE: - *((PCRE2_SPTR *)where) = (PCRE2_SPTR)((char *)re + sizeof(pcre2_real_code)); + *((PCRE2_SPTR *)where) = (PCRE2_SPTR)((const char *)re + + sizeof(pcre2_real_code)); break; case PCRE2_INFO_NEWLINE: @@ -268,7 +266,7 @@ PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION pcre2_callout_enumerate(const pcre2_code *code, int (*callback)(pcre2_callout_enumerate_block *, void *), void *callout_data) { -pcre2_real_code *re = (pcre2_real_code *)code; +const pcre2_real_code *re = (const pcre2_real_code *)code; pcre2_callout_enumerate_block cb; PCRE2_SPTR cc; #ifdef SUPPORT_UNICODE @@ -291,8 +289,7 @@ if (re->magic_number != MAGIC_NUMBER) return PCRE2_ERROR_BADMAGIC; if ((re->flags & (PCRE2_CODE_UNIT_WIDTH/8)) == 0) return PCRE2_ERROR_BADMODE; cb.version = 0; -cc = (PCRE2_SPTR)((uint8_t *)re + sizeof(pcre2_real_code)) - + re->name_count * re->name_entry_size; +cc = (PCRE2_SPTR)((uint8_t *)re + re->code_start); while (TRUE) { @@ -383,8 +380,9 @@ while (TRUE) #endif break; -#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8 +#ifdef SUPPORT_WIDE_CHARS case OP_XCLASS: + case OP_ECLASS: cc += GET(cc, 1); break; #endif diff --git a/std/regex/pcre2/pcre2_script_run.c b/std/regex/pcre2/pcre2_script_run.c index 4926fa63b..acdf41fe6 100644 --- a/std/regex/pcre2/pcre2_script_run.c +++ b/std/regex/pcre2/pcre2_script_run.c @@ -38,15 +38,14 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ + /* This module contains the function for checking a script run. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "pcre2_internal.h" + /************************************************* * Check script run * *************************************************/ diff --git a/std/regex/pcre2/pcre2_serialize.c b/std/regex/pcre2/pcre2_serialize.c index ba17a26d2..725b54099 100644 --- a/std/regex/pcre2/pcre2_serialize.c +++ b/std/regex/pcre2/pcre2_serialize.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2020 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -38,16 +38,14 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ + /* This module contains functions for serializing and deserializing a sequence of compiled codes. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "pcre2_internal.h" -#include "pcre2_internal.h" /* Magic number to provide a small check against being handed junk. */ @@ -127,25 +125,25 @@ dst_bytes += TABLES_LENGTH; for (i = 0; i < number_of_codes; i++) { re = (const pcre2_real_code *)(codes[i]); - (void)memcpy(dst_bytes, (char *)re, re->blocksize); - - /* Certain fields in the compiled code block are re-set during - deserialization. In order to ensure that the serialized data stream is always - the same for the same pattern, set them to zero here. We can't assume the - copy of the pattern is correctly aligned for accessing the fields as part of + (void)memcpy(dst_bytes, (const char *)re, re->blocksize); + + /* Certain fields in the compiled code block are re-set during + deserialization. In order to ensure that the serialized data stream is always + the same for the same pattern, set them to zero here. We can't assume the + copy of the pattern is correctly aligned for accessing the fields as part of a structure. Note the use of sizeof(void *) in the second of these, to - specify the size of a pointer. If sizeof(uint8_t *) is used (tables is a - pointer to uint8_t), gcc gives a warning because the first argument is also a - pointer to uint8_t. Casting the first argument to (void *) can stop this, but + specify the size of a pointer. If sizeof(uint8_t *) is used (tables is a + pointer to uint8_t), gcc gives a warning because the first argument is also a + pointer to uint8_t. Casting the first argument to (void *) can stop this, but it didn't stop Coverity giving the same complaint. */ - - (void)memset(dst_bytes + offsetof(pcre2_real_code, memctl), 0, + + (void)memset(dst_bytes + offsetof(pcre2_real_code, memctl), 0, sizeof(pcre2_memctl)); - (void)memset(dst_bytes + offsetof(pcre2_real_code, tables), 0, + (void)memset(dst_bytes + offsetof(pcre2_real_code, tables), 0, sizeof(void *)); (void)memset(dst_bytes + offsetof(pcre2_real_code, executable_jit), 0, - sizeof(void *)); - + sizeof(void *)); + dst_bytes += re->blocksize; } @@ -168,9 +166,10 @@ const pcre2_memctl *memctl = (gcontext != NULL) ? &gcontext->memctl : &PRIV(default_compile_context).memctl; const uint8_t *src_bytes; -pcre2_real_code *dst_re; +pcre2_real_code *dst_re = NULL; uint8_t *tables; int32_t i, j; +int32_t error; /* Sanity checks. */ @@ -208,7 +207,10 @@ for (i = 0; i < number_of_codes; i++) memcpy(&blocksize, src_bytes + offsetof(pcre2_real_code, blocksize), sizeof(CODE_BLOCKSIZE_TYPE)); if (blocksize <= sizeof(pcre2_real_code)) - return PCRE2_ERROR_BADSERIALIZEDDATA; + { + error = PCRE2_ERROR_BADSERIALIZEDDATA; + goto cleanup; + } /* The allocator provided by gcontext replaces the original one. */ @@ -216,13 +218,8 @@ for (i = 0; i < number_of_codes; i++) (pcre2_memctl *)gcontext); if (dst_re == NULL) { - memctl->free(tables, memctl->memory_data); - for (j = 0; j < i; j++) - { - memctl->free(codes[j], memctl->memory_data); - codes[j] = NULL; - } - return PCRE2_ERROR_NOMEMORY; + error = PCRE2_ERROR_NOMEMORY; + goto cleanup; } /* The new allocator must be preserved. */ @@ -232,10 +229,10 @@ for (i = 0; i < number_of_codes; i++) if (dst_re->magic_number != MAGIC_NUMBER || dst_re->name_entry_size > MAX_NAME_SIZE + IMM2_SIZE + 1 || dst_re->name_count > MAX_NAME_COUNT) - { - memctl->free(dst_re, memctl->memory_data); - return PCRE2_ERROR_BADSERIALIZEDDATA; - } + { + error = PCRE2_ERROR_BADSERIALIZEDDATA; + goto cleanup; + } /* At the moment only one table is supported. */ @@ -244,10 +241,22 @@ for (i = 0; i < number_of_codes; i++) dst_re->flags |= PCRE2_DEREF_TABLES; codes[i] = dst_re; + dst_re = NULL; src_bytes += blocksize; } return number_of_codes; + +cleanup: +if (dst_re != NULL) + memctl->free(dst_re, memctl->memory_data); +memctl->free(tables, memctl->memory_data); +for (j = 0; j < i; j++) + { + memctl->free(codes[j], memctl->memory_data); + codes[j] = NULL; + } +return error; } diff --git a/std/regex/pcre2/pcre2_string_utils.c b/std/regex/pcre2/pcre2_string_utils.c index ebfa9434e..f1ac718f6 100644 --- a/std/regex/pcre2/pcre2_string_utils.c +++ b/std/regex/pcre2/pcre2_string_utils.c @@ -38,53 +38,15 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ + /* This module contains internal functions for comparing and finding the length of strings. These are used instead of strcmp() etc because the standard functions work only on 8-bit data. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" -/************************************************* -* Emulated memmove() for systems without it * -*************************************************/ - -/* This function can make use of bcopy() if it is available. Otherwise do it by -steam, as there some non-Unix environments that lack both memmove() and -bcopy(). */ - -#if !defined(VPCOMPAT) && !defined(HAVE_MEMMOVE) -void * -PRIV(memmove)(void *d, const void *s, size_t n) -{ -#ifdef HAVE_BCOPY -bcopy(s, d, n); -return d; -#else -size_t i; -unsigned char *dest = (unsigned char *)d; -const unsigned char *src = (const unsigned char *)s; -if (dest > src) - { - dest += n; - src += n; - for (i = 0; i < n; ++i) *(--dest) = *(--src); - return (void *)dest; - } -else - { - for (i = 0; i < n; ++i) *dest++ = *src++; - return (void *)(dest - n); - } -#endif /* not HAVE_BCOPY */ -} -#endif /* not VPCOMPAT && not HAVE_MEMMOVE */ - /************************************************* * Compare two zero-terminated PCRE2 strings * diff --git a/std/regex/pcre2/pcre2_study.c b/std/regex/pcre2/pcre2_study.c index 792e696da..9f7fd6bd6 100644 --- a/std/regex/pcre2/pcre2_study.c +++ b/std/regex/pcre2/pcre2_study.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2023 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -38,16 +38,15 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ + /* This module contains functions for scanning a compiled pattern and collecting data (e.g. minimum matching length). */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" + + /* The maximum remembered capturing brackets minimum. */ #define MAX_CACHE_BACKREF 128 @@ -114,7 +113,7 @@ uint32_t once_fudge = 0; BOOL had_recurse = FALSE; BOOL dupcapused = (re->flags & PCRE2_DUPCAPUSED) != 0; PCRE2_SPTR nextbranch = code + GET(code, 1); -PCRE2_UCHAR *cc = (PCRE2_UCHAR *)code + 1 + LINK_SIZE; +PCRE2_SPTR cc = code + 1 + LINK_SIZE; recurse_check this_recurse; /* If this is a "could be empty" group, its minimum length is 0. */ @@ -136,12 +135,13 @@ passes 16-bits, reset to that value and skip the rest of the branch. */ for (;;) { int d, min, recno; - PCRE2_UCHAR op, *cs, *ce; + PCRE2_UCHAR op; + PCRE2_SPTR cs, ce; - if (branchlength >= UINT16_MAX) + if (branchlength >= (int)UINT16_MAX) { branchlength = UINT16_MAX; - cc = (PCRE2_UCHAR *)nextbranch; + cc = nextbranch; } op = *cc; @@ -175,7 +175,7 @@ for (;;) cc += 1 + LINK_SIZE; break; } - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_ONCE: case OP_SCRIPT_RUN: @@ -249,9 +249,10 @@ for (;;) case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: case OP_ASSERT_NA: + case OP_ASSERT_SCS: case OP_ASSERTBACK_NA: do cc += GET(cc, 1); while (*cc == OP_ALT); - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* Skip over things that don't match chars */ @@ -351,7 +352,7 @@ for (;;) case OP_PROP: case OP_NOTPROP: cc += 2; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_NOT_DIGIT: case OP_DIGIT: @@ -417,15 +418,14 @@ for (;;) case OP_NCLASS: #ifdef SUPPORT_WIDE_CHARS case OP_XCLASS: + case OP_ECLASS: /* The original code caused an unsigned overflow in 64 bit systems, so now we use a conditional statement. */ - if (op == OP_XCLASS) + if (op == OP_XCLASS || op == OP_ECLASS) cc += GET(cc, 1); else - cc += PRIV(OP_lengths)[OP_CLASS]; -#else - cc += PRIV(OP_lengths)[OP_CLASS]; #endif + cc += PRIV(OP_lengths)[OP_CLASS]; switch (*cc) { @@ -433,7 +433,7 @@ for (;;) case OP_CRMINPLUS: case OP_CRPOSPLUS: branchlength++; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_CRSTAR: case OP_CRMINSTAR: @@ -479,8 +479,8 @@ for (;;) if (!dupcapused && (re->overall_options & PCRE2_MATCH_UNSET_BACKREF) == 0) { int count = GET2(cc, 1+IMM2_SIZE); - PCRE2_UCHAR *slot = - (PCRE2_UCHAR *)((uint8_t *)re + sizeof(pcre2_real_code)) + + PCRE2_SPTR slot = + (PCRE2_SPTR)((const uint8_t *)re + sizeof(pcre2_real_code)) + GET2(cc, 1) * re->name_entry_size; d = INT_MAX; @@ -496,13 +496,12 @@ for (;;) dd = backref_cache[recno]; else { - ce = cs = (PCRE2_UCHAR *)PRIV(find_bracket)(startcode, utf, recno); + ce = cs = PRIV(find_bracket)(startcode, utf, recno); if (cs == NULL) return -2; do ce += GET(ce, 1); while (*ce == OP_ALT); dd = 0; - if (!dupcapused || - (PCRE2_UCHAR *)PRIV(find_bracket)(ce, utf, recno) == NULL) + if (!dupcapused || PRIV(find_bracket)(ce, utf, recno) == NULL) { if (cc > cs && cc < ce) /* Simple recursion */ { @@ -539,7 +538,7 @@ for (;;) } } else d = 0; - cc += 1 + 2*IMM2_SIZE; + cc += PRIV(OP_lengths)[*cc]; goto REPEAT_BACK_REFERENCE; /* Single back reference by number. References by name are converted to by @@ -557,12 +556,11 @@ for (;;) if ((re->overall_options & PCRE2_MATCH_UNSET_BACKREF) == 0) { - ce = cs = (PCRE2_UCHAR *)PRIV(find_bracket)(startcode, utf, recno); + ce = cs = PRIV(find_bracket)(startcode, utf, recno); if (cs == NULL) return -2; do ce += GET(ce, 1); while (*ce == OP_ALT); - if (!dupcapused || - (PCRE2_UCHAR *)PRIV(find_bracket)(ce, utf, recno) == NULL) + if (!dupcapused || PRIV(find_bracket)(ce, utf, recno) == NULL) { if (cc > cs && cc < ce) /* Simple recursion */ { @@ -593,7 +591,7 @@ for (;;) backref_cache[0] = recno; } - cc += 1 + IMM2_SIZE; + cc += PRIV(OP_lengths)[*cc]; /* Handle repeated back references */ @@ -629,11 +627,11 @@ for (;;) break; } - /* Take care not to overflow: (1) min and d are ints, so check that their - product is not greater than INT_MAX. (2) branchlength is limited to - UINT16_MAX (checked at the top of the loop). */ + /* Take care not to overflow: (1) min and d are ints, so check that their + product is not greater than INT_MAX. (2) branchlength is limited to + UINT16_MAX (checked at the top of the loop). */ - if ((d > 0 && (INT_MAX/d) < min) || UINT16_MAX - branchlength < min*d) + if ((d > 0 && (INT_MAX/d) < min) || (int)UINT16_MAX - branchlength < min*d) branchlength = UINT16_MAX; else branchlength += min * d; break; @@ -643,7 +641,7 @@ for (;;) pattern contains multiple subpatterns with the same number. */ case OP_RECURSE: - cs = ce = (PCRE2_UCHAR *)startcode + GET(cc, 1); + cs = ce = startcode + GET(cc, 1); recno = GET2(cs, 1+LINK_SIZE); if (recno == prev_recurse_recno) { @@ -754,11 +752,18 @@ for (;;) /* This should not occur: we list all opcodes explicitly so that when new ones get added they are properly considered. */ + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return -3; + /* LCOV_EXCL_STOP */ } } -/* Control never gets here */ + +/* LCOV_EXCL_START */ +PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */ +return -3; /* Avoid compiler warnings */ +/* LCOV_EXCL_STOP */ } @@ -919,6 +924,138 @@ if (table_limit != 32) for (c = 24; c < 32; c++) re->start_bitmap[c] = 0xff; +#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 +/************************************************* +* Set starting bits for a character list. * +*************************************************/ + +/* This function sets starting bits for a character list. It enumerates +all characters and character ranges in the character list, and sets +the starting bits accordingly. + +Arguments: + code pointer to the code + start_bitmap pointer to the starting bitmap + +Returns: nothing +*/ +static void +study_char_list(PCRE2_SPTR code, uint8_t *start_bitmap, + const uint8_t *char_lists_end) +{ +uint32_t type, list_ind; +uint32_t char_list_add = XCL_CHAR_LIST_LOW_16_ADD; +uint32_t range_start = ~(uint32_t)0, range_end = 0; +const uint8_t *next_char; +PCRE2_UCHAR start_buffer[6], end_buffer[6]; +PCRE2_UCHAR start, end; + +/* Only needed in 8-bit mode at the moment. */ +type = (uint32_t)(code[0] << 8) | code[1]; +code += 2; + +/* Align characters. */ +next_char = char_lists_end - (GET(code, 0) << 1); +type &= XCL_TYPE_MASK; +list_ind = 0; + +if ((type & XCL_BEGIN_WITH_RANGE) != 0) + range_start = XCL_CHAR_LIST_LOW_16_START; + +while (type > 0) + { + uint32_t item_count = type & XCL_ITEM_COUNT_MASK; + + if (item_count == XCL_ITEM_COUNT_MASK) + { + if (list_ind <= 1) + { + item_count = *(const uint16_t*)next_char; + next_char += 2; + } + else + { + item_count = *(const uint32_t*)next_char; + next_char += 4; + } + } + + while (item_count > 0) + { + if (list_ind <= 1) + { + range_end = *(const uint16_t*)next_char; + next_char += 2; + } + else + { + range_end = *(const uint32_t*)next_char; + next_char += 4; + } + + if ((range_end & XCL_CHAR_END) != 0) + { + range_end = char_list_add + (range_end >> XCL_CHAR_SHIFT); + + PRIV(ord2utf)(range_end, end_buffer); + end = end_buffer[0]; + + if (range_start < range_end) + { + PRIV(ord2utf)(range_start, start_buffer); + for (start = start_buffer[0]; start <= end; start++) + start_bitmap[start / 8] |= (1u << (start & 7)); + } + else + start_bitmap[end / 8] |= (1u << (end & 7)); + + range_start = ~(uint32_t)0; + } + else + range_start = char_list_add + (range_end >> XCL_CHAR_SHIFT); + + item_count--; + } + + list_ind++; + type >>= XCL_TYPE_BIT_LEN; + + if (range_start == ~(uint32_t)0) + { + if ((type & XCL_BEGIN_WITH_RANGE) != 0) + { + /* In 8 bit mode XCL_CHAR_LIST_HIGH_32_START is not possible. */ + if (list_ind == 1) range_start = XCL_CHAR_LIST_HIGH_16_START; + else range_start = XCL_CHAR_LIST_LOW_32_START; + } + } + else if ((type & XCL_BEGIN_WITH_RANGE) == 0) + { + PRIV(ord2utf)(range_start, start_buffer); + + /* In 8 bit mode XCL_CHAR_LIST_LOW_32_END and + XCL_CHAR_LIST_HIGH_32_END are not possible. */ + if (list_ind == 1) range_end = XCL_CHAR_LIST_LOW_16_END; + else range_end = XCL_CHAR_LIST_HIGH_16_END; + + PRIV(ord2utf)(range_end, end_buffer); + end = end_buffer[0]; + + for (start = start_buffer[0]; start <= end; start++) + start_bitmap[start / 8] |= (1u << (start & 7)); + + range_start = ~(uint32_t)0; + } + + /* In 8 bit mode XCL_CHAR_LIST_HIGH_32_ADD is not possible. */ + if (list_ind == 1) char_list_add = XCL_CHAR_LIST_HIGH_16_ADD; + else char_list_add = XCL_CHAR_LIST_LOW_32_ADD; + } +} +#endif + + + /************************************************* * Create bitmap of starting code units * *************************************************/ @@ -980,7 +1117,7 @@ do { int rc; PCRE2_SPTR ncode; - uint8_t *classmap = NULL; + const uint8_t *classmap = NULL; #ifdef SUPPORT_WIDE_CHARS PCRE2_UCHAR xclassflags; #endif @@ -1134,6 +1271,7 @@ do case OP_ASSERTBACK_NOT: case OP_ASSERT_NA: case OP_ASSERTBACK_NA: + case OP_ASSERT_SCS: ncode += GET(ncode, 1); while (*ncode == OP_ALT) ncode += GET(ncode, 1); ncode += 1 + LINK_SIZE; @@ -1169,7 +1307,7 @@ do case OP_PROP: if (ncode[1] != PT_CLIST) break; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_ANYNL: case OP_CHAR: case OP_CHARI: @@ -1193,7 +1331,7 @@ do tcode = ncode; continue; /* With the following significant opcode */ } - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* For a group bracket or a positive assertion without an immediately following mandatory setting, recurse to set bits from within the @@ -1252,12 +1390,14 @@ do tcode += GET(tcode, 1 + 2*LINK_SIZE); break; - /* Skip over lookbehind and negative lookahead assertions */ + /* Skip over lookbehind, negative lookahead, and scan substring + assertions */ case OP_ASSERT_NOT: case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: case OP_ASSERTBACK_NA: + case OP_ASSERT_SCS: do tcode += GET(tcode, 1); while (*tcode == OP_ALT); tcode += 1 + LINK_SIZE; break; @@ -1319,7 +1459,7 @@ do case OP_EXACT: tcode += IMM2_SIZE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_CHAR: case OP_PLUS: case OP_MINPLUS: @@ -1330,7 +1470,7 @@ do case OP_EXACTI: tcode += IMM2_SIZE; - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ case OP_CHARI: case OP_PLUSI: case OP_MINPLUSI: @@ -1350,10 +1490,10 @@ do SET_BIT(CHAR_SPACE); /* For the 16-bit and 32-bit libraries (which can never be EBCDIC), set - the bits for 0xA0 and for code units >= 255, independently of UTF. */ + the bits for NBSP and for code units >= 255, independently of UTF. */ #if PCRE2_CODE_UNIT_WIDTH != 8 - SET_BIT(0xA0); + SET_BIT(CHAR_NBSP); SET_BIT(0xFF); #else /* For the 8-bit library in UTF-8 mode, set the bits for the first code @@ -1369,12 +1509,9 @@ do } else #endif - /* For the 8-bit library not in UTF-8 mode, set the bit for 0xA0, unless - the code is EBCDIC. */ + /* For the 8-bit library not in UTF-8 mode, set the bit for NBSP. */ { -#ifndef EBCDIC - SET_BIT(0xA0); -#endif /* Not EBCDIC */ + SET_BIT(CHAR_NBSP); } #endif /* 8-bit support */ @@ -1469,7 +1606,8 @@ do case OP_TYPEUPTO: case OP_TYPEMINUPTO: case OP_TYPEPOSUPTO: - tcode += IMM2_SIZE; /* Fall through */ + tcode += IMM2_SIZE; + PCRE2_FALLTHROUGH /* Fall through */ case OP_TYPESTAR: case OP_TYPEMINSTAR: @@ -1489,10 +1627,10 @@ do SET_BIT(CHAR_SPACE); /* For the 16-bit and 32-bit libraries (which can never be EBCDIC), set - the bits for 0xA0 and for code units >= 255, independently of UTF. */ + the bits for NBSP and for code units >= 255, independently of UTF. */ #if PCRE2_CODE_UNIT_WIDTH != 8 - SET_BIT(0xA0); + SET_BIT(CHAR_NBSP); SET_BIT(0xFF); #else /* For the 8-bit library in UTF-8 mode, set the bits for the first code @@ -1508,12 +1646,9 @@ do } else #endif - /* For the 8-bit library not in UTF-8 mode, set the bit for 0xA0, unless - the code is EBCDIC. */ + /* For the 8-bit library not in UTF-8 mode, set the bit for NBSP. */ { -#ifndef EBCDIC - SET_BIT(0xA0); -#endif /* Not EBCDIC */ + SET_BIT(CHAR_NBSP); } #endif /* 8-bit support */ break; @@ -1578,6 +1713,13 @@ do tcode += 2; break; + /* Set-based ECLASS: treat it the same as a "complex" XCLASS; give up. */ + +#ifdef SUPPORT_WIDE_CHARS + case OP_ECLASS: + return SSB_FAIL; +#endif + /* Extended class: if there are any property checks, or if this is a negative XCLASS without a map, give up. If there are no property checks, there must be wide characters on the XCLASS list, because otherwise an @@ -1596,7 +1738,7 @@ do map pointer if there is one, and fall through. */ classmap = ((xclassflags & XCL_MAP) == 0)? NULL : - (uint8_t *)(tcode + 1 + LINK_SIZE + 1); + (const uint8_t *)(tcode + 1 + LINK_SIZE + 1); /* In UTF-8 mode, scan the character list and set bits for leading bytes, then jump to handle the map. */ @@ -1608,6 +1750,13 @@ do PCRE2_SPTR p = tcode + 1 + LINK_SIZE + 1 + ((classmap == NULL)? 0:32); tcode += GET(tcode, 1); + if (*p >= XCL_LIST) + { + study_char_list(p, re->start_bitmap, + ((const uint8_t *)re + re->code_start)); + goto HANDLE_CLASSMAP; + } + for (;;) switch (*p++) { case XCL_SINGLE: @@ -1628,8 +1777,11 @@ do case XCL_END: goto HANDLE_CLASSMAP; + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return SSB_UNKNOWN; /* Internal error, should not occur */ + /* LCOV_EXCL_STOP */ } } #endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 */ @@ -1638,7 +1790,7 @@ do /* It seems that the fall through comment must be outside the #ifdef if it is to avoid the gcc compiler warning. */ - /* Fall through */ + PCRE2_FALLTHROUGH /* Fall through */ /* Enter here for a negative non-XCLASS. In the 8-bit library, if we are in UTF mode, any byte with a value >= 0xc4 is a potentially valid starter @@ -1653,19 +1805,20 @@ do re->start_bitmap[24] |= 0xf0; /* Bits for 0xc4 - 0xc8 */ memset(re->start_bitmap+25, 0xff, 7); /* Bits for 0xc9 - 0xff */ } + PCRE2_FALLTHROUGH /* Fall through */ #elif PCRE2_CODE_UNIT_WIDTH != 8 SET_BIT(0xFF); /* For characters >= 255 */ + PCRE2_FALLTHROUGH /* Fall through */ #endif - /* Fall through */ /* Enter here for a positive non-XCLASS. If we have fallen through from an XCLASS, classmap will already be set; just advance the code pointer. - Otherwise, set up classmap for a a non-XCLASS and advance past it. */ + Otherwise, set up classmap for a non-XCLASS and advance past it. */ case OP_CLASS: if (*tcode == OP_XCLASS) tcode += GET(tcode, 1); else { - classmap = (uint8_t *)(++tcode); + classmap = (const uint8_t *)(++tcode); tcode += 32 / sizeof(PCRE2_UCHAR); } @@ -1768,8 +1921,7 @@ BOOL ucp = (re->overall_options & PCRE2_UCP) != 0; /* Find start of compiled code */ -code = (PCRE2_UCHAR *)((uint8_t *)re + sizeof(pcre2_real_code)) + - re->name_entry_size * re->name_count; +code = (PCRE2_UCHAR *)((uint8_t *)re + re->code_start); /* For a pattern that has a first code unit, or a multiline pattern that matches only at "line start", there is no point in seeking a list of starting @@ -1779,7 +1931,13 @@ if ((re->flags & (PCRE2_FIRSTSET|PCRE2_STARTLINE)) == 0) { int depth = 0; int rc = set_start_bits(re, code, utf, ucp, &depth); - if (rc == SSB_UNKNOWN) return 1; + /* LCOV_EXCL_START */ + if (rc == SSB_UNKNOWN) + { + PCRE2_DEBUG_UNREACHABLE(); + return 1; + } + /* LCOV_EXCL_STOP */ /* If a list of starting code units was set up, scan the list to see if only one or two were listed. Having only one listed is rare because usually a @@ -1847,30 +2005,37 @@ if ((re->flags & (PCRE2_FIRSTSET|PCRE2_STARTLINE)) == 0) if (d != a) goto DONE; /* Not the other case of a */ b = c; /* Save second in b */ + +#ifdef EBCDIC + /* To match ASCII (which puts the uppercase one in a), swap a & b + if needed. This doesn't really matter, but neatens the tests. */ + if (TABLE_GET((unsigned int)a, re->tables + lcc_offset, a) == a) + { + b = a; + a = c; + } +#endif } else goto DONE; /* More than two characters found */ } } - /* Replace the start code unit bits with a first code unit, but only if it - is not the same as a required later code unit. This is because a search for - a required code unit starts after an explicit first code unit, but at a - code unit found from the bitmap. Patterns such as /a*a/ don't work - if both the start unit and required unit are the same. */ - - if (a >= 0 && - ( - (re->flags & PCRE2_LASTSET) == 0 || - ( - re->last_codeunit != (uint32_t)a && - (b < 0 || re->last_codeunit != (uint32_t)b) - ) - )) - { + /* Replace the start code unit bits with a first code unit. If it is the + same as a required later code unit, then clear the required later code + unit. This is because a search for a required code unit starts after an + explicit first code unit, but at a code unit found from the bitmap. + Patterns such as /a*a/ don't work if both the start unit and required + unit are the same. */ + + if (a >= 0) { + if ((re->flags & PCRE2_LASTSET) && (re->last_codeunit == (uint32_t)a || (b >= 0 && re->last_codeunit == (uint32_t)b))) { + re->flags &= ~(PCRE2_LASTSET | PCRE2_LASTCASELESS); + re->last_codeunit = 0; + } re->first_codeunit = a; flags = PCRE2_FIRSTSET; if (b >= 0) flags |= PCRE2_FIRSTCASELESS; - } + } DONE: re->flags |= flags; @@ -1897,14 +2062,20 @@ if ((re->flags & (PCRE2_MATCH_EMPTY|PCRE2_HASACCEPT)) == 0 && case -1: /* \C in UTF mode or over-complex regex */ break; /* Leave minlength unchanged (will be zero) */ + /* LCOV_EXCL_START */ case -2: + PCRE2_DEBUG_UNREACHABLE(); return 2; /* missing capturing bracket */ + /* LCOV_EXCL_STOP */ + /* LCOV_EXCL_START */ case -3: + PCRE2_DEBUG_UNREACHABLE(); return 3; /* unrecognized opcode */ + /* LCOV_EXCL_STOP */ default: - re->minlength = (min > UINT16_MAX)? UINT16_MAX : min; + re->minlength = (min > (int)UINT16_MAX)? (int)UINT16_MAX : min; break; } } diff --git a/std/regex/pcre2/pcre2_substitute.c b/std/regex/pcre2/pcre2_substitute.c index edbb78c6d..d512f69b6 100644 --- a/std/regex/pcre2/pcre2_substitute.c +++ b/std/regex/pcre2/pcre2_substitute.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2022 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -39,12 +39,10 @@ POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" + + #define PTR_STACK_SIZE 20 #define SUBSTITUTE_OPTIONS \ @@ -117,6 +115,7 @@ for (; ptr < ptrend; ptr++) int erc; int errorcode; uint32_t ch; + PCRE2_SPTR esc_end_ptr; if (ptr < ptrend - 1) switch (ptr[1]) { @@ -130,17 +129,23 @@ for (; ptr < ptrend; ptr++) ptr += 1; /* Must point after \ */ erc = PRIV(check_escape)(&ptr, ptrend, &ch, &errorcode, - code->overall_options, code->extra_options, FALSE, NULL); - ptr -= 1; /* Back to last code unit of escape */ + code->overall_options, code->extra_options, code->top_bracket, FALSE, NULL); if (errorcode != 0) { - rc = errorcode; + /* errorcode from check_escape is positive, so must not be returned by + pcre2_substitute(). */ + rc = PCRE2_ERROR_BADREPESCAPE; goto EXIT; } + esc_end_ptr = ptr; + ptr -= 1; /* Rewind by one, because the for-loop will increment it */ + switch(erc) { case 0: /* Data character */ + case ESC_b: /* Data character */ + case ESC_v: /* Data character */ case ESC_E: /* Isolated \E is ignored */ break; @@ -148,7 +153,19 @@ for (; ptr < ptrend; ptr++) literal = TRUE; break; + case ESC_g: + /* The \g form (\g already handled by check_escape) + + Don't worry about finding the matching ">". We are super, super lenient + about validating ${} replacements inside find_text_end(), so we certainly + don't need to worry about other syntax. Importantly, a \g<..> or $<...> + sequence can't contain a '}' character. */ + break; + default: + if (erc < 0) + break; /* capture group reference */ + ptr = esc_end_ptr; rc = PCRE2_ERROR_BADREPESCAPE; goto EXIT; } @@ -163,6 +180,430 @@ return rc; } +/************************************************* +* Validate group name * +*************************************************/ + +/* This function scans for a capture group name, validating it +consists of legal characters, is not empty, and does not exceed +MAX_NAME_SIZE. + +Arguments: + ptrptr points to the pointer to the start of the text (updated) + ptrend end of the whole string + utf true if the input is UTF-encoded + ctypes pointer to the character types table + +Returns: TRUE if a name was read + FALSE otherwise +*/ + +static BOOL +read_name_subst(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, BOOL utf, + const uint8_t* ctypes) +{ +PCRE2_SPTR ptr = *ptrptr; +PCRE2_SPTR nameptr = ptr; + +if (ptr >= ptrend) /* No characters in name */ + goto FAILED; + +/* We do not need to check whether the name starts with a non-digit. +We are simply referencing names here, not defining them. */ + +/* See read_name in the pcre2_compile.c for the corresponding logic +restricting group names inside the pattern itself. */ + +#ifdef SUPPORT_UNICODE +if (utf) + { + uint32_t c, type; + + while (ptr < ptrend) + { + GETCHAR(c, ptr); + type = UCD_CHARTYPE(c); + if (type != ucp_Nd && PRIV(ucp_gentype)[type] != ucp_L && + c != CHAR_UNDERSCORE) break; + ptr++; + FORWARDCHARTEST(ptr, ptrend); + } + } +else +#else +(void)utf; /* Avoid compiler warning */ +#endif /* SUPPORT_UNICODE */ + +/* Handle group names in non-UTF modes. */ + + { + while (ptr < ptrend && MAX_255(*ptr) && (ctypes[*ptr] & ctype_word) != 0) + { + ptr++; + } + } + +/* Check name length */ + +if (ptr - nameptr > MAX_NAME_SIZE) + goto FAILED; + +/* Subpattern names must not be empty */ +if (ptr == nameptr) + goto FAILED; + +*ptrptr = ptr; +return TRUE; + +FAILED: +*ptrptr = ptr; +return FALSE; +} + + +/************************************************* +* Case transformations * +*************************************************/ + +#define PCRE2_SUBSTITUTE_CASE_NONE 0 +// 1, 2, 3 are PCRE2_SUBSTITUTE_CASE_LOWER, UPPER, TITLE_FIRST. +#define PCRE2_SUBSTITUTE_CASE_REVERSE_TITLE_FIRST 4 + +typedef struct { + int to_case; /* One of PCRE2_SUBSTITUTE_CASE_xyz */ + BOOL single_char; +} case_state; + +/* Helper to guess how much a string is likely to increase in size when +case-transformed. Usually, strings don't change size at all, but some rare +characters do grow. Estimate +10%, plus another few characters. + +Performing this estimation is unfortunate, but inevitable, since we can't call +the callout if we ran out of buffer space to prepare its input. + +Because this estimate is inexact (and in pathological cases, underestimates the +required buffer size) we must document that when you have a +substitute_case_callout, and you are using PCRE2_SUBSTITUTE_OVERFLOW_LENGTH, you +may need more than two calls to determine the final buffer size. */ + +static PCRE2_SIZE +pessimistic_case_inflation(PCRE2_SIZE len) +{ +return (len >> 3u) + 10; +} + +/* Case transformation behaviour if no callout is passed. */ + +static PCRE2_SIZE +default_substitute_case_callout( + PCRE2_SPTR input, PCRE2_SIZE input_len, + PCRE2_UCHAR *output, PCRE2_SIZE output_cap, + case_state *state, const pcre2_code *code) +{ +PCRE2_SPTR input_end = input + input_len; +#ifdef SUPPORT_UNICODE +BOOL utf; +BOOL ucp; +#endif +PCRE2_UCHAR temp[6]; +BOOL next_to_upper; +BOOL rest_to_upper; +BOOL single_char; +BOOL overflow = FALSE; +PCRE2_SIZE written = 0; + +/* Helpful simplifying invariant: input and output are disjoint buffers. +I believe that this code is technically undefined behaviour, because the two +pointers input/output are "unrelated" pointers and hence not comparable. Casting +via char* bypasses some but not all of those technical rules. It is not included +in release builds, in any case. */ +PCRE2_ASSERT((char *)(input + input_len) <= (char *)output || + (char *)(output + output_cap) <= (char *)input); + +#ifdef SUPPORT_UNICODE +utf = (code->overall_options & PCRE2_UTF) != 0; +ucp = (code->overall_options & PCRE2_UCP) != 0; +#endif + +if (input_len == 0) return 0; + +switch (state->to_case) + { + /* LCOV_EXCL_START */ + default: + PCRE2_DEBUG_UNREACHABLE(); + return 0; + /* LCOV_EXCL_STOP */ + + case PCRE2_SUBSTITUTE_CASE_LOWER: // Can be single_char TRUE or FALSE + case PCRE2_SUBSTITUTE_CASE_UPPER: // Can only be single_char FALSE + next_to_upper = rest_to_upper = (state->to_case == PCRE2_SUBSTITUTE_CASE_UPPER); + break; + + case PCRE2_SUBSTITUTE_CASE_TITLE_FIRST: // Can be single_char TRUE or FALSE + next_to_upper = TRUE; + rest_to_upper = FALSE; + state->to_case = PCRE2_SUBSTITUTE_CASE_LOWER; + break; + + case PCRE2_SUBSTITUTE_CASE_REVERSE_TITLE_FIRST: // Can only be single_char FALSE + next_to_upper = FALSE; + rest_to_upper = TRUE; + state->to_case = PCRE2_SUBSTITUTE_CASE_UPPER; + break; + } + +single_char = state->single_char; +if (single_char) + state->to_case = PCRE2_SUBSTITUTE_CASE_NONE; + +while (input < input_end) + { + uint32_t ch; + unsigned int chlen; + + GETCHARINCTEST(ch, input); + +#ifdef SUPPORT_UNICODE + if ((utf || ucp) && ch >= 128) + { + uint32_t type = UCD_CHARTYPE(ch); + if (PRIV(ucp_gentype)[type] == ucp_L && + type != (next_to_upper? ucp_Lu : ucp_Ll)) + ch = UCD_OTHERCASE(ch); + + /* TODO This is far from correct... it doesn't support the SpecialCasing.txt + mappings, but worse, it's not even correct for all the ordinary case + mappings. We should add support for those (at least), and then add the + SpecialCasing.txt mappings for Esszet and ligatures, and finally use the + Turkish casing flag on the match context. */ + } + else +#endif + if (MAX_255(ch)) + { + if (((code->tables + cbits_offset + + (next_to_upper? cbit_upper:cbit_lower) + )[ch/8] & (1u << (ch%8))) == 0) + ch = (code->tables + fcc_offset)[ch]; + } + +#ifdef SUPPORT_UNICODE + if (utf) chlen = PRIV(ord2utf)(ch, temp); else +#endif + { + temp[0] = ch; + chlen = 1; + } + + if (!overflow && chlen <= output_cap) + { + memcpy(output, temp, CU2BYTES(chlen)); + output += chlen; + output_cap -= chlen; + } + else + { + overflow = TRUE; + } + + if (chlen > ~(PCRE2_SIZE)0 - written) /* Integer overflow */ + return ~(PCRE2_SIZE)0; + written += chlen; + + next_to_upper = rest_to_upper; + + /* memcpy the remainder, if only transforming a single character. */ + + if (single_char) + { + PCRE2_SIZE rest_len = input_end - input; + + if (!overflow && rest_len <= output_cap) + memcpy(output, input, CU2BYTES(rest_len)); + + if (rest_len > ~(PCRE2_SIZE)0 - written) /* Integer overflow */ + return ~(PCRE2_SIZE)0; + written += rest_len; + + return written; + } + } + +return written; +} + +/* Helper to perform the call to the substitute_case_callout. We wrap the +user-provided callout because our internal arguments are slightly extended. We +don't want the user callout to handle the case of "\l" (first character only to +lowercase) or "\l\U" (first character to lowercase, rest to uppercase) because +those are not operations defined by Unicode. Instead the user callout simply +needs to provide the three Unicode primitives: lower, upper, titlecase. */ + +static PCRE2_SIZE +do_case_copy( + PCRE2_UCHAR *input_output, PCRE2_SIZE input_len, PCRE2_SIZE output_cap, + case_state *state, BOOL utf, + PCRE2_SIZE (*substitute_case_callout)(PCRE2_SPTR, PCRE2_SIZE, PCRE2_UCHAR *, + PCRE2_SIZE, int, void *), + void *substitute_case_callout_data) +{ +PCRE2_SPTR input = input_output; +PCRE2_UCHAR *output = input_output; +PCRE2_SIZE rc; +PCRE2_SIZE rc2; +int ch1_to_case; +int rest_to_case; +PCRE2_UCHAR ch1[6]; +PCRE2_SIZE ch1_len; +PCRE2_SPTR rest; +PCRE2_SIZE rest_len; +BOOL ch1_overflow = FALSE; +BOOL rest_overflow = FALSE; + +#if PCRE2_CODE_UNIT_WIDTH == 32 || !defined(SUPPORT_UNICODE) +(void)utf; /* Avoid compiler warning. */ +#endif + +PCRE2_ASSERT(input_len != 0); + +switch (state->to_case) + { + /* LCOV_EXCL_START */ + default: + PCRE2_DEBUG_UNREACHABLE(); + return 0; + /* LCOV_EXCL_STOP */ + + case PCRE2_SUBSTITUTE_CASE_LOWER: // Can be single_char TRUE or FALSE + case PCRE2_SUBSTITUTE_CASE_UPPER: // Can only be single_char FALSE + case PCRE2_SUBSTITUTE_CASE_TITLE_FIRST: // Can be single_char TRUE or FALSE + + /* The easy case, where our internal casing operations align with those of + the callout. */ + + if (state->single_char == FALSE) + { + rc = substitute_case_callout(input, input_len, output, output_cap, + state->to_case, substitute_case_callout_data); + + if (state->to_case == PCRE2_SUBSTITUTE_CASE_TITLE_FIRST) + state->to_case = PCRE2_SUBSTITUTE_CASE_LOWER; + + return rc; + } + + ch1_to_case = state->to_case; + rest_to_case = PCRE2_SUBSTITUTE_CASE_NONE; + break; + + case PCRE2_SUBSTITUTE_CASE_REVERSE_TITLE_FIRST: // Can only be single_char FALSE + ch1_to_case = PCRE2_SUBSTITUTE_CASE_LOWER; + rest_to_case = PCRE2_SUBSTITUTE_CASE_UPPER; + break; + } + +/* Identify the leading character. Take copy, because its storage overlaps with +`output`, and hence may be scrambled by the callout. */ + + { + PCRE2_SPTR ch_end = input; + uint32_t ch; + + GETCHARINCTEST(ch, ch_end); + (void) ch; + PCRE2_ASSERT(ch_end <= input + input_len && ch_end - input <= 6); + ch1_len = ch_end - input; + memcpy(ch1, input, CU2BYTES(ch1_len)); + } + +rest = input + ch1_len; +rest_len = input_len - ch1_len; + +/* Transform just ch1. The buffers are always in-place (input == output). With a +custom callout, we need a loop to discover its required buffer size. The loop +wouldn't be required if the callout were well-behaved, but it might be naughty +and return "5" the first time, then "10" the next time we call it using the +exact same input! */ + + { + PCRE2_SIZE ch1_cap; + PCRE2_SIZE max_ch1_cap; + + ch1_cap = ch1_len; /* First attempt uses the space vacated by ch1. */ + PCRE2_ASSERT(output_cap >= input_len && input_len >= rest_len); + max_ch1_cap = output_cap - rest_len; + + while (TRUE) + { + rc = substitute_case_callout(ch1, ch1_len, output, ch1_cap, ch1_to_case, + substitute_case_callout_data); + if (rc == ~(PCRE2_SIZE)0) return rc; + + if (rc <= ch1_cap) break; + + if (rc > max_ch1_cap) + { + ch1_overflow = TRUE; + break; + } + + /* Move the rest to the right, to make room for expanding ch1. */ + + memmove(input_output + rc, rest, CU2BYTES(rest_len)); + rest = input + rc; + + ch1_cap = rc; + + /* Proof of loop termination: `ch1_cap` is growing on each iteration, but + the loop ends if `rc` reaches the (unchanging) upper bound of output_cap. */ + } + } + +if (rest_to_case == PCRE2_SUBSTITUTE_CASE_NONE) + { + if (!ch1_overflow) + { + PCRE2_ASSERT(rest_len <= output_cap - rc); + memmove(output + rc, rest, CU2BYTES(rest_len)); + } + rc2 = rest_len; + + state->to_case = PCRE2_SUBSTITUTE_CASE_NONE; + } +else + { + PCRE2_UCHAR dummy[1]; + + rc2 = substitute_case_callout(rest, rest_len, + ch1_overflow? dummy : output + rc, + ch1_overflow? 0u : output_cap - rc, + rest_to_case, substitute_case_callout_data); + if (rc2 == ~(PCRE2_SIZE)0) return rc2; + + if (!ch1_overflow && rc2 > output_cap - rc) rest_overflow = TRUE; + + /* If ch1 grows so that `xform(ch1)+rest` can't fit in the buffer, but then + `rest` shrinks, it's actually possible for the total calculated length of + `xform(ch1)+xform(rest)` to come out at less than output_cap. But we can't + report that, because it would make it seem that the operation succeeded. + If either of xform(ch1) or xform(rest) won't fit in the buffer, our final + result must be > output_cap. */ + if (ch1_overflow && rc2 < rest_len) + rc2 = rest_len; + + state->to_case = PCRE2_SUBSTITUTE_CASE_UPPER; + } + +if (rc2 > ~(PCRE2_SIZE)0 - rc) /* Integer overflow */ + return ~(PCRE2_SIZE)0; + +PCRE2_ASSERT(!(ch1_overflow || rest_overflow) || rc + rc2 > output_cap); +(void)rest_overflow; + +return rc + rc2; +} + /************************************************* * Match and substitute * @@ -194,25 +635,107 @@ Returns: >= 0 number of substitutions made overflow, either give an error immediately, or keep on, accumulating the length. */ -#define CHECKMEMCPY(from,length) \ - { \ - if (!overflowed && lengthleft < length) \ - { \ - if ((suboptions & PCRE2_SUBSTITUTE_OVERFLOW_LENGTH) == 0) goto NOROOM; \ - overflowed = TRUE; \ - extra_needed = length - lengthleft; \ - } \ - else if (overflowed) \ - { \ - extra_needed += length; \ - } \ - else \ - { \ - memcpy(buffer + buff_offset, from, CU2BYTES(length)); \ - buff_offset += length; \ - lengthleft -= length; \ - } \ - } +#define CHECKMEMCPY(from, length_) \ + do { \ + PCRE2_SIZE chkmc_length = length_; \ + if (overflowed) \ + { \ + if (chkmc_length > ~(PCRE2_SIZE)0 - extra_needed) /* Integer overflow */ \ + goto TOOLARGEREPLACE; \ + extra_needed += chkmc_length; \ + } \ + else if (lengthleft < chkmc_length) \ + { \ + if ((suboptions & PCRE2_SUBSTITUTE_OVERFLOW_LENGTH) == 0) goto NOROOM; \ + overflowed = TRUE; \ + extra_needed = chkmc_length - lengthleft; \ + } \ + else \ + { \ + memcpy(buffer + buff_offset, from, CU2BYTES(chkmc_length)); \ + buff_offset += chkmc_length; \ + lengthleft -= chkmc_length; \ + } \ + } \ + while (0) + +/* This macro checks for space and copies characters with casing modifications. +On overflow, it behaves as for CHECKMEMCPY(). + +When substitute_case_callout is NULL, the source and destination buffers must +not overlap, because our default handler does not support this. */ + +#define CHECKCASECPY_BASE(length_, do_call) \ + do { \ + PCRE2_SIZE chkcc_length = (PCRE2_SIZE)(length_); \ + PCRE2_SIZE chkcc_rc; \ + do_call \ + if (lengthleft < chkcc_rc) \ + { \ + if ((suboptions & PCRE2_SUBSTITUTE_OVERFLOW_LENGTH) == 0) goto NOROOM; \ + overflowed = TRUE; \ + extra_needed = chkcc_rc - lengthleft; \ + } \ + else \ + { \ + buff_offset += chkcc_rc; \ + lengthleft -= chkcc_rc; \ + } \ + } \ + while (0) + +#define CHECKCASECPY_DEFAULT(from, length_) \ + CHECKCASECPY_BASE(length_, { \ + chkcc_rc = default_substitute_case_callout(from, chkcc_length, \ + buffer + buff_offset, \ + overflowed? 0 : lengthleft, \ + &forcecase, code); \ + if (overflowed) \ + { \ + if (chkcc_rc > ~(PCRE2_SIZE)0 - extra_needed) /* Integer overflow */ \ + goto TOOLARGEREPLACE; \ + extra_needed += chkcc_rc; \ + break; \ + } \ + }) + +#define CHECKCASECPY_CALLOUT(length_) \ + CHECKCASECPY_BASE(length_, { \ + chkcc_rc = do_case_copy(buffer + buff_offset, chkcc_length, \ + lengthleft, &forcecase, utf, \ + substitute_case_callout, \ + substitute_case_callout_data); \ + if (chkcc_rc == ~(PCRE2_SIZE)0) goto CASEERROR; \ + }) + +/* This macro does a delayed case transformation, for the situation when we have +a case-forcing callout. */ + +#define DELAYEDFORCECASE() \ + do { \ + PCRE2_SIZE chars_outstanding = (buff_offset - casestart_offset) + \ + (extra_needed - casestart_extra_needed); \ + if (chars_outstanding > 0) \ + { \ + if (overflowed) \ + { \ + PCRE2_SIZE guess = pessimistic_case_inflation(chars_outstanding); \ + if (guess > ~(PCRE2_SIZE)0 - extra_needed) /* Integer overflow */ \ + goto TOOLARGEREPLACE; \ + extra_needed += guess; \ + } \ + else \ + { \ + /* Rewind the buffer */ \ + lengthleft += (buff_offset - casestart_offset); \ + buff_offset = casestart_offset; \ + /* Care! In-place case transformation */ \ + CHECKCASECPY_CALLOUT(chars_outstanding); \ + } \ + } \ + } \ + while (0) + /* Here's the function */ @@ -224,8 +747,6 @@ pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length, { int rc; int subs; -int forcecase = 0; -int forcecasereset = 0; uint32_t ovector_count; uint32_t goptions = 0; uint32_t suboptions; @@ -234,30 +755,45 @@ BOOL escaped_literal = FALSE; BOOL overflowed = FALSE; BOOL use_existing_match; BOOL replacement_only; -#ifdef SUPPORT_UNICODE BOOL utf = (code->overall_options & PCRE2_UTF) != 0; -BOOL ucp = (code->overall_options & PCRE2_UCP) != 0; -#endif +BOOL partial = (options & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) != 0; PCRE2_UCHAR temp[6]; +PCRE2_UCHAR null_str[1] = { 0xcd }; +PCRE2_SPTR original_subject = subject; PCRE2_SPTR ptr; -PCRE2_SPTR repend; +PCRE2_SPTR repend = NULL; PCRE2_SIZE extra_needed = 0; PCRE2_SIZE buff_offset, buff_length, lengthleft, fraglength; PCRE2_SIZE *ovector; -PCRE2_SIZE ovecsave[3]; +PCRE2_SIZE ovecsave[2] = { 0, 0 }; pcre2_substitute_callout_block scb; +PCRE2_SIZE sub_start_extra_needed; +PCRE2_SIZE (*substitute_case_callout)(PCRE2_SPTR, PCRE2_SIZE, PCRE2_UCHAR *, + PCRE2_SIZE, int, void *) = NULL; +void *substitute_case_callout_data = NULL; /* General initialization */ buff_offset = 0; lengthleft = buff_length = *blength; *blength = PCRE2_UNSET; -ovecsave[0] = ovecsave[1] = ovecsave[2] = PCRE2_UNSET; -/* Partial matching is not valid. This must come after setting *blength to -PCRE2_UNSET, so as not to imply an offset in the replacement. */ +if (mcontext != NULL) + { + substitute_case_callout = mcontext->substitute_case_callout; + substitute_case_callout_data = mcontext->substitute_case_callout_data; + } + +/* Partial matching is supported, with limitations. We allow matching in partial +mode, however, if a partial match is found, the substitution will fail with a +PCRE2_ERROR_PARTIAL error. Additionally, outputting the after-match text is not +allowed (PCRE2_ERROR_BADOPTION), and certain replacement items such as $' and $_ +are not supported (PCRE2_ERROR_PARTIALSUBS). -if ((options & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) != 0) +This must come after setting *blength to PCRE2_UNSET, so as not to imply an +offset in the replacement. */ + +if (partial && (options & PCRE2_SUBSTITUTE_REPLACEMENT_ONLY) == 0) return PCRE2_ERROR_BADOPTION; /* Validate length and find the end of the replacement. A NULL replacement of @@ -266,18 +802,75 @@ zero length is interpreted as an empty string. */ if (replacement == NULL) { if (rlength != 0) return PCRE2_ERROR_NULL; - replacement = (PCRE2_SPTR)""; + replacement = null_str; } if (rlength == PCRE2_ZERO_TERMINATED) rlength = PRIV(strlen)(replacement); repend = replacement + rlength; +/* A NULL subject of zero length is treated as an empty string. */ + +if (subject == NULL) + { + if (length != 0) return PCRE2_ERROR_NULL; + subject = null_str; + } + +if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject); + /* Check for using a match that has already happened. Note that the subject pointer in the match data may be NULL after a no-match. */ use_existing_match = ((options & PCRE2_SUBSTITUTE_MATCHED) != 0); replacement_only = ((options & PCRE2_SUBSTITUTE_REPLACEMENT_ONLY) != 0); +if (use_existing_match && match_data == NULL) return PCRE2_ERROR_NULL; + +/* If an existing match is being passed in, we should check that it matches +the passed-in subject pointer, length, and match options. We don't currently +have a use-case for someone to match on one subject, then try and use that +match data on a different subject. In a UTF-encoded string, a simple change +like replacing one character for another won't preserve the code unit offsets, +so it's hard to see, in the general case, how it would be safe or useful to +support swapping or mutating the subject string. + +Similarly, using different match options between the first (external) and +subsequent (internal, global) matches is hard to justify. */ + +if (use_existing_match) + { + /* Return early, as the rest of the match_data may not have been + initialised. This duplicates and must be in sync with the check below that + aborts substitution on any result other than success or no-match. */ + if (match_data->rc < 0 && match_data->rc != PCRE2_ERROR_NOMATCH) + return match_data->rc; + + /* Not supported if the passed-in match was from the DFA interpreter. */ + if (match_data->matchedby == PCRE2_MATCHEDBY_DFA_INTERPRETER) + return PCRE2_ERROR_DFA_UFUNC; + + if (code != match_data->code) + return PCRE2_ERROR_DIFFSUBSPATTERN; + + /* We want the passed-in subject strings to match. This implies the effective + length must match, and either: the pointers are equal (with strict matching + of NULL against NULL); or, the special case of PCRE2_COPY_MATCHED_SUBJECT + where we cannot compare pointers but we can verify the contents. */ + if (length != match_data->subject_length || + !(original_subject == match_data->subject || + ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0 && + (length == 0 || + memcmp(subject, match_data->subject, CU2BYTES(length)) == 0)))) + return PCRE2_ERROR_DIFFSUBSSUBJECT; + + if (start_offset != match_data->start_offset) + return PCRE2_ERROR_DIFFSUBSOFFSET; + + if ((options & ~(SUBSTITUTE_OPTIONS|PCRE2_NO_UTF_CHECK)) != + (match_data->options & ~PCRE2_NO_UTF_CHECK)) + return PCRE2_ERROR_DIFFSUBSOPTIONS; + } + /* If starting from an existing match, there must be an externally provided match data block. We create an internal match_data block in two cases: (a) an external one is not supplied (and we are not starting from an existing match); @@ -286,35 +879,47 @@ case, we copy the existing match into the internal block, except for any cached heap frame size and pointer. This ensures that no changes are made to the external match data block. */ +/* WARNING: In both cases below a general context is constructed "by hand" +because calling pcre2_general_context_create() involves a memory allocation. If +the contents of a general context control block are ever changed there will +have to be changes below. */ + if (match_data == NULL) { - pcre2_general_context *gcontext; - if (use_existing_match) return PCRE2_ERROR_NULL; - gcontext = (mcontext == NULL)? - (pcre2_general_context *)code : - (pcre2_general_context *)mcontext; + pcre2_general_context gcontext; + gcontext.memctl = (mcontext == NULL)? + ((pcre2_real_code *)code)->memctl : + ((pcre2_real_match_context *)mcontext)->memctl; match_data = internal_match_data = - pcre2_match_data_create_from_pattern(code, gcontext); + pcre2_match_data_create_from_pattern(code, &gcontext); if (internal_match_data == NULL) return PCRE2_ERROR_NOMEMORY; } else if (use_existing_match) { - pcre2_general_context *gcontext = (mcontext == NULL)? - (pcre2_general_context *)code : - (pcre2_general_context *)mcontext; - int pairs = (code->top_bracket + 1 < match_data->oveccount)? + int pairs; + pcre2_general_context gcontext; + gcontext.memctl = (mcontext == NULL)? + ((pcre2_real_code *)code)->memctl : + ((pcre2_real_match_context *)mcontext)->memctl; + pairs = (code->top_bracket + 1 < match_data->oveccount)? code->top_bracket + 1 : match_data->oveccount; internal_match_data = pcre2_match_data_create(match_data->oveccount, - gcontext); + &gcontext); if (internal_match_data == NULL) return PCRE2_ERROR_NOMEMORY; memcpy(internal_match_data, match_data, offsetof(pcre2_match_data, ovector) + 2*pairs*sizeof(PCRE2_SIZE)); internal_match_data->heapframes = NULL; internal_match_data->heapframes_size = 0; + /* Ensure that the subject is not freed when internal_match_data is */ + internal_match_data->flags &= ~PCRE2_MD_COPIED_SUBJECT; match_data = internal_match_data; } +/* If using an internal match data, there's no need to copy the subject. */ + +if (internal_match_data != NULL) options &= ~PCRE2_COPY_MATCHED_SUBJECT; + /* Remember ovector details */ ovector = pcre2_get_ovector_pointer(match_data); @@ -327,19 +932,6 @@ scb.input = subject; scb.output = (PCRE2_SPTR)buffer; scb.ovector = ovector; -/* A NULL subject of zero length is treated as an empty string. */ - -if (subject == NULL) - { - if (length != 0) return PCRE2_ERROR_NULL; - subject = (PCRE2_SPTR)""; - } - -/* Find length of zero-terminated subject */ - -if (length == PCRE2_ZERO_TERMINATED) - length = subject? PRIV(strlen)(subject) : 0; - /* Check UTF replacement string if necessary. */ #ifdef SUPPORT_UNICODE @@ -376,10 +968,13 @@ if (!replacement_only) CHECKMEMCPY(subject, start_offset); match is taken from the match_data that was passed in. */ subs = 0; -do +for (;;) { PCRE2_SPTR ptrstack[PTR_STACK_SIZE]; uint32_t ptrstackptr = 0; + case_state forcecase = { PCRE2_SUBSTITUTE_CASE_NONE, FALSE }; + PCRE2_SIZE casestart_offset = 0; + PCRE2_SIZE casestart_extra_needed = 0; if (use_existing_match) { @@ -393,53 +988,12 @@ do if (utf) options |= PCRE2_NO_UTF_CHECK; /* Only need to check once */ #endif - /* Any error other than no match returns the error code. No match when not - doing the special after-empty-match global rematch, or when at the end of the - subject, breaks the global loop. Otherwise, advance the starting point by one - character, copying it to the output, and try again. */ - - if (rc < 0) - { - PCRE2_SIZE save_start; - - if (rc != PCRE2_ERROR_NOMATCH) goto EXIT; - if (goptions == 0 || start_offset >= length) break; - - /* Advance by one code point. Then, if CRLF is a valid newline sequence and - we have advanced into the middle of it, advance one more code point. In - other words, do not start in the middle of CRLF, even if CR and LF on their - own are valid newlines. */ + /* Any error other than no match returns the error code. No match breaks the + global loop. */ - save_start = start_offset++; - if (subject[start_offset-1] == CHAR_CR && - code->newline_convention != PCRE2_NEWLINE_CR && - code->newline_convention != PCRE2_NEWLINE_LF && - start_offset < length && - subject[start_offset] == CHAR_LF) - start_offset++; + if (rc == PCRE2_ERROR_NOMATCH) break; - /* Otherwise, in UTF mode, advance past any secondary code points. */ - - else if ((code->overall_options & PCRE2_UTF) != 0) - { -#if PCRE2_CODE_UNIT_WIDTH == 8 - while (start_offset < length && (subject[start_offset] & 0xc0) == 0x80) - start_offset++; -#elif PCRE2_CODE_UNIT_WIDTH == 16 - while (start_offset < length && - (subject[start_offset] & 0xfc00) == 0xdc00) - start_offset++; -#endif - } - - /* Copy what we have advanced past (unless not required), reset the special - global options, and continue to the next match. */ - - fraglength = start_offset - save_start; - if (!replacement_only) CHECKMEMCPY(subject + save_start, fraglength); - goptions = 0; - continue; - } + if (rc < 0) goto EXIT; /* Handle a successful match. Matches that use \K to end before they start or start before the current point in the subject are not supported. */ @@ -450,25 +1004,27 @@ do goto EXIT; } - /* Check for the same match as previous. This is legitimate after matching an - empty string that starts after the initial match offset. We have tried again - at the match point in case the pattern is one like /(?<=\G.)/ which can never - match at its starting point, so running the match achieves the bumpalong. If - we do get the same (null) match at the original match point, it isn't such a - pattern, so we now do the empty string magic. In all other cases, a repeat - match should never occur. */ + /* Assert that our replacement loop is making progress, checked even in + release builds. This should be impossible to hit, however, an infinite loop + would be fairly catastrophic. + + "Progress" is measured as ovector[1] strictly advancing, or, an empty match + after a non-empty match. */ - if (ovecsave[0] == ovector[0] && ovecsave[1] == ovector[1]) + /* LCOV_EXCL_START */ + if (subs > 0 && + !(ovector[1] > ovecsave[1] || + (ovector[1] == ovector[0] && ovecsave[1] > ovecsave[0] && + ovector[1] == ovecsave[1]))) { - if (ovector[0] == ovector[1] && ovecsave[2] != start_offset) - { - goptions = PCRE2_NOTEMPTY_ATSTART | PCRE2_ANCHORED; - ovecsave[2] = start_offset; - continue; /* Back to the top of the loop */ - } + PCRE2_DEBUG_UNREACHABLE(); rc = PCRE2_ERROR_INTERNAL_DUPMATCH; goto EXIT; } + /* LCOV_EXCL_STOP */ + + ovecsave[0] = ovector[0]; + ovecsave[1] = ovector[1]; /* Count substitutions with a paranoid check for integer overflow; surely no real call to this function would ever hit this! */ @@ -480,14 +1036,16 @@ do } subs++; - /* Copy the text leading up to the match (unless not required), and remember - where the insert begins and how many ovector pairs are set. */ + /* Copy the text leading up to the match (unless not required); remember + where the insert begins and how many ovector pairs are set; and remember how + much space we have requested in extra_needed. */ if (rc == 0) rc = ovector_count; fraglength = ovector[0] - start_offset; if (!replacement_only) CHECKMEMCPY(subject + start_offset, fraglength); scb.output_offsets[0] = buff_offset; scb.oveccount = rc; + sub_start_extra_needed = extra_needed; /* Process the replacement string. If the entire replacement is literal, just copy it with length check. */ @@ -507,6 +1065,13 @@ do { uint32_t ch; unsigned int chlen; + int group; + uint32_t special; + PCRE2_SPTR text1_start = NULL; + PCRE2_SPTR text1_end = NULL; + PCRE2_SPTR text2_start = NULL; + PCRE2_SPTR text2_end = NULL; + PCRE2_UCHAR name[MAX_NAME_SIZE + 1]; /* If at the end of a nested substring, pop the stack. */ @@ -535,25 +1100,121 @@ do if (*ptr == CHAR_DOLLAR_SIGN) { - int group, n; - uint32_t special = 0; BOOL inparens; + BOOL inangle; BOOL star; PCRE2_SIZE sublength; - PCRE2_SPTR text1_start = NULL; - PCRE2_SPTR text1_end = NULL; - PCRE2_SPTR text2_start = NULL; - PCRE2_SPTR text2_end = NULL; PCRE2_UCHAR next; - PCRE2_UCHAR name[33]; + PCRE2_SPTR subptr, subptrend; if (++ptr >= repend) goto BAD; if ((next = *ptr) == CHAR_DOLLAR_SIGN) goto LOADLITERAL; + special = 0; + text1_start = NULL; + text1_end = NULL; + text2_start = NULL; + text2_end = NULL; group = -1; - n = 0; inparens = FALSE; + inangle = FALSE; star = FALSE; + subptr = NULL; + subptrend = NULL; + + /* Special $ sequences, as supported by Perl, JavaScript, .NET and others. */ + if (next == CHAR_AMPERSAND) + { + ++ptr; + group = 0; + goto GROUP_SUBSTITUTE; + } + if (next == CHAR_GRAVE_ACCENT || next == CHAR_APOSTROPHE) + { + ++ptr; + + /* (Sanity-check ovector before reading from it.) */ + rc = pcre2_substring_length_bynumber(match_data, 0, &sublength); + /* LCOV_EXCL_START */ + if (rc < 0) + { + PCRE2_DEBUG_UNREACHABLE(); + goto PTREXIT; + } + /* LCOV_EXCL_STOP */ + + if (next == CHAR_GRAVE_ACCENT) + { + subptr = subject; + subptrend = subject + ovector[0]; + } + else + { + if (partial) + { + rc = PCRE2_ERROR_PARTIALSUBS; + goto PTREXIT; + } + + subptr = subject + ovector[1]; + subptrend = subject + length; + } + + goto SUBPTR_SUBSTITUTE; + } + if (next == CHAR_UNDERSCORE) + { + /* Java, .NET support $_ for "entire input string". */ + ++ptr; + + if (partial) + { + rc = PCRE2_ERROR_PARTIALSUBS; + goto PTREXIT; + } + + subptr = subject; + subptrend = subject + length; + goto SUBPTR_SUBSTITUTE; + } + if (next == CHAR_PLUS && + !(ptr+1 < repend && ptr[1] == CHAR_LEFT_CURLY_BRACKET)) + { + /* Perl supports $+ for "highest captured group" (not the same as $^N + which is mainly only useful inside Perl's match callbacks). We also + don't accept "$+{..." since that's Perl syntax for our ${name}. */ + ++ptr; + if (code->top_bracket == 0) + { + /* Treat either as "no such group" or "all groups unset" based on the + PCRE2_SUBSTITUTE_UNKNOWN_UNSET option. */ + if ((suboptions & PCRE2_SUBSTITUTE_UNKNOWN_UNSET) == 0) + { + rc = PCRE2_ERROR_NOSUBSTRING; + goto PTREXIT; + } + group = 0; + } + else + { + /* If we have any capture groups, then the ovector needs to be large + enough for all of them, or the result won't be accurate. */ + if (match_data->oveccount < code->top_bracket + 1) + { + rc = PCRE2_ERROR_UNAVAILABLE; + goto PTREXIT; + } + for (group = code->top_bracket; group > 0; group--) + if (ovector[2*group] != PCRE2_UNSET) break; + } + if (group == 0) + { + if ((suboptions & PCRE2_SUBSTITUTE_UNSET_EMPTY) != 0) continue; + rc = PCRE2_ERROR_UNSET; + goto PTREXIT; + } + goto GROUP_SUBSTITUTE; + } if (next == CHAR_LEFT_CURLY_BRACKET) { @@ -561,22 +1222,31 @@ do next = *ptr; inparens = TRUE; } + else if (next == CHAR_LESS_THAN_SIGN) + { + /* JavaScript compatibility syntax, $. Processes only named + groups (not numbered) and does not support extensions such as star + (you can do ${name} and ${*name}, but not $<*name>). */ + if (++ptr >= repend) goto BAD; + next = *ptr; + inangle = TRUE; + } - if (next == CHAR_ASTERISK) + if (!inangle && next == CHAR_ASTERISK) { if (++ptr >= repend) goto BAD; next = *ptr; star = TRUE; } - if (!star && next >= CHAR_0 && next <= CHAR_9) + if (!star && !inangle && next >= CHAR_0 && next <= CHAR_9) { group = next - CHAR_0; while (++ptr < repend) { next = *ptr; if (next < CHAR_0 || next > CHAR_9) break; - group = group * 10 + next - CHAR_0; + group = group * 10 + (next - CHAR_0); /* A check for a number greater than the hightest captured group is sufficient here; no need for a separate overflow check. If unknown @@ -600,25 +1270,25 @@ do } else { - const uint8_t *ctypes = code->tables + ctypes_offset; - while (MAX_255(next) && (ctypes[next] & ctype_word) != 0) - { - name[n++] = next; - if (n > 32) goto BAD; - if (++ptr >= repend) break; - next = *ptr; - } - if (n == 0) goto BAD; - name[n] = 0; + PCRE2_SIZE name_len; + PCRE2_SPTR name_start = ptr; + if (!read_name_subst(&ptr, repend, utf, code->tables + ctypes_offset)) + goto BAD; + name_len = ptr - name_start; + memcpy(name, name_start, CU2BYTES(name_len)); + name[name_len] = 0; } + next = 0; /* not used or updated after this point */ + (void)next; + /* In extended mode we recognize ${name:+set text:unset text} and ${name:-default text}. */ if (inparens) { if ((suboptions & PCRE2_SUBSTITUTE_EXTENDED) != 0 && - !star && ptr < repend - 2 && next == CHAR_COLON) + !star && ptr < repend - 2 && *ptr == CHAR_COLON) { special = *(++ptr); if (special != CHAR_PLUS && special != CHAR_MINUS) @@ -653,6 +1323,13 @@ do ptr++; } + if (inangle) + { + if (ptr >= repend || *ptr != CHAR_GREATER_THAN_SIGN) + goto BAD; + ptr++; + } + /* Have found a syntactically correct group number or name, or *name. Only *MARK is currently recognized. */ @@ -663,10 +1340,14 @@ do PCRE2_SPTR mark = pcre2_get_mark(match_data); if (mark != NULL) { - PCRE2_SPTR mark_start = mark; - while (*mark != 0) mark++; - fraglength = mark - mark_start; - CHECKMEMCPY(mark_start, fraglength); + /* Peek backwards one code unit to obtain the length of the mark. + It can (theoretically) contain an embedded NUL. */ + fraglength = mark[-1]; + if (forcecase.to_case != PCRE2_SUBSTITUTE_CASE_NONE && + substitute_case_callout == NULL) + CHECKCASECPY_DEFAULT(mark, fraglength); + else + CHECKMEMCPY(mark, fraglength); } } else goto BAD; @@ -677,8 +1358,7 @@ do else { - PCRE2_SPTR subptr, subptrend; - + GROUP_SUBSTITUTE: /* Find a number for a named group. In case there are duplicate names, search for the first one that is set. If the name is not found when PCRE2_SUBSTITUTE_UNKNOWN_EMPTY is set, set the group number to a @@ -775,41 +1455,14 @@ do /* Substitute a literal string, possibly forcing alphabetic case. */ - while (subptr < subptrend) - { - GETCHARINCTEST(ch, subptr); - if (forcecase != 0) - { -#ifdef SUPPORT_UNICODE - if (utf || ucp) - { - uint32_t type = UCD_CHARTYPE(ch); - if (PRIV(ucp_gentype)[type] == ucp_L && - type != ((forcecase > 0)? ucp_Lu : ucp_Ll)) - ch = UCD_OTHERCASE(ch); - } - else -#endif - { - if (((code->tables + cbits_offset + - ((forcecase > 0)? cbit_upper:cbit_lower) - )[ch/8] & (1u << (ch%8))) == 0) - ch = (code->tables + fcc_offset)[ch]; - } - forcecase = forcecasereset; - } - -#ifdef SUPPORT_UNICODE - if (utf) chlen = PRIV(ord2utf)(ch, temp); else -#endif - { - temp[0] = ch; - chlen = 1; - } - CHECKMEMCPY(temp, chlen); - } + SUBPTR_SUBSTITUTE: + if (forcecase.to_case != PCRE2_SUBSTITUTE_CASE_NONE && + substitute_case_callout == NULL) + CHECKCASECPY_DEFAULT(subptr, subptrend - subptr); + else + CHECKMEMCPY(subptr, subptrend - subptr); } - } + } /* End of $ processing */ /* Handle an escape sequence in extended mode. We can use check_escape() to process \Q, \E, \c, \o, \x and \ followed by non-alphanumerics, but @@ -820,139 +1473,261 @@ do *ptr == CHAR_BACKSLASH) { int errorcode; + case_state new_forcecase = { PCRE2_SUBSTITUTE_CASE_NONE, FALSE }; if (ptr < repend - 1) switch (ptr[1]) { case CHAR_L: - forcecase = forcecasereset = -1; + new_forcecase.to_case = PCRE2_SUBSTITUTE_CASE_LOWER; + new_forcecase.single_char = FALSE; ptr += 2; - continue; + break; case CHAR_l: - forcecase = -1; - forcecasereset = 0; + new_forcecase.to_case = PCRE2_SUBSTITUTE_CASE_LOWER; + new_forcecase.single_char = TRUE; ptr += 2; - continue; + if (ptr + 2 < repend && ptr[0] == CHAR_BACKSLASH && ptr[1] == CHAR_U) + { + /* Perl reverse-title-casing feature for \l\U */ + new_forcecase.to_case = PCRE2_SUBSTITUTE_CASE_REVERSE_TITLE_FIRST; + new_forcecase.single_char = FALSE; + ptr += 2; + } + break; case CHAR_U: - forcecase = forcecasereset = 1; + new_forcecase.to_case = PCRE2_SUBSTITUTE_CASE_UPPER; + new_forcecase.single_char = FALSE; ptr += 2; - continue; + break; case CHAR_u: - forcecase = 1; - forcecasereset = 0; + new_forcecase.to_case = PCRE2_SUBSTITUTE_CASE_TITLE_FIRST; + new_forcecase.single_char = TRUE; ptr += 2; - continue; + if (ptr + 2 < repend && ptr[0] == CHAR_BACKSLASH && ptr[1] == CHAR_L) + { + /* Perl title-casing feature for \u\L */ + new_forcecase.to_case = PCRE2_SUBSTITUTE_CASE_TITLE_FIRST; + new_forcecase.single_char = FALSE; + ptr += 2; + } + break; default: break; } + if (new_forcecase.to_case != PCRE2_SUBSTITUTE_CASE_NONE) + { + SETFORCECASE: + + /* If the substitute_case_callout is unset, our case-forcing is done + immediately. If there is a callout however, then its action is delayed + until all the characters have been collected. + + Apply the callout now, before we set the new casing mode. */ + + if (substitute_case_callout != NULL && + forcecase.to_case != PCRE2_SUBSTITUTE_CASE_NONE) + DELAYEDFORCECASE(); + + forcecase = new_forcecase; + casestart_offset = buff_offset; + casestart_extra_needed = extra_needed; + continue; + } + ptr++; /* Point after \ */ rc = PRIV(check_escape)(&ptr, repend, &ch, &errorcode, - code->overall_options, code->extra_options, FALSE, NULL); + code->overall_options, code->extra_options, code->top_bracket, FALSE, NULL); if (errorcode != 0) goto BADESCAPE; switch(rc) { case ESC_E: - forcecase = forcecasereset = 0; - continue; + goto SETFORCECASE; case ESC_Q: escaped_literal = TRUE; continue; case 0: /* Data character */ - goto LITERAL; + case ESC_b: /* \b is backspace in a substitution */ + case ESC_v: /* \v is vertical tab in a substitution */ + + if (rc == ESC_b) ch = CHAR_BS; + if (rc == ESC_v) ch = CHAR_VT; + +#ifdef SUPPORT_UNICODE + if (utf) chlen = PRIV(ord2utf)(ch, temp); else +#endif + { + temp[0] = ch; + chlen = 1; + } + + if (forcecase.to_case != PCRE2_SUBSTITUTE_CASE_NONE && + substitute_case_callout == NULL) + CHECKCASECPY_DEFAULT(temp, chlen); + else + CHECKMEMCPY(temp, chlen); + continue; + + case ESC_g: + { + PCRE2_SIZE name_len; + PCRE2_SPTR name_start; + + /* Parse the \g form (\g already handled by check_escape) */ + if (ptr >= repend || *ptr != CHAR_LESS_THAN_SIGN) + goto BADESCAPE; + ++ptr; + + name_start = ptr; + if (!read_name_subst(&ptr, repend, utf, code->tables + ctypes_offset)) + goto BADESCAPE; + name_len = ptr - name_start; + + if (ptr >= repend || *ptr != CHAR_GREATER_THAN_SIGN) + goto BADESCAPE; + ++ptr; + + special = 0; + group = -1; + memcpy(name, name_start, CU2BYTES(name_len)); + name[name_len] = 0; + goto GROUP_SUBSTITUTE; + } default: + if (rc < 0) + { + special = 0; + group = -rc - 1; + goto GROUP_SUBSTITUTE; + } goto BADESCAPE; } - } + } /* End of backslash processing */ /* Handle a literal code unit */ else { + PCRE2_SPTR ch_start; + LOADLITERAL: + ch_start = ptr; GETCHARINCTEST(ch, ptr); /* Get character value, increment pointer */ + (void) ch; - LITERAL: - if (forcecase != 0) - { -#ifdef SUPPORT_UNICODE - if (utf || ucp) - { - uint32_t type = UCD_CHARTYPE(ch); - if (PRIV(ucp_gentype)[type] == ucp_L && - type != ((forcecase > 0)? ucp_Lu : ucp_Ll)) - ch = UCD_OTHERCASE(ch); - } - else -#endif - { - if (((code->tables + cbits_offset + - ((forcecase > 0)? cbit_upper:cbit_lower) - )[ch/8] & (1u << (ch%8))) == 0) - ch = (code->tables + fcc_offset)[ch]; - } - forcecase = forcecasereset; - } - -#ifdef SUPPORT_UNICODE - if (utf) chlen = PRIV(ord2utf)(ch, temp); else -#endif - { - temp[0] = ch; - chlen = 1; - } - CHECKMEMCPY(temp, chlen); + if (forcecase.to_case != PCRE2_SUBSTITUTE_CASE_NONE && + substitute_case_callout == NULL) + CHECKCASECPY_DEFAULT(ch_start, ptr - ch_start); + else + CHECKMEMCPY(ch_start, ptr - ch_start); } /* End handling a literal code unit */ } /* End of loop for scanning the replacement. */ + /* If the substitute_case_callout is unset, our case-forcing is done + immediately. If there is a callout however, then its action is delayed + until all the characters have been collected. + + We now clean up any trailing section of the replacement for which we deferred + the case-forcing. */ + + if (substitute_case_callout != NULL && + forcecase.to_case != PCRE2_SUBSTITUTE_CASE_NONE) + DELAYEDFORCECASE(); + /* The replacement has been copied to the output, or its size has been - remembered. Do the callout if there is one and we have done an actual - replacement. */ + remembered. Handle the callout if there is one. */ - if (!overflowed && mcontext != NULL && mcontext->substitute_callout != NULL) + if (mcontext != NULL && mcontext->substitute_callout != NULL) { - scb.subscount = subs; - scb.output_offsets[1] = buff_offset; - rc = mcontext->substitute_callout(&scb, mcontext->substitute_callout_data); + /* If we an actual (non-simulated) replacement, do the callout. */ - /* A non-zero return means cancel this substitution. Instead, copy the - matched string fragment. */ + if (!overflowed) + { + scb.subscount = subs; + scb.output_offsets[1] = buff_offset; + rc = mcontext->substitute_callout(&scb, + mcontext->substitute_callout_data); - if (rc != 0) + /* A non-zero return means cancel this substitution. Instead, copy the + matched string fragment. */ + + if (rc != 0) + { + PCRE2_SIZE newlength = scb.output_offsets[1] - scb.output_offsets[0]; + PCRE2_SIZE oldlength = ovector[1] - ovector[0]; + + buff_offset -= newlength; + lengthleft += newlength; + if (!replacement_only) CHECKMEMCPY(subject + ovector[0], oldlength); + + /* A negative return means do not do any more. */ + + if (rc < 0) suboptions &= (~PCRE2_SUBSTITUTE_GLOBAL); + } + } + + /* In this interesting case, we cannot do the callout, so it's hard to + estimate the required buffer size. What callers want is to be able to make + two calls to pcre2_substitute(), once with PCRE2_SUBSTITUTE_OVERFLOW_LENGTH + to discover the buffer size, and then a second and final call. Older + versions of PCRE2 violated this assumption, by proceding as if the callout + had returned zero - but on the second call to pcre2_substitute() it could + return non-zero and then overflow the buffer again. Callers probably don't + want to keep on looping to incrementally discover the buffer size. */ + + else { - PCRE2_SIZE newlength = scb.output_offsets[1] - scb.output_offsets[0]; + PCRE2_SIZE newlength_buf = buff_offset - scb.output_offsets[0]; + PCRE2_SIZE newlength_extra = extra_needed - sub_start_extra_needed; + PCRE2_SIZE newlength = + (newlength_extra > ~(PCRE2_SIZE)0 - newlength_buf)? /* Integer overflow */ + ~(PCRE2_SIZE)0 : newlength_buf + newlength_extra; /* Cap the addition */ PCRE2_SIZE oldlength = ovector[1] - ovector[0]; - buff_offset -= newlength; - lengthleft += newlength; - if (!replacement_only) CHECKMEMCPY(subject + ovector[0], oldlength); + /* Be pessimistic: request whichever buffer size is larger out of + accepting or rejecting the substitution. */ - /* A negative return means do not do any more. */ + if (oldlength > newlength) + { + PCRE2_SIZE additional = oldlength - newlength; + if (additional > ~(PCRE2_SIZE)0 - extra_needed) /* Integer overflow */ + goto TOOLARGEREPLACE; + extra_needed += additional; + } - if (rc < 0) suboptions &= (~PCRE2_SUBSTITUTE_GLOBAL); + /* Proceed as if the callout did not return a negative. A negative + effectively rejects all future substitutions, but we want to examine them + pessimistically. */ } } - /* Save the details of this match. See above for how this data is used. If we - matched an empty string, do the magic for global matches. Update the start - offset to point to the rest of the subject string. If we re-used an existing - match for the first match, switch to the internal match data block. */ + /* Exit the global loop if we are not in global mode, or if pcre2_next_match() + indicates we have reached the end of the subject. */ - ovecsave[0] = ovector[0]; - ovecsave[1] = ovector[1]; - ovecsave[2] = start_offset; + if ((suboptions & PCRE2_SUBSTITUTE_GLOBAL) == 0 || + !pcre2_next_match(match_data, &start_offset, &goptions)) + { + start_offset = ovector[1]; + break; + } + + /* Verify that pcre2_next_match() has not done a bumpalong (because we have + already returned PCRE2_ERROR_BADSUBSPATTERN for \K in lookarounds). + + We would otherwise have to memcpy the fragment spanning from ovector[1] to the + new start_offset.*/ + + PCRE2_ASSERT(start_offset == ovector[1]); - goptions = (ovector[0] != ovector[1] || ovector[0] > start_offset)? 0 : - PCRE2_ANCHORED|PCRE2_NOTEMPTY_ATSTART; - start_offset = ovector[1]; - } while ((suboptions & PCRE2_SUBSTITUTE_GLOBAL) != 0); /* Repeat "do" loop */ + } /* End of global loop */ /* Copy the rest of the subject unless not required, and terminate the output with a binary zero. */ @@ -973,6 +1748,9 @@ needed. Otherwise, an overflow generates an immediate error return. */ if (overflowed) { rc = PCRE2_ERROR_NOMEMORY; + + if (extra_needed > ~(PCRE2_SIZE)0 - buff_length) /* Integer overflow */ + goto TOOLARGEREPLACE; *blength = buff_length + extra_needed; } @@ -994,6 +1772,14 @@ return rc; rc = PCRE2_ERROR_NOMEMORY; goto EXIT; +CASEERROR: +rc = PCRE2_ERROR_REPLACECASE; +goto EXIT; + +TOOLARGEREPLACE: +rc = PCRE2_ERROR_TOOLARGEREPLACE; +goto EXIT; + BAD: rc = PCRE2_ERROR_BADREPLACEMENT; goto PTREXIT; diff --git a/std/regex/pcre2/pcre2_substring.c b/std/regex/pcre2/pcre2_substring.c index 14e919dce..a6f5277a3 100644 --- a/std/regex/pcre2/pcre2_substring.c +++ b/std/regex/pcre2/pcre2_substring.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2023 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -39,10 +39,6 @@ POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pcre2_internal.h" @@ -126,7 +122,7 @@ PCRE2_SIZE size; rc = pcre2_substring_length_bynumber(match_data, stringnumber, &size); if (rc < 0) return rc; if (size + 1 > *sizeptr) return PCRE2_ERROR_NOMEMORY; -memcpy(buffer, match_data->subject + match_data->ovector[stringnumber*2], +if (size != 0) memcpy(buffer, match_data->subject + match_data->ovector[stringnumber*2], CU2BYTES(size)); buffer[size] = 0; *sizeptr = size; @@ -214,11 +210,12 @@ PCRE2_SIZE size; PCRE2_UCHAR *yield; rc = pcre2_substring_length_bynumber(match_data, stringnumber, &size); if (rc < 0) return rc; -yield = PRIV(memctl_malloc)(sizeof(pcre2_memctl) + - (size + 1)*PCRE2_CODE_UNIT_WIDTH, (pcre2_memctl *)match_data); -if (yield == NULL) return PCRE2_ERROR_NOMEMORY; +if (size > ((PCRE2_SIZE_MAX - sizeof(pcre2_memctl)) / CU2BYTES(1)) - 1 || + (yield = PRIV(memctl_malloc)(sizeof(pcre2_memctl) + + CU2BYTES(size + 1), (pcre2_memctl *)match_data)) == NULL) + return PCRE2_ERROR_NOMEMORY; yield = (PCRE2_UCHAR *)(((char *)yield) + sizeof(pcre2_memctl)); -memcpy(yield, match_data->subject + match_data->ovector[stringnumber*2], +if (size != 0) memcpy(yield, match_data->subject + match_data->ovector[stringnumber*2], CU2BYTES(size)); yield[size] = 0; *stringptr = yield; @@ -259,7 +256,7 @@ permits duplicate names, the first substring that is set is chosen. Arguments: match_data pointer to match data stringname the name of the required substring - sizeptr where to put the length + sizeptr where to put the length, if not NULL Returns: 0 if successful, else a negative error number */ @@ -342,8 +339,15 @@ else /* Matched using pcre2_dfa_match() */ left = match_data->ovector[stringnumber*2]; right = match_data->ovector[stringnumber*2+1]; +/* LCOV_EXCL_START - this appears to be unreachable, as the ovector and +subject_length should always be set consistently, no matter what misbehaviour +the caller has committed. */ if (left > match_data->subject_length || right > match_data->subject_length) + { + PCRE2_DEBUG_UNREACHABLE(); return PCRE2_ERROR_INVALIDOFFSET; + } +/* LCOV_EXCL_STOP */ if (sizeptr != NULL) *sizeptr = (left > right)? 0 : right - left; return 0; } @@ -486,7 +490,7 @@ pcre2_substring_nametable_scan(const pcre2_code *code, PCRE2_SPTR stringname, uint16_t bot = 0; uint16_t top = code->name_count; uint16_t entrysize = code->name_entry_size; -PCRE2_SPTR nametable = (PCRE2_SPTR)((char *)code + sizeof(pcre2_real_code)); +PCRE2_SPTR nametable = (PCRE2_SPTR)((const char *)code + sizeof(pcre2_real_code)); while (top > bot) { diff --git a/std/regex/pcre2/pcre2_tables.c b/std/regex/pcre2/pcre2_tables.c index 097a1acca..0b9b43bf2 100644 --- a/std/regex/pcre2/pcre2_tables.c +++ b/std/regex/pcre2/pcre2_tables.c @@ -38,27 +38,33 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ + /* This module contains some fixed tables that are used by more than one of the PCRE2 code modules. The tables are also #included by the pcre2test program, which uses macros to change their names from _pcre2_xxx to xxxx, thereby avoiding name clashes with the library. In this case, PCRE2_PCRE2TEST is defined. */ -#ifndef PCRE2_PCRE2TEST /* We're compiling the library */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif + +#if !defined(PCRE2_PCRE2TEST) && !defined(PCRE2_DFTABLES) && \ + !defined(PCRE2_PCRE2POSIX) /* We're compiling the library */ #include "pcre2_internal.h" -#endif /* PCRE2_PCRE2TEST */ +#endif + + +/* Utility macros */ +#define ARR_SIZE(x) sizeof(x)/sizeof(x[0]) + + +#if !defined(PCRE2_PCRE2TEST) && !defined(PCRE2_DFTABLES) && \ + !defined(PCRE2_PCRE2POSIX) /* Table of sizes for the fixed-length opcodes. It's defined in a macro so that the definition is next to the definition of the opcodes in pcre2_internal.h. This is mode-dependent, so it is skipped when this file is included by pcre2test. */ -#ifndef PCRE2_PCRE2TEST const uint8_t PRIV(OP_lengths)[] = { OP_LENGTHS }; -#endif /* Tables of horizontal and vertical whitespace characters, suitable for adding to classes. */ @@ -66,6 +72,11 @@ adding to classes. */ const uint32_t PRIV(hspace_list)[] = { HSPACE_LIST }; const uint32_t PRIV(vspace_list)[] = { VSPACE_LIST }; +#endif /* !PCRE2_PCRE2TEST && !PCRE2_DFTABLES && !PCRE2_PCRE2POSIX */ + + +#if !defined(PCRE2_DFTABLES) && !defined(PCRE2_PCRE2POSIX) + /* These tables are the pairs of delimiters that are valid for callout string arguments. For each starting delimiter there must be a matching ending delimiter, which in fact is different only for bracket-like delimiters. */ @@ -80,6 +91,8 @@ const uint32_t PRIV(callout_end_delims[]) = { CHAR_CIRCUMFLEX_ACCENT, CHAR_PERCENT_SIGN, CHAR_NUMBER_SIGN, CHAR_DOLLAR_SIGN, CHAR_RIGHT_CURLY_BRACKET, 0 }; +#endif /* !PCRE2_DFTABLES && !PCRE2_PCRE2POSIX */ + /************************************************* * Tables for UTF-8 support * @@ -90,23 +103,24 @@ as for the library in 8-bit mode, because pcre2test uses UTF-8 internally for handling wide characters. */ #if defined PCRE2_PCRE2TEST || \ - (defined SUPPORT_UNICODE && \ - defined PCRE2_CODE_UNIT_WIDTH && \ - PCRE2_CODE_UNIT_WIDTH == 8) + (!defined(PCRE2_DFTABLES) && !defined(PCRE2_PCRE2POSIX) && \ + defined SUPPORT_UNICODE && \ + defined PCRE2_CODE_UNIT_WIDTH && \ + PCRE2_CODE_UNIT_WIDTH == 8) /* These are the breakpoints for different numbers of bytes in a UTF-8 character. */ const int PRIV(utf8_table1)[] = - { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff}; + { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff }; -const int PRIV(utf8_table1_size) = sizeof(PRIV(utf8_table1)) / sizeof(int); +const unsigned PRIV(utf8_table1_size) = ARR_SIZE(PRIV(utf8_table1)); /* These are the indicator bits and the mask for the data bits to set in the first byte of a character, indexed by the number of additional bytes. */ -const int PRIV(utf8_table2)[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc}; -const int PRIV(utf8_table3)[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01}; +const int PRIV(utf8_table2)[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc }; +const int PRIV(utf8_table3)[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01 }; /* Table of the number of extra bytes, indexed by the first byte masked with 0x3f. The highest number for a valid UTF-8 first byte is in fact 0x3d. */ @@ -120,10 +134,11 @@ const uint8_t PRIV(utf8_table4)[] = { #endif /* UTF-8 support needed */ /* Tables concerned with Unicode properties are relevant only when Unicode -support is enabled. See also the pcre2_ucptables.c file, which is generated by +support is enabled. See also the pcre2_ucptables_inc.h file, which is generated by a Python script from Unicode data files. */ -#ifdef SUPPORT_UNICODE +#if !defined(PCRE2_DFTABLES) && !defined(PCRE2_PCRE2POSIX) && \ + defined(SUPPORT_UNICODE) /* Table to translate from particular type value to the general value. */ @@ -227,8 +242,69 @@ const int PRIV(ucp_typerange)[] = { /* Finally, include the tables that are auto-generated from the Unicode data files. */ -#include "pcre2_ucptables.c" +#include "pcre2_ucptables_inc.h" + +#endif /* Unicode support needed */ + + +/************************************************* +* Tables for EBCDIC support * +*************************************************/ + +#if defined(EBCDIC) && \ + (defined(PCRE2_PCRE2TEST) || defined(PCRE2_DFTABLES) || 'a' != 0x81) + +const uint8_t PRIV(ebcdic_1047_to_ascii)[256] = { + 0x00,0x01,0x02,0x03,0x9c,0x09,0x86,0x7f,0x97,0x8d,0x8e,0x0b,0x0c,0x0d,0x0e,0x0f, +#ifdef EBCDIC_NL25 + 0x10,0x11,0x12,0x13,0x9d,0x85,0x08,0x87,0x18,0x19,0x92,0x8f,0x1c,0x1d,0x1e,0x1f, + 0x80,0x81,0x82,0x83,0x84,0x0a,0x17,0x1b,0x88,0x89,0x8a,0x8b,0x8c,0x05,0x06,0x07, +#else + 0x10,0x11,0x12,0x13,0x9d,0x0a,0x08,0x87,0x18,0x19,0x92,0x8f,0x1c,0x1d,0x1e,0x1f, + 0x80,0x81,0x82,0x83,0x84,0x85,0x17,0x1b,0x88,0x89,0x8a,0x8b,0x8c,0x05,0x06,0x07, +#endif + 0x90,0x91,0x16,0x93,0x94,0x95,0x96,0x04,0x98,0x99,0x9a,0x9b,0x14,0x15,0x9e,0x1a, + 0x20,0xa0,0xe2,0xe4,0xe0,0xe1,0xe3,0xe5,0xe7,0xf1,0xa2,0x2e,0x3c,0x28,0x2b,0x7c, + 0x26,0xe9,0xea,0xeb,0xe8,0xed,0xee,0xef,0xec,0xdf,0x21,0x24,0x2a,0x29,0x3b,0x5e, + 0x2d,0x2f,0xc2,0xc4,0xc0,0xc1,0xc3,0xc5,0xc7,0xd1,0xa6,0x2c,0x25,0x5f,0x3e,0x3f, + 0xf8,0xc9,0xca,0xcb,0xc8,0xcd,0xce,0xcf,0xcc,0x60,0x3a,0x23,0x40,0x27,0x3d,0x22, + 0xd8,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0xab,0xbb,0xf0,0xfd,0xfe,0xb1, + 0xb0,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0xaa,0xba,0xe6,0xb8,0xc6,0xa4, + 0xb5,0x7e,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0xa1,0xbf,0xd0,0x5b,0xde,0xae, + 0xac,0xa3,0xa5,0xb7,0xa9,0xa7,0xb6,0xbc,0xbd,0xbe,0xdd,0xa8,0xaf,0x5d,0xb4,0xd7, + 0x7b,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0xad,0xf4,0xf6,0xf2,0xf3,0xf5, + 0x7d,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0xb9,0xfb,0xfc,0xf9,0xfa,0xff, + 0x5c,0xf7,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0xb2,0xd4,0xd6,0xd2,0xd3,0xd5, + 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0xb3,0xdb,0xdc,0xd9,0xda,0x9f, +}; + +const uint8_t PRIV(ascii_to_ebcdic_1047)[256] = { +#ifdef EBCDIC_NL25 + 0x00,0x01,0x02,0x03,0x37,0x2d,0x2e,0x2f,0x16,0x05,0x25,0x0b,0x0c,0x0d,0x0e,0x0f, +#else + 0x00,0x01,0x02,0x03,0x37,0x2d,0x2e,0x2f,0x16,0x05,0x15,0x0b,0x0c,0x0d,0x0e,0x0f, +#endif + 0x10,0x11,0x12,0x13,0x3c,0x3d,0x32,0x26,0x18,0x19,0x3f,0x27,0x1c,0x1d,0x1e,0x1f, + 0x40,0x5a,0x7f,0x7b,0x5b,0x6c,0x50,0x7d,0x4d,0x5d,0x5c,0x4e,0x6b,0x60,0x4b,0x61, + 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0x7a,0x5e,0x4c,0x7e,0x6e,0x6f, + 0x7c,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6, + 0xd7,0xd8,0xd9,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xad,0xe0,0xbd,0x5f,0x6d, + 0x79,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x91,0x92,0x93,0x94,0x95,0x96, + 0x97,0x98,0x99,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xc0,0x4f,0xd0,0xa1,0x07, +#ifdef EBCDIC_NL25 + 0x20,0x21,0x22,0x23,0x24,0x15,0x06,0x17,0x28,0x29,0x2a,0x2b,0x2c,0x09,0x0a,0x1b, +#else + 0x20,0x21,0x22,0x23,0x24,0x25,0x06,0x17,0x28,0x29,0x2a,0x2b,0x2c,0x09,0x0a,0x1b, +#endif + 0x30,0x31,0x1a,0x33,0x34,0x35,0x36,0x08,0x38,0x39,0x3a,0x3b,0x04,0x14,0x3e,0xff, + 0x41,0xaa,0x4a,0xb1,0x9f,0xb2,0x6a,0xb5,0xbb,0xb4,0x9a,0x8a,0xb0,0xca,0xaf,0xbc, + 0x90,0x8f,0xea,0xfa,0xbe,0xa0,0xb6,0xb3,0x9d,0xda,0x9b,0x8b,0xb7,0xb8,0xb9,0xab, + 0x64,0x65,0x62,0x66,0x63,0x67,0x9e,0x68,0x74,0x71,0x72,0x73,0x78,0x75,0x76,0x77, + 0xac,0x69,0xed,0xee,0xeb,0xef,0xec,0xbf,0x80,0xfd,0xfe,0xfb,0xfc,0xba,0xae,0x59, + 0x44,0x45,0x42,0x46,0x43,0x47,0x9c,0x48,0x54,0x51,0x52,0x53,0x58,0x55,0x56,0x57, + 0x8c,0x49,0xcd,0xce,0xcb,0xcf,0xcc,0xe1,0x70,0xdd,0xde,0xdb,0xdc,0x8d,0x8e,0xdf, +}; -#endif /* SUPPORT_UNICODE */ +#endif /* EBCDIC support needed */ /* End of pcre2_tables.c */ diff --git a/std/regex/pcre2/pcre2_ucd.c b/std/regex/pcre2/pcre2_ucd.c index 97dbc8b26..7b294a858 100644 --- a/std/regex/pcre2/pcre2_ucd.c +++ b/std/regex/pcre2/pcre2_ucd.c @@ -42,6 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ + /* This file contains tables of Unicode properties that are extracted from Unicode data files. See the comments at the start of maint/GenerateUcd.py for details. @@ -52,13 +53,13 @@ _pcre2_xxx to xxxx, thereby avoiding name clashes with the library. At present, just one of these tables is actually needed. When compiling the library, some headers are needed. */ + #ifndef PCRE2_PCRE2TEST -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "pcre2_internal.h" #endif /* PCRE2_PCRE2TEST */ + + /* The tables herein are needed only when UCP support is built, and in PCRE2 that happens automatically with UTF support. This module should not be referenced otherwise, so it should not matter whether it is compiled or not. @@ -72,11 +73,13 @@ const ucd_record PRIV(ucd_records)[] = {{0,0,0,0,0,0,0}}; const uint16_t PRIV(ucd_stage1)[] = {0}; const uint16_t PRIV(ucd_stage2)[] = {0}; const uint32_t PRIV(ucd_caseless_sets)[] = {0}; +const uint32_t PRIV(ucd_nocase_ranges)[] = {0}; +const uint32_t PRIV(ucd_nocase_ranges_size) = 0; #else -/* Total size: 112564 bytes, block size: 128. */ +/* Total size: 116548 bytes, block size: 128. */ -const char *PRIV(unicode_version) = "15.0.0"; +const char *PRIV(unicode_version) = "17.0.0"; /* When recompiling tables with a new Unicode version, please check the types in this structure definition with those in pcre2_internal.h (the actual field @@ -140,28 +143,88 @@ const uint32_t PRIV(ucd_caseless_sets)[] = { 0x004b, 0x006b, 0x212a, NOTACHAR, 0x00c5, 0x00e5, 0x212b, NOTACHAR, 0x1c88, 0xa64a, 0xa64b, NOTACHAR, + 0x0069, 0x0130, NOTACHAR, + 0x0049, 0x0131, NOTACHAR, }; +/* This is the index, within ucd_caseless_sets, of the additional +Turkish case-equivalences. The dotted I ones are this offset; the +dotless I are +3 from here. */ + +const uint32_t PRIV(ucd_turkish_dotted_i_caseset) = 112; + /* When #included in pcre2test, we don't need the table of digit sets, nor the the large main UCD tables. */ #ifndef PCRE2_PCRE2TEST +/* This table contains character ranges, where the characters in the range have +no other case. Both start and end values are excluded from the range. */ + +const uint32_t PRIV(ucd_nocase_ranges)[] = { + 0x0000, 0x0041, /* 64 */ + 0x007a, 0x00b5, /* 58 */ + 0x00b5, 0x00c0, /* 10 */ + 0x0292, 0x029d, /* 10 */ + 0x029e, 0x0345, /* 166 */ + 0x0345, 0x0370, /* 42 */ + 0x0481, 0x048a, /* 8 */ + 0x0556, 0x0561, /* 10 */ + 0x0586, 0x10a0, /* 2841 */ + 0x10ff, 0x13a0, /* 672 */ + 0x13fd, 0x1c80, /* 2178 */ + 0x1cbf, 0x1d79, /* 185 */ + 0x1d7d, 0x1d8e, /* 16 */ + 0x1d8e, 0x1e00, /* 113 */ + 0x1ffc, 0x2126, /* 297 */ + 0x2132, 0x214e, /* 27 */ + 0x214e, 0x2160, /* 17 */ + 0x2184, 0x24b6, /* 817 */ + 0x24e9, 0x2c00, /* 1814 */ + 0x2cf3, 0x2d00, /* 12 */ + 0x2d2d, 0xa640, /* 30994 */ + 0xa66d, 0xa680, /* 18 */ + 0xa69b, 0xa722, /* 134 */ + 0xa76f, 0xa779, /* 9 */ + 0xa7dc, 0xa7f5, /* 24 */ + 0xa7f6, 0xab53, /* 860 */ + 0xab53, 0xab70, /* 28 */ + 0xabbf, 0xfb05, /* 20293 */ + 0xfb06, 0xff21, /* 1050 */ + 0xff5a, 0x10400, /* 1189 */ + 0x1044f, 0x104b0, /* 96 */ + 0x104fb, 0x10570, /* 116 */ + 0x105bc, 0x10c80, /* 1731 */ + 0x10cb2, 0x10cc0, /* 13 */ + 0x10cf2, 0x10d50, /* 93 */ + 0x10d65, 0x10d70, /* 10 */ + 0x10d85, 0x118a0, /* 2842 */ + 0x118df, 0x16e40, /* 21856 */ + 0x16e7f, 0x16ea0, /* 32 */ + 0x16ed3, 0x1e900, /* 31276 */ + 0x1e943, 0x110000, /* 988860 */ + 0xffffffff, 0xffffffff /* terminator */ +}; + +/* Total: 1110881 characters. */ +const uint32_t PRIV(ucd_nocase_ranges_size) = 82; + /* This table lists the code points for the '9' characters in each set of decimal digits. It is used to ensure that all the digits in a script run come from the same set. */ const uint32_t PRIV(ucd_digit_sets)[] = { - 68, /* Number of subsequent values */ + 77, /* Number of subsequent values */ 0x00039, 0x00669, 0x006f9, 0x007c9, 0x0096f, 0x009ef, 0x00a6f, 0x00aef, 0x00b6f, 0x00bef, 0x00c6f, 0x00cef, 0x00d6f, 0x00def, 0x00e59, 0x00ed9, 0x00f29, 0x01049, 0x01099, 0x017e9, 0x01819, 0x0194f, 0x019d9, 0x01a89, 0x01a99, 0x01b59, 0x01bb9, 0x01c49, 0x01c59, 0x0a629, 0x0a8d9, 0x0a909, - 0x0a9d9, 0x0a9f9, 0x0aa59, 0x0abf9, 0x0ff19, 0x104a9, 0x10d39, 0x1106f, - 0x110f9, 0x1113f, 0x111d9, 0x112f9, 0x11459, 0x114d9, 0x11659, 0x116c9, - 0x11739, 0x118e9, 0x11959, 0x11c59, 0x11d59, 0x11da9, 0x11f59, 0x16a69, - 0x16ac9, 0x16b59, 0x1d7d7, 0x1d7e1, 0x1d7eb, 0x1d7f5, 0x1d7ff, 0x1e149, - 0x1e2f9, 0x1e4f9, 0x1e959, 0x1fbf9, + 0x0a9d9, 0x0a9f9, 0x0aa59, 0x0abf9, 0x0ff19, 0x104a9, 0x10d39, 0x10d49, + 0x1106f, 0x110f9, 0x1113f, 0x111d9, 0x112f9, 0x11459, 0x114d9, 0x11659, + 0x116c9, 0x116d9, 0x116e3, 0x11739, 0x118e9, 0x11959, 0x11bf9, 0x11c59, + 0x11d59, 0x11da9, 0x11de9, 0x11f59, 0x16139, 0x16a69, 0x16ac9, 0x16b59, + 0x16d79, 0x1ccf9, 0x1d7d7, 0x1d7e1, 0x1d7eb, 0x1d7f5, 0x1d7ff, 0x1e149, + 0x1e2f9, 0x1e4f9, 0x1e5fa, 0x1e959, 0x1fbf9, }; /* This vector is a list of script bitsets for the Script Extension property. @@ -169,69 +232,125 @@ The number of 32-bit words in each bitset is #defined in pcre2_ucp.h as ucd_script_sets_item_size. */ const uint32_t PRIV(ucd_script_sets)[] = { - 0x00000000u, 0x00000000u, 0x00000000u, - 0x00000080u, 0x00000000u, 0x00000000u, - 0x00000040u, 0x00000000u, 0x00000000u, - 0x00000000u, 0x00004000u, 0x00000000u, - 0x00000002u, 0x00000000u, 0x00000000u, - 0x00800000u, 0x00000000u, 0x00000000u, - 0x00000001u, 0x00000000u, 0x00000000u, - 0x00000000u, 0x00000000u, 0x00000001u, - 0x00000010u, 0x00000000u, 0x00000000u, - 0x00000008u, 0x00000004u, 0x00000000u, - 0x00000008u, 0x40000000u, 0x00000000u, - 0x00000008u, 0x00000040u, 0x00000000u, - 0x00000018u, 0x00000000u, 0x00000000u, - 0x00000028u, 0x00000000u, 0x00000000u, - 0x000000c0u, 0x00000000u, 0x00000000u, - 0x00c00000u, 0x00000000u, 0x00000000u, - 0x00000000u, 0x00000102u, 0x00000000u, - 0x80000000u, 0x00000001u, 0x00000000u, - 0x00000004u, 0x00000008u, 0x00000000u, - 0x00000005u, 0x00000000u, 0x00000000u, - 0x00000004u, 0x00200000u, 0x00000000u, - 0x00000014u, 0x00000000u, 0x00000000u, - 0x00000040u, 0x00008000u, 0x00000000u, - 0x00000040u, 0x00000000u, 0x00000001u, - 0x00000040u, 0x00001000u, 0x00000000u, - 0x00000840u, 0x00000000u, 0x00000000u, - 0x00020001u, 0x00000000u, 0x00000000u, - 0x00000800u, 0x00008000u, 0x00000000u, - 0x00000200u, 0x00010000u, 0x00000000u, - 0x00000100u, 0x02000000u, 0x00000000u, - 0x00800001u, 0x00000000u, 0x00000000u, - 0x00300000u, 0x00000000u, 0x00000000u, - 0x00002000u, 0x00000000u, 0x00000001u, - 0x00080001u, 0x00000000u, 0x00000000u, - 0x00000000u, 0x00080000u, 0x00000008u, - 0x00080000u, 0x00000020u, 0x00000000u, - 0x00000038u, 0x00000000u, 0x00000000u, - 0x00000028u, 0x00000000u, 0x00000002u, - 0x00000080u, 0x00000810u, 0x00000000u, - 0x40010000u, 0x00000800u, 0x00000000u, - 0x80000000u, 0x00000001u, 0x00000004u, - 0x80000000u, 0x00020001u, 0x00000000u, - 0x00002040u, 0x00008000u, 0x00000000u, - 0x00000041u, 0x00008000u, 0x00000000u, - 0x00b00000u, 0x00000000u, 0x00000000u, - 0x00010001u, 0x00000080u, 0x00000000u, - 0x000020c0u, 0x00008000u, 0x00000000u, - 0x1e000000u, 0x00000000u, 0x00000000u, - 0x00000040u, 0x10040200u, 0x00000000u, - 0x00f40000u, 0x00000000u, 0x00000000u, - 0x00000038u, 0x40000040u, 0x00000002u, - 0x01f40000u, 0x00000000u, 0x00000000u, - 0x00007c40u, 0x00000000u, 0x00000000u, - 0x00000038u, 0x44000040u, 0x00000002u, - 0x000034c0u, 0x01008000u, 0x00000001u, - 0x00000018u, 0xc4480400u, 0x00000008u, - 0x00000340u, 0x11952200u, 0x00000000u, - 0x00007fc1u, 0x01008000u, 0x00000000u, - 0x00007fc1u, 0x01009000u, 0x00000000u, - 0x00002340u, 0x11952200u, 0x00000001u, - 0x00006340u, 0x11952200u, 0x00000001u, - 0x0000ffc0u, 0x3984a010u, 0x00000001u, - 0x2000ffc0u, 0x3984a010u, 0x00000001u, + 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x40200003u, 0x00381901u, 0x00200246u, 0x00000000u, + 0x00040305u, 0x00800000u, 0x10000000u, 0x00000000u, + 0x20000001u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00000001u, 0x00800000u, 0x00000000u, 0x00000000u, + 0x00040001u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x01000007u, 0x00000840u, 0x00000200u, 0x00000001u, + 0x01000007u, 0x00000040u, 0x00020000u, 0x00000003u, + 0x01000005u, 0x00002000u, 0x00000000u, 0x00000000u, + 0x00040041u, 0x00001000u, 0x00000000u, 0x00000001u, + 0x01000047u, 0x00002801u, 0x00020001u, 0x00000002u, + 0x10000001u, 0x00001801u, 0x00000004u, 0x00000000u, + 0x00000007u, 0x00002000u, 0x00000200u, 0x00000000u, + 0x00000051u, 0x00002840u, 0x00000202u, 0x00000002u, + 0x0000005fu, 0x00002041u, 0x00000202u, 0x00000000u, + 0x00000001u, 0x00002000u, 0x00000000u, 0x00000000u, + 0x00000041u, 0x00000000u, 0x00000002u, 0x00000000u, + 0x01000005u, 0x00000000u, 0x00020000u, 0x00000000u, + 0x01000001u, 0x00000040u, 0x00000000u, 0x00000000u, + 0x00000001u, 0x00000000u, 0x00000000u, 0x00000001u, + 0x00800001u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00000005u, 0x00000000u, 0x00000000u, 0x00000002u, + 0x00000003u, 0x00000000u, 0x00000200u, 0x00000002u, + 0x11000041u, 0x00002000u, 0x00000002u, 0x00000000u, + 0x01000041u, 0x00000000u, 0x00000002u, 0x00000000u, + 0x00000041u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00000041u, 0x00000000u, 0x00000000u, 0x00000001u, + 0x01000041u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x01040041u, 0x00000001u, 0x00000001u, 0x00000001u, + 0x00000002u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00000001u, 0x00000000u, 0x00020000u, 0x00000000u, + 0x00000001u, 0x00000000u, 0x00000001u, 0x00000002u, + 0x00000001u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00000002u, 0x00000800u, 0x00000000u, 0x00000000u, + 0x00000004u, 0x00000000u, 0x00000200u, 0x00000000u, + 0x00000004u, 0x00001000u, 0x00000000u, 0x00000000u, + 0x00000005u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00200008u, 0x00001000u, 0x00000000u, 0x00000000u, + 0x000000e0u, 0x00010000u, 0x22400000u, 0x00000000u, + 0x000000e0u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x000000e0u, 0x00010000u, 0x22408000u, 0x00000000u, + 0x00000060u, 0x08000000u, 0x08c08480u, 0x00000000u, + 0x00000060u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x000000a0u, 0x00000000u, 0x02000000u, 0x00000000u, + 0x00000020u, 0x00000000u, 0x00400000u, 0x00000000u, + 0x0001ff01u, 0x40000000u, 0x01011008u, 0x00000000u, + 0x0001ff01u, 0x00000000u, 0x00011008u, 0x00000000u, + 0x0003ff00u, 0x80004000u, 0x81381848u, 0x00000000u, + 0x0003ff00u, 0x80004020u, 0xc1381848u, 0x00000000u, + 0x00000100u, 0x04000000u, 0x00100040u, 0x00000000u, + 0x00000200u, 0x10004000u, 0x00000000u, 0x00000000u, + 0x00000400u, 0x00000000u, 0x00002000u, 0x00000000u, + 0x00000800u, 0x00000000u, 0x00000010u, 0x00000000u, + 0x00002000u, 0x00000000u, 0x00000008u, 0x00000000u, + 0x00008000u, 0x00000000u, 0x01000000u, 0x00000004u, + 0x00100000u, 0x10000040u, 0x00000000u, 0x00000000u, + 0x00200001u, 0x00001000u, 0x00000000u, 0x00000000u, + 0x02000000u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00000000u, 0x0000001eu, 0x00000000u, 0x00000000u, + 0x04000000u, 0x00008000u, 0x00000000u, 0x00000000u, + 0x00008300u, 0x00000000u, 0x00000008u, 0x00000000u, + 0x00000100u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00008100u, 0x00000000u, 0x00000008u, 0x00000000u, + 0x00004300u, 0x00000000u, 0x00011000u, 0x00000000u, + 0x00004300u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00000100u, 0x40000000u, 0x00010000u, 0x00000000u, + 0x00004300u, 0x00000000u, 0x00010000u, 0x00000000u, + 0x00000100u, 0x40000000u, 0x00000000u, 0x00000000u, + 0x0001f100u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00000300u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00000100u, 0x00000000u, 0x00011000u, 0x00000000u, + 0x00000100u, 0x00000000u, 0x01010000u, 0x00000000u, + 0x00000300u, 0x40000000u, 0x00000000u, 0x00000000u, + 0x00000100u, 0x00000000u, 0x00010000u, 0x00000000u, + 0x00000300u, 0x40000000u, 0x00010000u, 0x00000000u, + 0x0003d300u, 0x00000000u, 0x01001008u, 0x00000004u, + 0x00000100u, 0x00000000u, 0x00000008u, 0x00000000u, + 0x00008100u, 0x00000000u, 0x00000008u, 0x00000004u, + 0x00000200u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00000000u, 0x00000000u, 0x01000000u, 0x00000000u, + 0x00000045u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00000040u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x04000001u, 0x00008000u, 0x00000000u, 0x00000000u, + 0x00000020u, 0x00000000u, 0x00008000u, 0x00000000u, + 0x00200000u, 0x020c1000u, 0x00004000u, 0x00000000u, + 0x00000002u, 0x20080000u, 0x00004000u, 0x00000000u, + 0x00000101u, 0x00000000u, 0x00000008u, 0x00000000u, + 0x00000001u, 0x00000800u, 0x00000000u, 0x00000000u, + 0x00000000u, 0x02200000u, 0x00000000u, 0x00000000u, + 0x00200000u, 0x04780000u, 0x00004000u, 0x00000000u, + 0x00000000u, 0x00000000u, 0x00000002u, 0x00000000u, + 0x00000020u, 0x00000000u, 0x0000c000u, 0x00000000u, + 0x40000000u, 0x00000000u, 0x00040000u, 0x00000000u, + 0xfc400000u, 0x00000000u, 0x00000000u, 0x00000000u, + 0xfc400000u, 0x00008000u, 0x00000000u, 0x00000000u, + 0x78400000u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x40000000u, 0x00000000u, 0x00000000u, 0x00000000u, + 0xfc480000u, 0x00000000u, 0x00000000u, 0x00000000u, + 0xfc480000u, 0x00800000u, 0x00000000u, 0x00000000u, + 0xf8400000u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x60000000u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x18000000u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x58000000u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x40000001u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00018d00u, 0xc4000000u, 0x01101950u, 0x00000004u, + 0x00008d00u, 0xc4000000u, 0x01101950u, 0x00000004u, + 0x00000d00u, 0x84000000u, 0x00101950u, 0x00000000u, + 0x00000d00u, 0xc4000000u, 0x00101950u, 0x00000000u, + 0x00000300u, 0x00000000u, 0x00000000u, 0x00000004u, + 0x00002100u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00100001u, 0x00020000u, 0x00000000u, 0x00000000u, + 0x00000000u, 0x01000400u, 0x00000000u, 0x00000000u, + 0x00000020u, 0x00010000u, 0x00000000u, 0x00000000u, + 0x000000a0u, 0x00000000u, 0x00000000u, 0x00000000u, + 0x00000000u, 0x00000280u, 0x04000000u, 0x00000000u, + 0x00000000u, 0x00000280u, 0x00000000u, 0x00000000u, + 0x00000000u, 0x00000280u, 0x00000020u, 0x00000000u, + 0x00000020u, 0x00000800u, 0x00000000u, 0x00000000u, + 0x00000000u, 0x00000000u, 0x08000080u, 0x00000000u, }; /* This vector is a list of bitsets for Boolean properties. The number of @@ -241,181 +360,195 @@ pcre2_ucp.h. */ const uint32_t PRIV(ucd_boolprop_sets)[] = { 0x00000000u, 0x00000000u, 0x00000001u, 0x00000000u, - 0x00000001u, 0x00020040u, - 0x00800001u, 0x00020040u, - 0x00800001u, 0x00002820u, - 0x00800001u, 0x00000120u, - 0x00830001u, 0x00000020u, - 0x00800001u, 0x00000020u, - 0x00800021u, 0x00000120u, - 0x00800011u, 0x00000020u, - 0x00800001u, 0x00000028u, - 0x00800001u, 0x00002020u, - 0x00801001u, 0x00000020u, - 0x00800021u, 0x00002820u, - 0x24830003u, 0x00040000u, - 0x00800021u, 0x00002020u, - 0x00800011u, 0x00000028u, - 0x648003c7u, 0x000c8000u, - 0x608003c5u, 0x000c8000u, - 0x00808021u, 0x00000028u, - 0x20800001u, 0x00040000u, - 0x00808021u, 0x00000020u, - 0x64800d47u, 0x000c0004u, - 0x60800d45u, 0x000c0004u, - 0x60800d45u, 0x000c1004u, - 0x00000000u, 0x00020040u, - 0x00800000u, 0x00020000u, - 0x00800000u, 0x00000020u, + 0x00000001u, 0x00400800u, + 0x00800001u, 0x00400800u, + 0x00800001u, 0x00050400u, + 0x00800001u, 0x00002400u, + 0x00830001u, 0x00000400u, + 0x00800001u, 0x00000400u, + 0x00800021u, 0x00002400u, + 0x00800011u, 0x00000400u, + 0x00800001u, 0x00000480u, + 0x00800001u, 0x00040400u, + 0x00801001u, 0x00000400u, + 0x00800021u, 0x00050400u, + 0x04830003u, 0x00800001u, + 0x00800021u, 0x00040400u, + 0x00800011u, 0x00000480u, + 0x048003c7u, 0x01900003u, + 0x008003c5u, 0x01900003u, + 0x00808021u, 0x00000480u, + 0x00800001u, 0x00800001u, + 0x00808021u, 0x00000400u, + 0x04800d47u, 0x01800043u, + 0x00800d45u, 0x01800043u, + 0x00800d45u, 0x01820043u, + 0x00000000u, 0x00400800u, + 0x00800000u, 0x00400000u, + 0x00800000u, 0x00000400u, 0x00808020u, 0x00000000u, - 0x00a10000u, 0x00000020u, - 0x60800044u, 0x000c0004u, - 0x00800010u, 0x00000120u, - 0x00800000u, 0x00000028u, + 0x00a10000u, 0x00000400u, + 0x00800044u, 0x01800043u, + 0x00800010u, 0x00002400u, + 0x00800000u, 0x00000480u, 0x00002020u, 0x00000000u, + 0x40800000u, 0x00000000u, + 0x00800dc4u, 0x01800043u, + 0x00c08020u, 0x00800001u, 0x00800000u, 0x00000000u, - 0x60800dc4u, 0x000c0004u, - 0x20c08020u, 0x00040000u, - 0x608003c4u, 0x000c8000u, - 0x60800d44u, 0x000c0004u, - 0x60800d44u, 0x000c1004u, - 0x60804dc4u, 0x000c0004u, - 0x60800004u, 0x000c0000u, - 0x608007c4u, 0x000c8000u, - 0x60800bc4u, 0x000c0000u, - 0x60808064u, 0x000c0004u, - 0x60808064u, 0x000c1004u, - 0x60808024u, 0x000c0000u, - 0x60c08024u, 0x000c0000u, - 0x21008020u, 0x00040000u, - 0x21008de4u, 0x00040004u, - 0x21002020u, 0x00040000u, - 0x21000020u, 0x00040000u, - 0x60808064u, 0x00000004u, - 0x00800000u, 0x00002000u, - 0x20800020u, 0x00042000u, - 0x60800dc4u, 0x000c000cu, - 0x60800044u, 0x000c8008u, - 0x60800044u, 0x000c8000u, - 0x608003c4u, 0x000c8008u, - 0x00800000u, 0x00000008u, - 0x01000020u, 0x00000000u, + 0x008003c4u, 0x01900003u, + 0x00800d44u, 0x01800043u, + 0x00800d44u, 0x01820043u, + 0x00804dc4u, 0x01800043u, + 0x00800004u, 0x01800003u, + 0x008007c4u, 0x01900003u, + 0x00800bc4u, 0x01800003u, + 0x00808064u, 0x01800043u, + 0x00808064u, 0x01820043u, + 0x00808024u, 0x01800003u, + 0x00c08024u, 0x01800003u, + 0x01008020u, 0x00800009u, + 0x01008de4u, 0x00800049u, + 0x01002020u, 0x00800009u, + 0x01000020u, 0x00800009u, + 0x01000024u, 0x00800009u, + 0x00808064u, 0x00000043u, + 0x00800000u, 0x00040000u, + 0x00800020u, 0x00840001u, + 0x00800dc4u, 0x018000c3u, + 0x00800044u, 0x01900083u, + 0x00800044u, 0x01900003u, + 0x008003c4u, 0x01900083u, + 0x00800000u, 0x00000080u, + 0x01000020u, 0x00000008u, 0x00800020u, 0x00000000u, - 0x00800000u, 0x00002800u, + 0x00800000u, 0x00050000u, 0x00801000u, 0x00000000u, - 0x21008024u, 0x00040000u, - 0x21000024u, 0x00040000u, - 0x00000020u, 0x00000080u, + 0x01008024u, 0x00800009u, + 0x00000020u, 0x00001000u, 0x00002028u, 0x00000000u, - 0x60c00024u, 0x000c0000u, - 0x20800000u, 0x00040000u, - 0x60804004u, 0x000c0000u, - 0x60800024u, 0x000c0000u, - 0x20800004u, 0x00040000u, - 0x23008020u, 0x00040000u, - 0x21000004u, 0x00040000u, - 0x21408020u, 0x00040000u, - 0x60800004u, 0x00040000u, - 0x23000024u, 0x00040000u, - 0x60800004u, 0x000c0002u, + 0x00c00024u, 0x01800003u, + 0x01000024u, 0x00800109u, + 0x01008020u, 0x00800109u, + 0x00800000u, 0x00800001u, + 0x00804004u, 0x01800003u, + 0x00800024u, 0x01800003u, + 0x01000020u, 0x00800109u, + 0x01008024u, 0x00800109u, + 0x00800004u, 0x00800001u, + 0x00800004u, 0x0180000bu, + 0x03008020u, 0x00800009u, + 0x01000004u, 0x00800009u, + 0x01400024u, 0x00800009u, + 0x01408020u, 0x00800009u, + 0x00800004u, 0x00800003u, + 0x03008024u, 0x00800009u, + 0x00800004u, 0x01800023u, 0x00800010u, 0x00000000u, - 0x20808000u, 0x00040000u, - 0x21004024u, 0x00040000u, - 0x20808004u, 0x00040000u, - 0x60800944u, 0x000c0004u, - 0x60800064u, 0x000c0004u, - 0x60802004u, 0x000c0000u, - 0x60800344u, 0x000c8000u, - 0x22808000u, 0x00040000u, - 0x22800000u, 0x00040000u, + 0x00808000u, 0x00800001u, + 0x01004024u, 0x00800009u, + 0x00808004u, 0x00800001u, + 0x00800944u, 0x01800043u, + 0x00800064u, 0x01800043u, + 0x00802004u, 0x01800003u, + 0x00800344u, 0x01900003u, + 0x03008000u, 0x00800009u, + 0x00804004u, 0x0180000bu, 0x00c00000u, 0x00000000u, - 0x21002020u, 0x00050000u, - 0x61000024u, 0x000c0000u, - 0x23000020u, 0x00040000u, - 0x01008020u, 0x00000000u, - 0x21408024u, 0x00040000u, + 0x01002020u, 0x00a00009u, + 0x01000024u, 0x0180000bu, + 0x01008020u, 0x00000008u, + 0x01408024u, 0x00800009u, 0x00808000u, 0x00000000u, - 0x60800044u, 0x000c1004u, - 0x60800064u, 0x000c1004u, - 0x01002020u, 0x00000001u, - 0x00022020u, 0x00000001u, - 0x00002028u, 0x00000040u, - 0x00801000u, 0x00000020u, - 0x00800020u, 0x00000120u, - 0x00800000u, 0x00000120u, - 0x00800020u, 0x00000020u, - 0x00a10000u, 0x00002820u, - 0x00800000u, 0x00002820u, - 0x20800000u, 0x00040008u, - 0x00800010u, 0x00000020u, - 0x00002020u, 0x00000008u, + 0x00800044u, 0x01820043u, + 0x01002020u, 0x00800011u, + 0x00022020u, 0x00800019u, + 0x00002028u, 0x00000800u, + 0x00801000u, 0x00000400u, + 0x00800020u, 0x00002400u, + 0x00800000u, 0x00002400u, + 0x00800020u, 0x00050400u, + 0x00800020u, 0x00000400u, + 0x00a10000u, 0x00050400u, + 0x00800000u, 0x00050400u, + 0x00800000u, 0x00800081u, + 0x00800010u, 0x00000400u, + 0x00002020u, 0x00000080u, 0x00002000u, 0x00000000u, 0x00006020u, 0x00000000u, - 0x00801000u, 0x00000008u, - 0x00800010u, 0x00000008u, - 0x21000020u, 0x00040008u, - 0x01020020u, 0x00000000u, - 0x60800044u, 0x000c000cu, - 0x60800000u, 0x000c0008u, + 0x00800064u, 0x01820043u, + 0x40800000u, 0x00000080u, + 0x40801000u, 0x00000080u, + 0x40800010u, 0x00000080u, + 0x01000020u, 0x00800089u, + 0x01020020u, 0x00000008u, + 0x00800044u, 0x018000c3u, + 0x00800000u, 0x01800083u, 0x00a10000u, 0x00000000u, - 0x60800000u, 0x000c0000u, - 0x60800004u, 0x000c0008u, - 0x60a10044u, 0x000c0004u, - 0x60800044u, 0x000c100cu, - 0x00a10000u, 0x00000028u, - 0x00800010u, 0x00000028u, - 0x00801000u, 0x00000028u, - 0x00b10000u, 0x00000020u, - 0x00804010u, 0x00000020u, - 0x00a00000u, 0x00000020u, - 0x00000000u, 0x00000020u, - 0x008003c4u, 0x00008000u, - 0x00a103c4u, 0x00008000u, - 0x00800d44u, 0x00000004u, - 0x00b10000u, 0x00000028u, - 0x00a00000u, 0x00000028u, - 0x00a90000u, 0x00000020u, - 0x00b90000u, 0x00000020u, - 0x00808024u, 0x00000020u, - 0x00800000u, 0x00002020u, - 0x00800000u, 0x00000200u, + 0x00800000u, 0x01800003u, + 0x00800004u, 0x01800083u, + 0x00a10044u, 0x01800043u, + 0x00800044u, 0x018200c3u, + 0x00a10000u, 0x00000480u, + 0xc0800000u, 0x00000480u, + 0x00800010u, 0x00000480u, + 0x00801000u, 0x00000480u, + 0x00b10000u, 0x00000400u, + 0x00804010u, 0x00000400u, + 0x00000000u, 0x00000400u, + 0x008003c4u, 0x00100000u, + 0x00a103c4u, 0x00100000u, + 0x00800d44u, 0x00000040u, + 0x00b10000u, 0x00000480u, + 0x00a90000u, 0x00000400u, + 0x00b90000u, 0x00000400u, + 0x03000020u, 0x00800009u, + 0x00808024u, 0x00000400u, + 0x00800000u, 0x00040400u, + 0x00800000u, 0x00004000u, 0x08800000u, 0x00000000u, 0x10800000u, 0x00000000u, - 0xe0800004u, 0x000c0000u, - 0x21008000u, 0x00040000u, - 0x00a11000u, 0x00000020u, - 0x60808020u, 0x00000000u, - 0xe0800004u, 0x000c4000u, - 0x60808004u, 0x000c0000u, - 0x60800004u, 0x00000000u, - 0x00000000u, 0x00000010u, - 0x21022020u, 0x00050000u, - 0x00800000u, 0x00000100u, - 0x00800020u, 0x00002800u, + 0x20800000u, 0x00000000u, + 0x00800004u, 0x01800007u, + 0x01008000u, 0x00800009u, + 0x00a11000u, 0x00000400u, + 0x00808020u, 0x00000003u, + 0x00800004u, 0x01880007u, + 0x00808004u, 0x01800003u, + 0x00800004u, 0x00000003u, + 0x00000000u, 0x00000200u, + 0x01022020u, 0x00a00009u, + 0x00800000u, 0x00002000u, + 0x00800020u, 0x00050000u, + 0x00800020u, 0x00040000u, + 0x00801000u, 0x00000080u, + 0x00800010u, 0x00000080u, 0x00800020u, 0x00002000u, - 0x00800020u, 0x00000100u, - 0x24800000u, 0x00040000u, - 0x648003c4u, 0x000c8000u, - 0x00808020u, 0x00000008u, - 0x64800d44u, 0x000c0004u, - 0x00800010u, 0x00000100u, - 0x61008024u, 0x00040000u, + 0x04800000u, 0x00800001u, + 0x048003c4u, 0x01900003u, + 0x00808020u, 0x00000080u, + 0x04800d44u, 0x01800043u, + 0x00800010u, 0x00002000u, + 0x01008024u, 0x0080000bu, 0x00000020u, 0x00000000u, - 0x60c00004u, 0x000c0000u, - 0x21400020u, 0x00040000u, - 0xa1000020u, 0x00040000u, - 0x21000000u, 0x00040000u, - 0x00a00000u, 0x00000000u, + 0x00c00004u, 0x01800003u, + 0x00c08004u, 0x01800003u, + 0x01400020u, 0x00800009u, + 0x01000020u, 0x0080000du, + 0x01008004u, 0x00800009u, + 0x00c00024u, 0x01800007u, + 0x01000000u, 0x00800009u, + 0xc0800000u, 0x00000080u, 0x00b10000u, 0x00000000u, 0x00200000u, 0x00000000u, - 0x00800044u, 0x00008000u, - 0x00a10044u, 0x00008000u, - 0x00930000u, 0x00000400u, + 0x00800044u, 0x00100000u, + 0x00a10044u, 0x00100000u, + 0x00930000u, 0x00008000u, 0x00b90000u, 0x00000000u, 0x00a90000u, 0x00000000u, - 0x00970020u, 0x00000000u, + 0x00970020u, 0x00000008u, 0x00b30000u, 0x00000000u, - 0x01022020u, 0x00000000u, + 0x01022020u, 0x00000008u, }; /* These are the main two-stage UCD tables. The fields in each record are: @@ -424,1430 +557,1570 @@ offset to multichar other cases or zero (8 bits), offset to other case or zero (32 bits, signed), bidi class (5 bits) and script extension (11 bits) packed into a 16-bit field, and offset in binary properties table (16 bits). */ -const ucd_record PRIV(ucd_records)[] = { /* 17076 bytes, record size 12 */ - { 69, 0, 2, 0, 0, 6144, 2, }, /* 0 */ - { 69, 0, 2, 0, 0, 43008, 4, }, /* 1 */ - { 69, 0, 1, 0, 0, 4096, 4, }, /* 2 */ - { 69, 0, 2, 0, 0, 45056, 4, }, /* 3 */ - { 69, 0, 0, 0, 0, 4096, 4, }, /* 4 */ - { 69, 0, 2, 0, 0, 4096, 2, }, /* 5 */ - { 69, 0, 2, 0, 0, 43008, 2, }, /* 6 */ - { 69, 29, 12, 0, 0, 45056, 6, }, /* 7 */ - { 69, 21, 12, 0, 0, 28672, 8, }, /* 8 */ - { 69, 21, 12, 0, 0, 28672, 10, }, /* 9 */ - { 69, 21, 12, 0, 0, 14336, 12, }, /* 10 */ - { 69, 23, 12, 0, 0, 14336, 14, }, /* 11 */ - { 69, 21, 12, 0, 0, 14336, 14, }, /* 12 */ - { 69, 21, 12, 0, 0, 28672, 14, }, /* 13 */ - { 69, 21, 12, 0, 0, 28672, 16, }, /* 14 */ - { 69, 22, 12, 0, 0, 28672, 18, }, /* 15 */ - { 69, 18, 12, 0, 0, 28672, 18, }, /* 16 */ - { 69, 21, 12, 0, 0, 28672, 12, }, /* 17 */ - { 69, 25, 12, 0, 0, 12288, 20, }, /* 18 */ - { 69, 21, 12, 0, 0, 8192, 22, }, /* 19 */ - { 69, 17, 12, 0, 0, 12288, 24, }, /* 20 */ - { 69, 21, 12, 0, 0, 8192, 26, }, /* 21 */ - { 69, 21, 12, 0, 0, 8192, 14, }, /* 22 */ - { 69, 13, 12, 0, 0, 10240, 28, }, /* 23 */ - { 69, 21, 12, 0, 0, 8192, 30, }, /* 24 */ - { 69, 21, 12, 0, 0, 28672, 22, }, /* 25 */ - { 69, 25, 12, 0, 0, 28672, 32, }, /* 26 */ - { 69, 25, 12, 0, 0, 28672, 20, }, /* 27 */ +const ucd_record PRIV(ucd_records)[] = { /* 18756 bytes, record size 12 */ + { 100, 0, 2, 0, 0, 6144, 2, }, /* 0 */ + { 100, 0, 2, 0, 0, 43008, 4, }, /* 1 */ + { 100, 0, 1, 0, 0, 4096, 4, }, /* 2 */ + { 100, 0, 2, 0, 0, 45056, 4, }, /* 3 */ + { 100, 0, 0, 0, 0, 4096, 4, }, /* 4 */ + { 100, 0, 2, 0, 0, 4096, 2, }, /* 5 */ + { 100, 0, 2, 0, 0, 43008, 2, }, /* 6 */ + { 100, 29, 12, 0, 0, 45056, 6, }, /* 7 */ + { 100, 21, 12, 0, 0, 28672, 8, }, /* 8 */ + { 100, 21, 12, 0, 0, 28672, 10, }, /* 9 */ + { 100, 21, 12, 0, 0, 14336, 12, }, /* 10 */ + { 100, 23, 12, 0, 0, 14336, 14, }, /* 11 */ + { 100, 21, 12, 0, 0, 14336, 14, }, /* 12 */ + { 100, 21, 12, 0, 0, 28672, 14, }, /* 13 */ + { 100, 21, 12, 0, 0, 28672, 16, }, /* 14 */ + { 100, 22, 12, 0, 0, 28672, 18, }, /* 15 */ + { 100, 18, 12, 0, 0, 28672, 18, }, /* 16 */ + { 100, 21, 12, 0, 0, 28672, 12, }, /* 17 */ + { 100, 25, 12, 0, 0, 12288, 20, }, /* 18 */ + { 100, 21, 12, 0, 0, 8192, 22, }, /* 19 */ + { 100, 17, 12, 0, 0, 12288, 24, }, /* 20 */ + { 100, 21, 12, 0, 0, 8192, 26, }, /* 21 */ + { 100, 21, 12, 0, 0, 8192, 14, }, /* 22 */ + { 100, 13, 12, 0, 0, 10240, 28, }, /* 23 */ + { 100, 21, 12, 0, 0, 8192, 30, }, /* 24 */ + { 100, 21, 12, 0, 0, 28672, 22, }, /* 25 */ + { 100, 25, 12, 0, 0, 28672, 32, }, /* 26 */ + { 100, 25, 12, 0, 0, 28672, 20, }, /* 27 */ { 0, 9, 12, 0, 32, 18432, 34, }, /* 28 */ { 0, 9, 12, 0, 32, 18432, 36, }, /* 29 */ { 0, 9, 12, 100, 32, 18432, 36, }, /* 30 */ { 0, 9, 12, 1, 32, 18432, 36, }, /* 31 */ - { 69, 24, 12, 0, 0, 28672, 38, }, /* 32 */ - { 69, 16, 12, 0, 0, 28672, 40, }, /* 33 */ - { 69, 24, 12, 0, 0, 28672, 42, }, /* 34 */ + { 100, 24, 12, 0, 0, 28672, 38, }, /* 32 */ + { 100, 16, 12, 0, 0, 28672, 40, }, /* 33 */ + { 100, 24, 12, 0, 0, 28672, 42, }, /* 34 */ { 0, 5, 12, 0, -32, 18432, 44, }, /* 35 */ { 0, 5, 12, 0, -32, 18432, 46, }, /* 36 */ { 0, 5, 12, 0, -32, 18432, 48, }, /* 37 */ { 0, 5, 12, 100, -32, 18432, 46, }, /* 38 */ { 0, 5, 12, 1, -32, 18432, 46, }, /* 39 */ - { 69, 0, 2, 0, 0, 6144, 0, }, /* 40 */ - { 69, 0, 2, 0, 0, 4096, 50, }, /* 41 */ - { 69, 29, 12, 0, 0, 8192, 52, }, /* 42 */ - { 69, 21, 12, 0, 0, 28672, 54, }, /* 43 */ - { 69, 23, 12, 0, 0, 14336, 54, }, /* 44 */ - { 69, 26, 12, 0, 0, 28672, 54, }, /* 45 */ - { 69, 24, 12, 0, 0, 28672, 56, }, /* 46 */ - { 69, 26, 14, 0, 0, 28672, 58, }, /* 47 */ + { 100, 0, 2, 0, 0, 6144, 0, }, /* 40 */ + { 100, 0, 2, 0, 0, 4096, 50, }, /* 41 */ + { 100, 29, 12, 0, 0, 8192, 52, }, /* 42 */ + { 100, 21, 12, 0, 0, 28672, 54, }, /* 43 */ + { 100, 23, 12, 0, 0, 14336, 54, }, /* 44 */ + { 100, 26, 12, 0, 0, 28672, 54, }, /* 45 */ + { 100, 24, 12, 0, 0, 28672, 56, }, /* 46 */ + { 100, 26, 14, 0, 0, 28672, 58, }, /* 47 */ { 0, 7, 12, 0, 0, 18432, 60, }, /* 48 */ - { 69, 20, 12, 0, 0, 28672, 62, }, /* 49 */ - { 69, 25, 12, 0, 0, 28672, 64, }, /* 50 */ - { 69, 1, 2, 0, 0, 6144, 66, }, /* 51 */ - { 69, 26, 12, 0, 0, 14336, 54, }, /* 52 */ - { 69, 25, 12, 0, 0, 14336, 64, }, /* 53 */ - { 69, 15, 12, 0, 0, 10240, 68, }, /* 54 */ - { 69, 5, 12, 26, 775, 18432, 70, }, /* 55 */ - { 69, 21, 12, 0, 0, 28672, 72, }, /* 56 */ - { 69, 19, 12, 0, 0, 28672, 62, }, /* 57 */ - { 69, 15, 12, 0, 0, 28672, 68, }, /* 58 */ - { 0, 9, 12, 0, 32, 18432, 74, }, /* 59 */ - { 0, 9, 12, 104, 32, 18432, 74, }, /* 60 */ + { 100, 20, 12, 0, 0, 28672, 62, }, /* 49 */ + { 100, 25, 12, 0, 0, 28672, 64, }, /* 50 */ + { 100, 1, 2, 0, 0, 6144, 66, }, /* 51 */ + { 100, 26, 12, 0, 0, 14336, 54, }, /* 52 */ + { 100, 25, 12, 0, 0, 14336, 64, }, /* 53 */ + { 100, 15, 12, 0, 0, 10240, 68, }, /* 54 */ + { 100, 5, 12, 26, 775, 18432, 70, }, /* 55 */ + { 100, 21, 12, 0, 0, 28676, 72, }, /* 56 */ + { 100, 19, 12, 0, 0, 28672, 62, }, /* 57 */ + { 100, 15, 12, 0, 0, 28672, 74, }, /* 58 */ + { 0, 9, 12, 0, 32, 18432, 76, }, /* 59 */ + { 0, 9, 12, 104, 32, 18432, 76, }, /* 60 */ { 0, 5, 12, 0, 7615, 18432, 70, }, /* 61 */ - { 0, 5, 12, 0, -32, 18432, 76, }, /* 62 */ - { 0, 5, 12, 104, -32, 18432, 76, }, /* 63 */ - { 0, 5, 12, 0, 121, 18432, 76, }, /* 64 */ - { 0, 9, 12, 0, 1, 18432, 74, }, /* 65 */ - { 0, 5, 12, 0, -1, 18432, 76, }, /* 66 */ - { 0, 5, 12, 0, -1, 18432, 78, }, /* 67 */ - { 0, 9, 12, 0, 0, 18432, 74, }, /* 68 */ - { 0, 5, 12, 0, 0, 18432, 76, }, /* 69 */ + { 0, 5, 12, 0, -32, 18432, 78, }, /* 62 */ + { 0, 5, 12, 104, -32, 18432, 78, }, /* 63 */ + { 0, 5, 12, 0, 121, 18432, 78, }, /* 64 */ + { 0, 9, 12, 0, 1, 18432, 76, }, /* 65 */ + { 0, 5, 12, 0, -1, 18432, 78, }, /* 66 */ + { 0, 5, 12, 0, -1, 18432, 80, }, /* 67 */ + { 0, 9, 12, 0, 0, 18432, 76, }, /* 68 */ + { 0, 5, 12, 0, 0, 18432, 78, }, /* 69 */ { 0, 5, 12, 0, 0, 18432, 60, }, /* 70 */ - { 0, 5, 12, 0, 0, 18432, 80, }, /* 71 */ - { 0, 9, 12, 0, -121, 18432, 74, }, /* 72 */ + { 0, 5, 12, 0, 0, 18432, 82, }, /* 71 */ + { 0, 9, 12, 0, -121, 18432, 76, }, /* 72 */ { 0, 5, 12, 1, 0, 18432, 70, }, /* 73 */ - { 0, 5, 12, 0, 195, 18432, 76, }, /* 74 */ - { 0, 9, 12, 0, 210, 18432, 74, }, /* 75 */ - { 0, 9, 12, 0, 206, 18432, 74, }, /* 76 */ - { 0, 9, 12, 0, 205, 18432, 74, }, /* 77 */ - { 0, 9, 12, 0, 79, 18432, 74, }, /* 78 */ - { 0, 9, 12, 0, 202, 18432, 74, }, /* 79 */ - { 0, 9, 12, 0, 203, 18432, 74, }, /* 80 */ - { 0, 9, 12, 0, 207, 18432, 74, }, /* 81 */ - { 0, 5, 12, 0, 97, 18432, 76, }, /* 82 */ - { 0, 9, 12, 0, 211, 18432, 74, }, /* 83 */ - { 0, 9, 12, 0, 209, 18432, 74, }, /* 84 */ - { 0, 5, 12, 0, 163, 18432, 76, }, /* 85 */ - { 0, 9, 12, 0, 213, 18432, 74, }, /* 86 */ - { 0, 5, 12, 0, 130, 18432, 76, }, /* 87 */ - { 0, 9, 12, 0, 214, 18432, 74, }, /* 88 */ - { 0, 9, 12, 0, 218, 18432, 74, }, /* 89 */ - { 0, 9, 12, 0, 217, 18432, 74, }, /* 90 */ - { 0, 9, 12, 0, 219, 18432, 74, }, /* 91 */ - { 0, 7, 12, 0, 0, 18432, 82, }, /* 92 */ - { 0, 5, 12, 0, 56, 18432, 76, }, /* 93 */ - { 0, 9, 12, 5, 2, 18432, 84, }, /* 94 */ - { 0, 8, 12, 5, 1, 18432, 86, }, /* 95 */ - { 0, 5, 12, 5, -2, 18432, 76, }, /* 96 */ - { 0, 9, 12, 9, 2, 18432, 84, }, /* 97 */ - { 0, 8, 12, 9, 1, 18432, 86, }, /* 98 */ - { 0, 5, 12, 9, -2, 18432, 76, }, /* 99 */ - { 0, 9, 12, 13, 2, 18432, 84, }, /* 100 */ - { 0, 8, 12, 13, 1, 18432, 86, }, /* 101 */ - { 0, 5, 12, 13, -2, 18432, 76, }, /* 102 */ - { 0, 5, 12, 0, -79, 18432, 76, }, /* 103 */ - { 0, 9, 12, 17, 2, 18432, 84, }, /* 104 */ - { 0, 8, 12, 17, 1, 18432, 86, }, /* 105 */ - { 0, 5, 12, 17, -2, 18432, 76, }, /* 106 */ - { 0, 9, 12, 0, -97, 18432, 74, }, /* 107 */ - { 0, 9, 12, 0, -56, 18432, 74, }, /* 108 */ - { 0, 9, 12, 0, -130, 18432, 74, }, /* 109 */ - { 0, 9, 12, 0, 10795, 18432, 74, }, /* 110 */ - { 0, 9, 12, 0, -163, 18432, 74, }, /* 111 */ - { 0, 9, 12, 0, 10792, 18432, 74, }, /* 112 */ - { 0, 5, 12, 0, 10815, 18432, 76, }, /* 113 */ - { 0, 9, 12, 0, -195, 18432, 74, }, /* 114 */ - { 0, 9, 12, 0, 69, 18432, 74, }, /* 115 */ - { 0, 9, 12, 0, 71, 18432, 74, }, /* 116 */ - { 0, 5, 12, 0, 10783, 18432, 76, }, /* 117 */ - { 0, 5, 12, 0, 10780, 18432, 76, }, /* 118 */ - { 0, 5, 12, 0, 10782, 18432, 76, }, /* 119 */ - { 0, 5, 12, 0, -210, 18432, 76, }, /* 120 */ - { 0, 5, 12, 0, -206, 18432, 76, }, /* 121 */ - { 0, 5, 12, 0, -205, 18432, 76, }, /* 122 */ - { 0, 5, 12, 0, -202, 18432, 76, }, /* 123 */ - { 0, 5, 12, 0, -203, 18432, 76, }, /* 124 */ - { 0, 5, 12, 0, 42319, 18432, 76, }, /* 125 */ - { 0, 5, 12, 0, 42315, 18432, 76, }, /* 126 */ - { 0, 5, 12, 0, -207, 18432, 76, }, /* 127 */ - { 0, 5, 12, 0, 42280, 18432, 76, }, /* 128 */ - { 0, 5, 12, 0, 42308, 18432, 76, }, /* 129 */ - { 0, 5, 12, 0, -209, 18432, 78, }, /* 130 */ - { 0, 5, 12, 0, -211, 18432, 76, }, /* 131 */ - { 0, 5, 12, 0, 10743, 18432, 76, }, /* 132 */ - { 0, 5, 12, 0, 42305, 18432, 76, }, /* 133 */ - { 0, 5, 12, 0, 10749, 18432, 76, }, /* 134 */ - { 0, 5, 12, 0, -213, 18432, 76, }, /* 135 */ - { 0, 5, 12, 0, -214, 18432, 76, }, /* 136 */ - { 0, 5, 12, 0, 10727, 18432, 76, }, /* 137 */ - { 0, 5, 12, 0, -218, 18432, 76, }, /* 138 */ - { 0, 5, 12, 0, 42307, 18432, 76, }, /* 139 */ - { 0, 5, 12, 0, 42282, 18432, 76, }, /* 140 */ - { 0, 5, 12, 0, -69, 18432, 76, }, /* 141 */ - { 0, 5, 12, 0, -217, 18432, 76, }, /* 142 */ - { 0, 5, 12, 0, -71, 18432, 76, }, /* 143 */ - { 0, 5, 12, 0, -219, 18432, 76, }, /* 144 */ - { 0, 5, 12, 0, 42261, 18432, 78, }, /* 145 */ - { 0, 5, 12, 0, 42258, 18432, 76, }, /* 146 */ - { 0, 6, 12, 0, 0, 18432, 88, }, /* 147 */ - { 0, 6, 12, 0, 0, 18432, 90, }, /* 148 */ - { 69, 6, 12, 0, 0, 28672, 92, }, /* 149 */ - { 69, 6, 12, 0, 0, 18432, 92, }, /* 150 */ - { 69, 6, 12, 0, 0, 18432, 88, }, /* 151 */ - { 69, 6, 12, 0, 0, 18432, 94, }, /* 152 */ - { 22, 24, 12, 0, 0, 28672, 56, }, /* 153 */ - { 84, 12, 3, 0, 0, 26624, 96, }, /* 154 */ - { 84, 12, 3, 0, 0, 26636, 96, }, /* 155 */ - { 84, 12, 3, 21, 116, 26636, 98, }, /* 156 */ - { 84, 12, 3, 0, 0, 26624, 100, }, /* 157 */ - { 84, 12, 3, 0, 0, 26624, 102, }, /* 158 */ - { 84, 12, 3, 0, 0, 26642, 102, }, /* 159 */ - { 1, 9, 12, 0, 1, 18432, 74, }, /* 160 */ - { 1, 5, 12, 0, -1, 18432, 76, }, /* 161 */ - { 1, 24, 12, 0, 0, 28672, 56, }, /* 162 */ - { 68, 2, 12, 0, 0, 18432, 0, }, /* 163 */ - { 1, 6, 12, 0, 0, 18432, 104, }, /* 164 */ - { 1, 5, 12, 0, 130, 18432, 76, }, /* 165 */ - { 69, 21, 12, 0, 0, 28672, 106, }, /* 166 */ - { 1, 9, 12, 0, 116, 18432, 74, }, /* 167 */ - { 1, 9, 12, 0, 38, 18432, 74, }, /* 168 */ - { 69, 21, 12, 0, 0, 28672, 108, }, /* 169 */ - { 1, 9, 12, 0, 37, 18432, 74, }, /* 170 */ - { 1, 9, 12, 0, 64, 18432, 74, }, /* 171 */ - { 1, 9, 12, 0, 63, 18432, 74, }, /* 172 */ - { 1, 5, 12, 0, 0, 18432, 76, }, /* 173 */ - { 1, 9, 12, 0, 32, 18432, 74, }, /* 174 */ - { 1, 9, 12, 34, 32, 18432, 74, }, /* 175 */ - { 1, 9, 12, 59, 32, 18432, 74, }, /* 176 */ - { 1, 9, 12, 38, 32, 18432, 74, }, /* 177 */ - { 1, 9, 12, 21, 32, 18432, 74, }, /* 178 */ - { 1, 9, 12, 51, 32, 18432, 74, }, /* 179 */ - { 1, 9, 12, 26, 32, 18432, 74, }, /* 180 */ - { 1, 9, 12, 47, 32, 18432, 74, }, /* 181 */ - { 1, 9, 12, 55, 32, 18432, 74, }, /* 182 */ - { 1, 9, 12, 30, 32, 18432, 74, }, /* 183 */ - { 1, 9, 12, 43, 32, 18432, 74, }, /* 184 */ - { 1, 9, 12, 96, 32, 18432, 74, }, /* 185 */ - { 1, 5, 12, 0, -38, 18432, 76, }, /* 186 */ - { 1, 5, 12, 0, -37, 18432, 76, }, /* 187 */ - { 1, 5, 12, 0, -32, 18432, 76, }, /* 188 */ - { 1, 5, 12, 34, -32, 18432, 76, }, /* 189 */ - { 1, 5, 12, 59, -32, 18432, 76, }, /* 190 */ - { 1, 5, 12, 38, -32, 18432, 76, }, /* 191 */ - { 1, 5, 12, 21, -116, 18432, 76, }, /* 192 */ - { 1, 5, 12, 51, -32, 18432, 76, }, /* 193 */ - { 1, 5, 12, 26, -775, 18432, 76, }, /* 194 */ - { 1, 5, 12, 47, -32, 18432, 76, }, /* 195 */ - { 1, 5, 12, 55, -32, 18432, 76, }, /* 196 */ - { 1, 5, 12, 30, 1, 18432, 70, }, /* 197 */ - { 1, 5, 12, 30, -32, 18432, 76, }, /* 198 */ - { 1, 5, 12, 43, -32, 18432, 76, }, /* 199 */ - { 1, 5, 12, 96, -32, 18432, 76, }, /* 200 */ - { 1, 5, 12, 0, -64, 18432, 76, }, /* 201 */ - { 1, 5, 12, 0, -63, 18432, 76, }, /* 202 */ - { 1, 9, 12, 0, 8, 18432, 74, }, /* 203 */ - { 1, 5, 12, 34, -30, 18432, 110, }, /* 204 */ - { 1, 5, 12, 38, -25, 18432, 110, }, /* 205 */ - { 1, 9, 12, 0, 0, 18432, 112, }, /* 206 */ - { 1, 9, 12, 0, 0, 18432, 114, }, /* 207 */ - { 1, 5, 12, 43, -15, 18432, 110, }, /* 208 */ - { 1, 5, 12, 47, -22, 18432, 70, }, /* 209 */ - { 1, 5, 12, 0, -8, 18432, 76, }, /* 210 */ - { 34, 9, 12, 0, 1, 18432, 74, }, /* 211 */ - { 34, 5, 12, 0, -1, 18432, 76, }, /* 212 */ - { 1, 5, 12, 51, -54, 18432, 110, }, /* 213 */ - { 1, 5, 12, 55, -48, 18432, 110, }, /* 214 */ - { 1, 5, 12, 0, 7, 18432, 76, }, /* 215 */ - { 1, 5, 12, 0, -116, 18432, 78, }, /* 216 */ - { 1, 9, 12, 38, -60, 18432, 116, }, /* 217 */ - { 1, 5, 12, 59, -64, 18432, 110, }, /* 218 */ - { 1, 25, 12, 0, 0, 28672, 118, }, /* 219 */ - { 1, 9, 12, 0, -7, 18432, 74, }, /* 220 */ - { 1, 5, 12, 0, 0, 18432, 60, }, /* 221 */ - { 1, 9, 12, 0, -130, 18432, 74, }, /* 222 */ - { 2, 9, 12, 0, 80, 18432, 74, }, /* 223 */ - { 2, 9, 12, 0, 32, 18432, 74, }, /* 224 */ - { 2, 9, 12, 63, 32, 18432, 74, }, /* 225 */ - { 2, 9, 12, 67, 32, 18432, 74, }, /* 226 */ - { 2, 9, 12, 71, 32, 18432, 74, }, /* 227 */ - { 2, 9, 12, 75, 32, 18432, 74, }, /* 228 */ - { 2, 9, 12, 79, 32, 18432, 74, }, /* 229 */ - { 2, 9, 12, 84, 32, 18432, 74, }, /* 230 */ - { 2, 5, 12, 0, -32, 18432, 76, }, /* 231 */ - { 2, 5, 12, 63, -32, 18432, 76, }, /* 232 */ - { 2, 5, 12, 67, -32, 18432, 76, }, /* 233 */ - { 2, 5, 12, 71, -32, 18432, 76, }, /* 234 */ - { 2, 5, 12, 75, -32, 18432, 76, }, /* 235 */ - { 2, 5, 12, 79, -32, 18432, 76, }, /* 236 */ - { 2, 5, 12, 84, -32, 18432, 76, }, /* 237 */ - { 2, 5, 12, 0, -80, 18432, 76, }, /* 238 */ - { 2, 5, 12, 0, -80, 18432, 78, }, /* 239 */ - { 2, 9, 12, 0, 1, 18432, 74, }, /* 240 */ - { 2, 5, 12, 0, -1, 18432, 76, }, /* 241 */ - { 2, 9, 12, 88, 1, 18432, 74, }, /* 242 */ - { 2, 5, 12, 88, -1, 18432, 76, }, /* 243 */ - { 2, 26, 12, 0, 0, 18432, 68, }, /* 244 */ - { 2, 12, 3, 0, 0, 26684, 96, }, /* 245 */ - { 2, 12, 3, 0, 0, 26678, 96, }, /* 246 */ - { 84, 12, 3, 0, 0, 26681, 96, }, /* 247 */ - { 2, 11, 3, 0, 0, 26624, 120, }, /* 248 */ - { 2, 9, 12, 0, 15, 18432, 74, }, /* 249 */ - { 2, 5, 12, 0, -15, 18432, 76, }, /* 250 */ - { 70, 9, 12, 0, 48, 18432, 74, }, /* 251 */ - { 70, 6, 12, 0, 0, 18432, 92, }, /* 252 */ - { 70, 21, 12, 0, 0, 18432, 68, }, /* 253 */ - { 70, 21, 12, 0, 0, 18432, 122, }, /* 254 */ - { 70, 5, 12, 0, 0, 18432, 60, }, /* 255 */ - { 70, 5, 12, 0, -48, 18432, 76, }, /* 256 */ - { 70, 5, 12, 0, 0, 18432, 70, }, /* 257 */ - { 70, 21, 12, 0, 0, 18432, 124, }, /* 258 */ - { 70, 17, 12, 0, 0, 28672, 126, }, /* 259 */ - { 70, 26, 12, 0, 0, 28672, 68, }, /* 260 */ - { 70, 23, 12, 0, 0, 14336, 68, }, /* 261 */ - { 68, 2, 12, 0, 0, 34816, 0, }, /* 262 */ - { 71, 12, 3, 0, 0, 26624, 96, }, /* 263 */ - { 71, 12, 3, 0, 0, 26624, 102, }, /* 264 */ - { 71, 12, 3, 0, 0, 26624, 128, }, /* 265 */ - { 71, 17, 12, 0, 0, 34816, 126, }, /* 266 */ - { 71, 21, 12, 0, 0, 34816, 68, }, /* 267 */ - { 71, 21, 12, 0, 0, 34816, 106, }, /* 268 */ - { 71, 12, 3, 0, 0, 26624, 130, }, /* 269 */ - { 71, 7, 12, 0, 0, 34816, 82, }, /* 270 */ - { 71, 21, 12, 0, 0, 34816, 122, }, /* 271 */ - { 3, 1, 4, 0, 0, 2048, 132, }, /* 272 */ - { 69, 1, 4, 0, 0, 2048, 132, }, /* 273 */ - { 3, 25, 12, 0, 0, 28672, 118, }, /* 274 */ - { 3, 25, 12, 0, 0, 0, 118, }, /* 275 */ - { 3, 21, 12, 0, 0, 14336, 68, }, /* 276 */ - { 3, 23, 12, 0, 0, 0, 68, }, /* 277 */ - { 69, 21, 12, 0, 0, 8342, 106, }, /* 278 */ - { 3, 21, 12, 0, 0, 0, 68, }, /* 279 */ - { 3, 26, 12, 0, 0, 28672, 68, }, /* 280 */ - { 3, 12, 3, 0, 0, 26624, 130, }, /* 281 */ - { 69, 21, 12, 0, 0, 150, 106, }, /* 282 */ - { 3, 1, 2, 0, 0, 108, 134, }, /* 283 */ - { 3, 21, 12, 0, 0, 0, 124, }, /* 284 */ - { 69, 21, 12, 0, 0, 159, 124, }, /* 285 */ - { 3, 7, 12, 0, 0, 0, 82, }, /* 286 */ - { 69, 6, 12, 0, 0, 165, 136, }, /* 287 */ - { 84, 12, 3, 0, 0, 26660, 128, }, /* 288 */ - { 84, 12, 3, 0, 0, 26660, 130, }, /* 289 */ - { 3, 12, 3, 0, 0, 26624, 128, }, /* 290 */ - { 3, 12, 3, 0, 0, 26624, 96, }, /* 291 */ - { 3, 13, 12, 0, 0, 2159, 138, }, /* 292 */ - { 3, 21, 12, 0, 0, 2048, 68, }, /* 293 */ - { 3, 7, 12, 0, 0, 0, 140, }, /* 294 */ - { 3, 21, 12, 0, 0, 30, 124, }, /* 295 */ - { 3, 6, 12, 0, 0, 0, 92, }, /* 296 */ - { 3, 13, 12, 0, 0, 10240, 138, }, /* 297 */ - { 3, 26, 12, 0, 0, 0, 68, }, /* 298 */ - { 4, 21, 12, 0, 0, 0, 124, }, /* 299 */ - { 4, 21, 12, 0, 0, 0, 106, }, /* 300 */ - { 4, 21, 12, 0, 0, 0, 68, }, /* 301 */ - { 68, 2, 12, 0, 0, 0, 0, }, /* 302 */ - { 4, 1, 4, 0, 0, 0, 132, }, /* 303 */ - { 4, 7, 12, 0, 0, 0, 82, }, /* 304 */ - { 4, 12, 3, 0, 0, 26624, 130, }, /* 305 */ - { 4, 12, 3, 0, 0, 26624, 128, }, /* 306 */ - { 4, 12, 3, 0, 0, 26624, 96, }, /* 307 */ - { 5, 7, 12, 0, 0, 0, 82, }, /* 308 */ - { 5, 12, 3, 0, 0, 26624, 128, }, /* 309 */ - { 38, 13, 12, 0, 0, 34816, 138, }, /* 310 */ - { 38, 7, 12, 0, 0, 34816, 82, }, /* 311 */ - { 38, 12, 3, 0, 0, 26624, 96, }, /* 312 */ - { 38, 6, 12, 0, 0, 34816, 92, }, /* 313 */ - { 38, 26, 12, 0, 0, 28672, 68, }, /* 314 */ - { 38, 21, 12, 0, 0, 28672, 68, }, /* 315 */ - { 38, 21, 12, 0, 0, 28672, 106, }, /* 316 */ - { 38, 21, 12, 0, 0, 28672, 124, }, /* 317 */ - { 38, 6, 12, 0, 0, 34816, 136, }, /* 318 */ - { 38, 12, 3, 0, 0, 26624, 102, }, /* 319 */ - { 38, 23, 12, 0, 0, 34816, 68, }, /* 320 */ - { 110, 7, 12, 0, 0, 34816, 82, }, /* 321 */ - { 110, 12, 3, 0, 0, 26624, 130, }, /* 322 */ - { 110, 12, 3, 0, 0, 26624, 96, }, /* 323 */ - { 110, 6, 12, 0, 0, 34816, 142, }, /* 324 */ - { 110, 12, 3, 0, 0, 26624, 102, }, /* 325 */ - { 110, 21, 12, 0, 0, 34816, 106, }, /* 326 */ - { 110, 21, 12, 0, 0, 34816, 124, }, /* 327 */ - { 42, 7, 12, 0, 0, 34816, 82, }, /* 328 */ - { 42, 12, 3, 0, 0, 26624, 102, }, /* 329 */ - { 42, 21, 12, 0, 0, 34816, 106, }, /* 330 */ - { 3, 24, 12, 0, 0, 0, 122, }, /* 331 */ - { 3, 12, 3, 0, 0, 26624, 102, }, /* 332 */ - { 6, 12, 3, 0, 0, 26624, 130, }, /* 333 */ - { 6, 10, 5, 0, 0, 18432, 144, }, /* 334 */ - { 6, 7, 12, 0, 0, 18432, 82, }, /* 335 */ - { 6, 12, 3, 0, 0, 26624, 96, }, /* 336 */ - { 6, 12, 3, 0, 0, 26624, 146, }, /* 337 */ - { 84, 12, 3, 0, 0, 26798, 96, }, /* 338 */ - { 84, 12, 3, 0, 0, 26795, 96, }, /* 339 */ - { 69, 21, 12, 0, 0, 18615, 124, }, /* 340 */ - { 69, 21, 12, 0, 0, 18618, 124, }, /* 341 */ - { 6, 13, 12, 0, 0, 18576, 138, }, /* 342 */ - { 6, 21, 12, 0, 0, 18432, 68, }, /* 343 */ - { 6, 6, 12, 0, 0, 18432, 92, }, /* 344 */ - { 7, 7, 12, 0, 0, 18432, 82, }, /* 345 */ - { 7, 12, 3, 0, 0, 26624, 130, }, /* 346 */ - { 7, 10, 5, 0, 0, 18432, 144, }, /* 347 */ - { 7, 12, 3, 0, 0, 26624, 96, }, /* 348 */ - { 7, 10, 3, 0, 0, 18432, 148, }, /* 349 */ - { 7, 12, 3, 0, 0, 26624, 146, }, /* 350 */ - { 7, 13, 12, 0, 0, 18546, 138, }, /* 351 */ - { 7, 23, 12, 0, 0, 14336, 68, }, /* 352 */ - { 7, 15, 12, 0, 0, 18432, 68, }, /* 353 */ - { 7, 26, 12, 0, 0, 18432, 68, }, /* 354 */ - { 7, 21, 12, 0, 0, 18432, 68, }, /* 355 */ - { 7, 12, 3, 0, 0, 26624, 102, }, /* 356 */ - { 8, 12, 3, 0, 0, 26624, 130, }, /* 357 */ - { 8, 10, 5, 0, 0, 18432, 144, }, /* 358 */ - { 8, 7, 12, 0, 0, 18432, 82, }, /* 359 */ - { 8, 12, 3, 0, 0, 26624, 96, }, /* 360 */ - { 8, 12, 3, 0, 0, 26624, 146, }, /* 361 */ - { 8, 13, 12, 0, 0, 18519, 138, }, /* 362 */ - { 8, 21, 12, 0, 0, 18432, 68, }, /* 363 */ - { 9, 12, 3, 0, 0, 26624, 130, }, /* 364 */ - { 9, 10, 5, 0, 0, 18432, 144, }, /* 365 */ - { 9, 7, 12, 0, 0, 18432, 82, }, /* 366 */ - { 9, 12, 3, 0, 0, 26624, 96, }, /* 367 */ - { 9, 12, 3, 0, 0, 26624, 146, }, /* 368 */ - { 9, 13, 12, 0, 0, 18516, 138, }, /* 369 */ - { 9, 21, 12, 0, 0, 18432, 68, }, /* 370 */ - { 9, 23, 12, 0, 0, 14336, 68, }, /* 371 */ - { 10, 12, 3, 0, 0, 26624, 130, }, /* 372 */ - { 10, 10, 5, 0, 0, 18432, 144, }, /* 373 */ - { 10, 7, 12, 0, 0, 18432, 82, }, /* 374 */ - { 10, 12, 3, 0, 0, 26624, 96, }, /* 375 */ - { 10, 10, 3, 0, 0, 18432, 148, }, /* 376 */ - { 10, 12, 3, 0, 0, 26624, 146, }, /* 377 */ - { 10, 12, 3, 0, 0, 26624, 150, }, /* 378 */ - { 10, 13, 12, 0, 0, 18432, 138, }, /* 379 */ - { 10, 26, 12, 0, 0, 18432, 68, }, /* 380 */ - { 10, 15, 12, 0, 0, 18432, 68, }, /* 381 */ - { 11, 12, 3, 0, 0, 26624, 130, }, /* 382 */ - { 11, 7, 12, 0, 0, 18432, 82, }, /* 383 */ - { 11, 10, 3, 0, 0, 18432, 148, }, /* 384 */ - { 11, 10, 5, 0, 0, 18432, 144, }, /* 385 */ - { 11, 12, 3, 0, 0, 26624, 146, }, /* 386 */ - { 11, 13, 12, 0, 0, 18513, 138, }, /* 387 */ - { 11, 15, 12, 0, 0, 18513, 68, }, /* 388 */ - { 11, 26, 12, 0, 0, 28753, 68, }, /* 389 */ - { 11, 26, 12, 0, 0, 28672, 68, }, /* 390 */ - { 11, 23, 12, 0, 0, 14336, 68, }, /* 391 */ - { 12, 12, 3, 0, 0, 26624, 130, }, /* 392 */ - { 12, 10, 5, 0, 0, 18432, 144, }, /* 393 */ - { 12, 7, 12, 0, 0, 18432, 82, }, /* 394 */ - { 12, 12, 3, 0, 0, 26624, 96, }, /* 395 */ - { 12, 12, 3, 0, 0, 26624, 146, }, /* 396 */ - { 12, 13, 12, 0, 0, 18432, 138, }, /* 397 */ - { 12, 21, 12, 0, 0, 18432, 68, }, /* 398 */ - { 12, 15, 12, 0, 0, 28672, 68, }, /* 399 */ - { 12, 26, 12, 0, 0, 18432, 68, }, /* 400 */ - { 13, 7, 12, 0, 0, 18432, 82, }, /* 401 */ - { 13, 12, 3, 0, 0, 26624, 130, }, /* 402 */ - { 13, 10, 5, 0, 0, 18432, 144, }, /* 403 */ - { 13, 21, 12, 0, 0, 18432, 68, }, /* 404 */ - { 13, 12, 3, 0, 0, 26624, 96, }, /* 405 */ - { 13, 12, 3, 0, 0, 18432, 130, }, /* 406 */ - { 13, 10, 3, 0, 0, 18432, 148, }, /* 407 */ - { 13, 12, 3, 0, 0, 26624, 146, }, /* 408 */ - { 13, 13, 12, 0, 0, 18528, 138, }, /* 409 */ - { 14, 12, 3, 0, 0, 26624, 130, }, /* 410 */ - { 14, 10, 5, 0, 0, 18432, 144, }, /* 411 */ - { 14, 7, 12, 0, 0, 18432, 82, }, /* 412 */ - { 14, 12, 3, 0, 0, 26624, 146, }, /* 413 */ - { 14, 10, 3, 0, 0, 18432, 148, }, /* 414 */ - { 14, 7, 4, 0, 0, 18432, 82, }, /* 415 */ - { 14, 26, 12, 0, 0, 18432, 68, }, /* 416 */ - { 14, 15, 12, 0, 0, 18432, 68, }, /* 417 */ - { 14, 13, 12, 0, 0, 18432, 138, }, /* 418 */ - { 15, 12, 3, 0, 0, 26624, 130, }, /* 419 */ - { 15, 10, 5, 0, 0, 18432, 144, }, /* 420 */ - { 15, 7, 12, 0, 0, 18432, 82, }, /* 421 */ - { 15, 12, 3, 0, 0, 26624, 146, }, /* 422 */ - { 15, 10, 3, 0, 0, 18432, 148, }, /* 423 */ - { 15, 13, 12, 0, 0, 18432, 138, }, /* 424 */ - { 15, 21, 12, 0, 0, 18432, 68, }, /* 425 */ - { 72, 7, 12, 0, 0, 18432, 82, }, /* 426 */ - { 72, 12, 3, 0, 0, 26624, 130, }, /* 427 */ - { 72, 7, 5, 0, 0, 18432, 152, }, /* 428 */ - { 72, 12, 3, 0, 0, 26624, 154, }, /* 429 */ - { 69, 23, 12, 0, 0, 14336, 68, }, /* 430 */ - { 72, 7, 12, 0, 0, 18432, 156, }, /* 431 */ - { 72, 6, 12, 0, 0, 18432, 136, }, /* 432 */ - { 72, 12, 3, 0, 0, 26624, 96, }, /* 433 */ - { 72, 21, 12, 0, 0, 18432, 68, }, /* 434 */ - { 72, 13, 12, 0, 0, 18432, 138, }, /* 435 */ - { 72, 21, 12, 0, 0, 18432, 106, }, /* 436 */ - { 73, 7, 12, 0, 0, 18432, 82, }, /* 437 */ - { 73, 12, 3, 0, 0, 26624, 130, }, /* 438 */ - { 73, 7, 5, 0, 0, 18432, 152, }, /* 439 */ - { 73, 12, 3, 0, 0, 26624, 146, }, /* 440 */ - { 73, 7, 12, 0, 0, 18432, 156, }, /* 441 */ - { 73, 6, 12, 0, 0, 18432, 136, }, /* 442 */ - { 73, 12, 3, 0, 0, 26624, 96, }, /* 443 */ - { 73, 12, 3, 0, 0, 26624, 102, }, /* 444 */ - { 73, 13, 12, 0, 0, 18432, 138, }, /* 445 */ - { 74, 7, 12, 0, 0, 18432, 82, }, /* 446 */ - { 74, 26, 12, 0, 0, 18432, 68, }, /* 447 */ - { 74, 21, 12, 0, 0, 18432, 68, }, /* 448 */ - { 74, 21, 12, 0, 0, 18432, 106, }, /* 449 */ - { 74, 12, 3, 0, 0, 26624, 96, }, /* 450 */ - { 74, 13, 12, 0, 0, 18432, 138, }, /* 451 */ - { 74, 15, 12, 0, 0, 18432, 68, }, /* 452 */ - { 74, 22, 12, 0, 0, 28672, 158, }, /* 453 */ - { 74, 18, 12, 0, 0, 28672, 158, }, /* 454 */ - { 74, 10, 5, 0, 0, 18432, 160, }, /* 455 */ - { 74, 12, 3, 0, 0, 26624, 130, }, /* 456 */ - { 74, 12, 3, 0, 0, 26624, 162, }, /* 457 */ - { 74, 10, 5, 0, 0, 18432, 144, }, /* 458 */ - { 74, 12, 3, 0, 0, 26624, 128, }, /* 459 */ - { 74, 12, 3, 0, 0, 26624, 146, }, /* 460 */ - { 69, 26, 12, 0, 0, 18432, 68, }, /* 461 */ - { 16, 7, 12, 0, 0, 18432, 82, }, /* 462 */ - { 16, 10, 12, 0, 0, 18432, 144, }, /* 463 */ - { 16, 12, 3, 0, 0, 26624, 130, }, /* 464 */ - { 16, 10, 5, 0, 0, 18432, 144, }, /* 465 */ - { 16, 12, 3, 0, 0, 26624, 96, }, /* 466 */ - { 16, 12, 3, 0, 0, 26624, 146, }, /* 467 */ - { 16, 13, 12, 0, 0, 18549, 138, }, /* 468 */ - { 16, 21, 12, 0, 0, 18432, 124, }, /* 469 */ - { 16, 21, 12, 0, 0, 18432, 68, }, /* 470 */ - { 16, 10, 12, 0, 0, 18432, 164, }, /* 471 */ - { 16, 12, 3, 0, 0, 26624, 128, }, /* 472 */ - { 16, 13, 12, 0, 0, 18432, 138, }, /* 473 */ - { 16, 26, 12, 0, 0, 18432, 68, }, /* 474 */ - { 17, 9, 12, 0, 7264, 18432, 74, }, /* 475 */ - { 17, 5, 12, 0, 3008, 18432, 166, }, /* 476 */ - { 69, 21, 12, 0, 0, 18510, 68, }, /* 477 */ - { 17, 6, 12, 0, 0, 18432, 168, }, /* 478 */ - { 18, 7, 6, 0, 0, 18432, 82, }, /* 479 */ - { 18, 7, 6, 0, 0, 18432, 170, }, /* 480 */ - { 18, 7, 7, 0, 0, 18432, 170, }, /* 481 */ - { 18, 7, 7, 0, 0, 18432, 82, }, /* 482 */ - { 18, 7, 8, 0, 0, 18432, 82, }, /* 483 */ - { 75, 7, 12, 0, 0, 18432, 82, }, /* 484 */ - { 75, 12, 3, 0, 0, 26624, 96, }, /* 485 */ - { 75, 21, 12, 0, 0, 18432, 68, }, /* 486 */ - { 75, 21, 12, 0, 0, 18432, 106, }, /* 487 */ - { 75, 21, 12, 0, 0, 18432, 124, }, /* 488 */ - { 75, 15, 12, 0, 0, 18432, 138, }, /* 489 */ - { 75, 15, 12, 0, 0, 18432, 68, }, /* 490 */ - { 75, 26, 12, 0, 0, 28672, 68, }, /* 491 */ - { 76, 9, 12, 0, 38864, 18432, 172, }, /* 492 */ - { 76, 9, 12, 0, 8, 18432, 172, }, /* 493 */ - { 76, 5, 12, 0, -8, 18432, 70, }, /* 494 */ - { 77, 17, 12, 0, 0, 28672, 126, }, /* 495 */ - { 77, 7, 12, 0, 0, 18432, 82, }, /* 496 */ - { 77, 26, 12, 0, 0, 18432, 68, }, /* 497 */ - { 77, 21, 12, 0, 0, 18432, 124, }, /* 498 */ - { 78, 29, 12, 0, 0, 45056, 52, }, /* 499 */ - { 78, 7, 12, 0, 0, 18432, 82, }, /* 500 */ - { 78, 22, 12, 0, 0, 28672, 158, }, /* 501 */ - { 78, 18, 12, 0, 0, 28672, 158, }, /* 502 */ - { 79, 7, 12, 0, 0, 18432, 82, }, /* 503 */ - { 69, 21, 12, 0, 0, 18432, 106, }, /* 504 */ - { 79, 14, 12, 0, 0, 18432, 82, }, /* 505 */ - { 25, 7, 12, 0, 0, 18432, 82, }, /* 506 */ - { 25, 12, 3, 0, 0, 26624, 130, }, /* 507 */ - { 25, 12, 3, 0, 0, 26624, 146, }, /* 508 */ - { 25, 10, 5, 0, 0, 18432, 174, }, /* 509 */ - { 26, 7, 12, 0, 0, 18432, 82, }, /* 510 */ - { 26, 12, 3, 0, 0, 26624, 130, }, /* 511 */ - { 26, 10, 5, 0, 0, 18432, 176, }, /* 512 */ - { 69, 21, 12, 0, 0, 18573, 124, }, /* 513 */ - { 27, 7, 12, 0, 0, 18432, 82, }, /* 514 */ - { 27, 12, 3, 0, 0, 26624, 130, }, /* 515 */ - { 28, 7, 12, 0, 0, 18432, 82, }, /* 516 */ - { 28, 12, 3, 0, 0, 26624, 130, }, /* 517 */ - { 80, 7, 12, 0, 0, 18432, 82, }, /* 518 */ - { 80, 7, 12, 0, 0, 18432, 140, }, /* 519 */ - { 80, 12, 3, 0, 0, 26624, 100, }, /* 520 */ - { 80, 10, 5, 0, 0, 18432, 144, }, /* 521 */ - { 80, 12, 3, 0, 0, 26624, 130, }, /* 522 */ - { 80, 12, 3, 0, 0, 26624, 96, }, /* 523 */ - { 80, 12, 3, 0, 0, 26624, 146, }, /* 524 */ - { 80, 21, 12, 0, 0, 18432, 106, }, /* 525 */ - { 80, 6, 12, 0, 0, 18432, 142, }, /* 526 */ - { 80, 21, 12, 0, 0, 18432, 68, }, /* 527 */ - { 80, 23, 12, 0, 0, 14336, 68, }, /* 528 */ - { 80, 13, 12, 0, 0, 18432, 138, }, /* 529 */ - { 80, 15, 12, 0, 0, 28672, 68, }, /* 530 */ - { 19, 21, 12, 0, 0, 28672, 68, }, /* 531 */ - { 69, 21, 12, 0, 0, 28777, 106, }, /* 532 */ - { 69, 21, 12, 0, 0, 28777, 124, }, /* 533 */ - { 19, 21, 12, 0, 0, 28672, 106, }, /* 534 */ - { 19, 17, 12, 0, 0, 28672, 126, }, /* 535 */ - { 19, 21, 12, 0, 0, 28672, 124, }, /* 536 */ - { 19, 21, 12, 0, 0, 28672, 178, }, /* 537 */ - { 19, 12, 3, 0, 0, 26624, 180, }, /* 538 */ - { 19, 1, 2, 0, 0, 6144, 66, }, /* 539 */ - { 19, 13, 12, 0, 0, 18432, 138, }, /* 540 */ - { 19, 7, 12, 0, 0, 18432, 82, }, /* 541 */ - { 19, 6, 12, 0, 0, 18432, 136, }, /* 542 */ - { 19, 12, 3, 0, 0, 26624, 182, }, /* 543 */ - { 19, 12, 3, 0, 0, 26624, 130, }, /* 544 */ - { 29, 7, 12, 0, 0, 18432, 82, }, /* 545 */ - { 29, 12, 3, 0, 0, 26624, 130, }, /* 546 */ - { 29, 10, 5, 0, 0, 18432, 144, }, /* 547 */ - { 29, 12, 3, 0, 0, 26624, 96, }, /* 548 */ - { 29, 26, 12, 0, 0, 28672, 68, }, /* 549 */ - { 29, 21, 12, 0, 0, 28672, 124, }, /* 550 */ - { 29, 13, 12, 0, 0, 18432, 138, }, /* 551 */ - { 30, 7, 12, 0, 0, 18432, 82, }, /* 552 */ - { 89, 7, 12, 0, 0, 18432, 82, }, /* 553 */ - { 89, 7, 12, 0, 0, 18432, 156, }, /* 554 */ - { 89, 13, 12, 0, 0, 18432, 138, }, /* 555 */ - { 89, 15, 12, 0, 0, 18432, 138, }, /* 556 */ - { 89, 26, 12, 0, 0, 28672, 68, }, /* 557 */ - { 80, 26, 12, 0, 0, 28672, 68, }, /* 558 */ - { 33, 7, 12, 0, 0, 18432, 82, }, /* 559 */ - { 33, 12, 3, 0, 0, 26624, 130, }, /* 560 */ - { 33, 10, 5, 0, 0, 18432, 144, }, /* 561 */ - { 33, 21, 12, 0, 0, 18432, 68, }, /* 562 */ - { 106, 7, 12, 0, 0, 18432, 82, }, /* 563 */ - { 106, 10, 5, 0, 0, 18432, 144, }, /* 564 */ - { 106, 12, 3, 0, 0, 26624, 130, }, /* 565 */ - { 106, 12, 3, 0, 0, 26624, 184, }, /* 566 */ - { 106, 10, 12, 0, 0, 18432, 144, }, /* 567 */ - { 106, 12, 3, 0, 0, 26624, 96, }, /* 568 */ - { 106, 13, 12, 0, 0, 18432, 138, }, /* 569 */ - { 106, 21, 12, 0, 0, 18432, 68, }, /* 570 */ - { 106, 6, 12, 0, 0, 18432, 136, }, /* 571 */ - { 106, 21, 12, 0, 0, 18432, 124, }, /* 572 */ - { 84, 11, 3, 0, 0, 26624, 186, }, /* 573 */ - { 84, 12, 3, 0, 0, 26624, 130, }, /* 574 */ - { 93, 12, 3, 0, 0, 26624, 130, }, /* 575 */ - { 93, 10, 5, 0, 0, 18432, 144, }, /* 576 */ - { 93, 7, 12, 0, 0, 18432, 82, }, /* 577 */ - { 93, 12, 3, 0, 0, 26624, 96, }, /* 578 */ - { 93, 10, 3, 0, 0, 18432, 148, }, /* 579 */ - { 93, 10, 5, 0, 0, 18432, 174, }, /* 580 */ - { 93, 13, 12, 0, 0, 18432, 138, }, /* 581 */ - { 93, 21, 12, 0, 0, 18432, 124, }, /* 582 */ - { 93, 21, 12, 0, 0, 18432, 68, }, /* 583 */ - { 93, 21, 12, 0, 0, 18432, 106, }, /* 584 */ - { 93, 26, 12, 0, 0, 18432, 68, }, /* 585 */ - { 96, 12, 3, 0, 0, 26624, 130, }, /* 586 */ - { 96, 10, 5, 0, 0, 18432, 144, }, /* 587 */ - { 96, 7, 12, 0, 0, 18432, 82, }, /* 588 */ - { 96, 10, 5, 0, 0, 18432, 174, }, /* 589 */ - { 96, 12, 3, 0, 0, 26624, 146, }, /* 590 */ - { 96, 13, 12, 0, 0, 18432, 138, }, /* 591 */ - { 119, 7, 12, 0, 0, 18432, 82, }, /* 592 */ - { 119, 12, 3, 0, 0, 26624, 102, }, /* 593 */ - { 119, 10, 5, 0, 0, 18432, 144, }, /* 594 */ - { 119, 12, 3, 0, 0, 26624, 130, }, /* 595 */ - { 119, 10, 5, 0, 0, 18432, 176, }, /* 596 */ - { 119, 21, 12, 0, 0, 18432, 68, }, /* 597 */ - { 97, 7, 12, 0, 0, 18432, 82, }, /* 598 */ - { 97, 10, 5, 0, 0, 18432, 144, }, /* 599 */ - { 97, 12, 3, 0, 0, 26624, 130, }, /* 600 */ - { 97, 12, 3, 0, 0, 26624, 188, }, /* 601 */ - { 97, 12, 3, 0, 0, 26624, 96, }, /* 602 */ - { 97, 21, 12, 0, 0, 18432, 124, }, /* 603 */ - { 97, 21, 12, 0, 0, 18432, 106, }, /* 604 */ - { 97, 13, 12, 0, 0, 18432, 138, }, /* 605 */ - { 98, 13, 12, 0, 0, 18432, 138, }, /* 606 */ - { 98, 7, 12, 0, 0, 18432, 82, }, /* 607 */ - { 98, 6, 12, 0, 0, 18432, 92, }, /* 608 */ - { 98, 6, 12, 0, 0, 18432, 94, }, /* 609 */ - { 98, 21, 12, 0, 0, 18432, 124, }, /* 610 */ - { 2, 5, 12, 63, -6222, 18432, 70, }, /* 611 */ - { 2, 5, 12, 67, -6221, 18432, 70, }, /* 612 */ - { 2, 5, 12, 71, -6212, 18432, 70, }, /* 613 */ - { 2, 5, 12, 75, -6210, 18432, 70, }, /* 614 */ - { 2, 5, 12, 79, -6210, 18432, 70, }, /* 615 */ - { 2, 5, 12, 79, -6211, 18432, 70, }, /* 616 */ - { 2, 5, 12, 84, -6204, 18432, 70, }, /* 617 */ - { 2, 5, 12, 88, -6180, 18432, 70, }, /* 618 */ - { 2, 5, 12, 108, 35267, 18432, 70, }, /* 619 */ - { 17, 9, 12, 0, -3008, 18432, 74, }, /* 620 */ - { 96, 21, 12, 0, 0, 18432, 68, }, /* 621 */ - { 84, 12, 3, 0, 0, 26762, 96, }, /* 622 */ - { 84, 12, 3, 0, 0, 26630, 96, }, /* 623 */ - { 69, 21, 12, 0, 0, 18498, 190, }, /* 624 */ - { 84, 12, 3, 0, 0, 26666, 96, }, /* 625 */ - { 84, 12, 3, 0, 0, 26696, 96, }, /* 626 */ - { 84, 12, 3, 0, 0, 26780, 96, }, /* 627 */ - { 69, 10, 5, 0, 0, 18474, 160, }, /* 628 */ - { 69, 7, 12, 0, 0, 18501, 82, }, /* 629 */ - { 69, 7, 12, 0, 0, 18474, 82, }, /* 630 */ - { 69, 7, 12, 0, 0, 18438, 82, }, /* 631 */ - { 69, 7, 12, 0, 0, 18594, 82, }, /* 632 */ - { 69, 7, 12, 0, 0, 18498, 82, }, /* 633 */ - { 84, 12, 3, 0, 0, 26750, 96, }, /* 634 */ - { 69, 10, 5, 0, 0, 18435, 160, }, /* 635 */ - { 84, 12, 3, 0, 0, 26690, 96, }, /* 636 */ - { 69, 7, 12, 0, 0, 18453, 82, }, /* 637 */ - { 2, 5, 12, 0, 0, 18432, 60, }, /* 638 */ - { 1, 6, 12, 0, 0, 18432, 88, }, /* 639 */ - { 2, 6, 12, 0, 0, 18432, 168, }, /* 640 */ - { 0, 5, 12, 0, 35332, 18432, 76, }, /* 641 */ - { 0, 5, 12, 0, 3814, 18432, 76, }, /* 642 */ - { 0, 5, 12, 0, 35384, 18432, 76, }, /* 643 */ - { 0, 5, 12, 0, 0, 18432, 192, }, /* 644 */ - { 0, 6, 12, 0, 0, 18432, 168, }, /* 645 */ - { 0, 6, 12, 0, 0, 18432, 194, }, /* 646 */ - { 1, 6, 12, 0, 0, 18432, 168, }, /* 647 */ - { 84, 12, 3, 0, 0, 26636, 102, }, /* 648 */ - { 84, 12, 3, 0, 0, 26687, 96, }, /* 649 */ - { 84, 12, 3, 0, 0, 26648, 96, }, /* 650 */ - { 0, 9, 12, 92, 1, 18432, 74, }, /* 651 */ - { 0, 5, 12, 92, -1, 18432, 76, }, /* 652 */ - { 0, 5, 12, 0, 0, 18432, 70, }, /* 653 */ - { 0, 5, 12, 92, -58, 18432, 70, }, /* 654 */ - { 0, 9, 12, 0, -7615, 18432, 74, }, /* 655 */ - { 1, 5, 12, 0, 8, 18432, 76, }, /* 656 */ - { 1, 9, 12, 0, -8, 18432, 74, }, /* 657 */ - { 1, 5, 12, 0, 74, 18432, 76, }, /* 658 */ - { 1, 5, 12, 0, 86, 18432, 76, }, /* 659 */ - { 1, 5, 12, 0, 100, 18432, 76, }, /* 660 */ - { 1, 5, 12, 0, 128, 18432, 76, }, /* 661 */ - { 1, 5, 12, 0, 112, 18432, 76, }, /* 662 */ - { 1, 5, 12, 0, 126, 18432, 76, }, /* 663 */ - { 1, 5, 12, 0, 8, 18432, 70, }, /* 664 */ - { 1, 8, 12, 0, -8, 18432, 86, }, /* 665 */ - { 1, 5, 12, 0, 0, 18432, 70, }, /* 666 */ - { 1, 5, 12, 0, 9, 18432, 70, }, /* 667 */ - { 1, 9, 12, 0, -74, 18432, 74, }, /* 668 */ - { 1, 8, 12, 0, -9, 18432, 86, }, /* 669 */ - { 1, 5, 12, 21, -7173, 18432, 76, }, /* 670 */ - { 1, 9, 12, 0, -86, 18432, 74, }, /* 671 */ - { 1, 9, 12, 0, -100, 18432, 74, }, /* 672 */ - { 1, 9, 12, 0, -112, 18432, 74, }, /* 673 */ - { 1, 9, 12, 0, -128, 18432, 74, }, /* 674 */ - { 1, 9, 12, 0, -126, 18432, 74, }, /* 675 */ - { 69, 29, 12, 0, 0, 45056, 52, }, /* 676 */ - { 84, 1, 3, 0, 0, 6144, 196, }, /* 677 */ - { 84, 1, 13, 0, 0, 6144, 198, }, /* 678 */ - { 69, 1, 2, 0, 0, 18432, 200, }, /* 679 */ - { 69, 1, 2, 0, 0, 34816, 200, }, /* 680 */ - { 69, 17, 12, 0, 0, 28672, 202, }, /* 681 */ - { 69, 21, 12, 0, 0, 28672, 64, }, /* 682 */ - { 69, 20, 12, 0, 0, 28672, 204, }, /* 683 */ - { 69, 19, 12, 0, 0, 28672, 204, }, /* 684 */ - { 69, 22, 12, 0, 0, 28672, 206, }, /* 685 */ - { 69, 20, 12, 0, 0, 28672, 206, }, /* 686 */ - { 69, 19, 12, 0, 0, 28672, 206, }, /* 687 */ - { 69, 21, 12, 0, 0, 28672, 208, }, /* 688 */ - { 69, 27, 2, 0, 0, 45056, 50, }, /* 689 */ - { 69, 28, 2, 0, 0, 4096, 50, }, /* 690 */ - { 69, 1, 2, 0, 0, 20480, 134, }, /* 691 */ - { 69, 1, 2, 0, 0, 36864, 134, }, /* 692 */ - { 69, 1, 2, 0, 0, 30720, 134, }, /* 693 */ - { 69, 1, 2, 0, 0, 24576, 134, }, /* 694 */ - { 69, 1, 2, 0, 0, 40960, 134, }, /* 695 */ - { 69, 29, 12, 0, 0, 8291, 52, }, /* 696 */ - { 69, 21, 12, 0, 0, 14336, 54, }, /* 697 */ - { 69, 21, 12, 0, 0, 14336, 64, }, /* 698 */ - { 69, 21, 14, 0, 0, 28672, 210, }, /* 699 */ - { 69, 21, 12, 0, 0, 28672, 212, }, /* 700 */ - { 69, 16, 12, 0, 0, 28672, 138, }, /* 701 */ - { 69, 16, 12, 0, 0, 28672, 214, }, /* 702 */ - { 69, 25, 12, 0, 0, 8192, 64, }, /* 703 */ - { 69, 22, 12, 0, 0, 28672, 216, }, /* 704 */ - { 69, 18, 12, 0, 0, 28672, 216, }, /* 705 */ - { 69, 21, 12, 0, 0, 28672, 202, }, /* 706 */ - { 69, 1, 2, 0, 0, 6144, 218, }, /* 707 */ - { 68, 2, 2, 0, 0, 6144, 220, }, /* 708 */ - { 69, 1, 2, 0, 0, 22528, 134, }, /* 709 */ - { 69, 1, 2, 0, 0, 38912, 134, }, /* 710 */ - { 69, 1, 2, 0, 0, 16384, 134, }, /* 711 */ - { 69, 1, 2, 0, 0, 32768, 134, }, /* 712 */ - { 69, 1, 2, 0, 0, 6144, 222, }, /* 713 */ - { 69, 25, 12, 0, 0, 12288, 118, }, /* 714 */ - { 69, 25, 12, 0, 0, 12288, 224, }, /* 715 */ - { 69, 25, 12, 0, 0, 28672, 118, }, /* 716 */ - { 69, 22, 12, 0, 0, 28672, 226, }, /* 717 */ - { 69, 18, 12, 0, 0, 28672, 226, }, /* 718 */ - { 68, 2, 12, 0, 0, 14336, 0, }, /* 719 */ - { 84, 12, 3, 0, 0, 26624, 228, }, /* 720 */ - { 84, 11, 3, 0, 0, 26624, 120, }, /* 721 */ - { 84, 11, 3, 0, 0, 26624, 230, }, /* 722 */ - { 84, 12, 3, 0, 0, 26753, 102, }, /* 723 */ - { 69, 26, 12, 0, 0, 28672, 68, }, /* 724 */ - { 69, 9, 12, 0, 0, 18432, 112, }, /* 725 */ - { 69, 5, 12, 0, 0, 18432, 232, }, /* 726 */ - { 69, 25, 12, 0, 0, 28672, 234, }, /* 727 */ - { 69, 26, 14, 0, 0, 28672, 236, }, /* 728 */ - { 1, 9, 12, 96, -7517, 18432, 74, }, /* 729 */ - { 69, 26, 12, 0, 0, 28672, 118, }, /* 730 */ - { 0, 9, 12, 100, 0, 18432, 74, }, /* 731 */ - { 0, 9, 12, 104, -8262, 18432, 74, }, /* 732 */ - { 69, 26, 12, 0, 0, 14336, 238, }, /* 733 */ - { 0, 9, 12, 0, 28, 18432, 74, }, /* 734 */ - { 69, 7, 12, 0, 0, 18432, 240, }, /* 735 */ - { 69, 5, 14, 0, 0, 18432, 242, }, /* 736 */ - { 69, 5, 12, 0, 0, 18432, 244, }, /* 737 */ - { 0, 5, 12, 0, -28, 18432, 76, }, /* 738 */ - { 0, 14, 12, 0, 16, 18432, 74, }, /* 739 */ - { 0, 14, 12, 0, -16, 18432, 76, }, /* 740 */ - { 0, 14, 12, 0, 0, 18432, 82, }, /* 741 */ - { 69, 25, 14, 0, 0, 28672, 246, }, /* 742 */ - { 69, 26, 14, 0, 0, 28672, 246, }, /* 743 */ - { 69, 26, 12, 0, 0, 28672, 64, }, /* 744 */ - { 69, 25, 12, 0, 0, 28672, 248, }, /* 745 */ - { 69, 25, 12, 0, 0, 12288, 250, }, /* 746 */ - { 69, 22, 12, 0, 0, 28672, 248, }, /* 747 */ - { 69, 18, 12, 0, 0, 28672, 248, }, /* 748 */ - { 69, 26, 14, 0, 0, 28672, 252, }, /* 749 */ - { 69, 22, 12, 0, 0, 28672, 254, }, /* 750 */ - { 69, 18, 12, 0, 0, 28672, 254, }, /* 751 */ - { 69, 26, 12, 0, 0, 18432, 54, }, /* 752 */ - { 69, 26, 14, 0, 0, 28672, 256, }, /* 753 */ - { 68, 2, 12, 0, 0, 18432, 258, }, /* 754 */ - { 69, 26, 12, 0, 26, 18432, 260, }, /* 755 */ - { 69, 26, 14, 0, 26, 18432, 262, }, /* 756 */ - { 69, 26, 12, 0, -26, 18432, 264, }, /* 757 */ - { 69, 25, 14, 0, 0, 28672, 266, }, /* 758 */ - { 69, 26, 14, 0, 0, 28672, 268, }, /* 759 */ - { 69, 26, 14, 0, 0, 28672, 270, }, /* 760 */ - { 69, 25, 14, 0, 0, 28672, 268, }, /* 761 */ - { 69, 26, 14, 0, 0, 18432, 256, }, /* 762 */ - { 69, 26, 14, 0, 0, 28672, 272, }, /* 763 */ - { 88, 26, 12, 0, 0, 18432, 54, }, /* 764 */ - { 69, 26, 12, 0, 0, 28672, 216, }, /* 765 */ - { 35, 9, 12, 0, 48, 18432, 74, }, /* 766 */ - { 35, 5, 12, 0, -48, 18432, 76, }, /* 767 */ - { 0, 9, 12, 0, -10743, 18432, 74, }, /* 768 */ - { 0, 9, 12, 0, -3814, 18432, 74, }, /* 769 */ - { 0, 9, 12, 0, -10727, 18432, 74, }, /* 770 */ - { 0, 5, 12, 0, -10795, 18432, 76, }, /* 771 */ - { 0, 5, 12, 0, -10792, 18432, 76, }, /* 772 */ - { 0, 9, 12, 0, -10780, 18432, 74, }, /* 773 */ - { 0, 9, 12, 0, -10749, 18432, 74, }, /* 774 */ - { 0, 9, 12, 0, -10783, 18432, 74, }, /* 775 */ - { 0, 9, 12, 0, -10782, 18432, 74, }, /* 776 */ - { 0, 9, 12, 0, -10815, 18432, 74, }, /* 777 */ - { 34, 5, 12, 0, 0, 18432, 60, }, /* 778 */ - { 34, 26, 12, 0, 0, 28672, 68, }, /* 779 */ - { 34, 12, 3, 0, 0, 26624, 96, }, /* 780 */ - { 34, 21, 12, 0, 0, 28672, 68, }, /* 781 */ - { 34, 15, 12, 0, 0, 28672, 68, }, /* 782 */ - { 17, 5, 12, 0, -7264, 18432, 76, }, /* 783 */ - { 90, 7, 12, 0, 0, 18432, 82, }, /* 784 */ - { 90, 6, 12, 0, 0, 18432, 142, }, /* 785 */ - { 90, 21, 12, 0, 0, 18432, 68, }, /* 786 */ - { 90, 12, 3, 0, 0, 26624, 184, }, /* 787 */ - { 2, 12, 3, 0, 0, 26624, 130, }, /* 788 */ - { 69, 20, 12, 0, 0, 28672, 216, }, /* 789 */ - { 69, 19, 12, 0, 0, 28672, 216, }, /* 790 */ - { 69, 6, 12, 0, 0, 28672, 274, }, /* 791 */ - { 69, 21, 12, 0, 0, 28672, 276, }, /* 792 */ - { 69, 21, 12, 0, 0, 28726, 54, }, /* 793 */ - { 23, 26, 12, 0, 0, 28672, 278, }, /* 794 */ - { 69, 26, 12, 0, 0, 28672, 280, }, /* 795 */ - { 69, 26, 12, 0, 0, 28672, 282, }, /* 796 */ - { 69, 21, 12, 0, 0, 28825, 276, }, /* 797 */ - { 69, 21, 12, 0, 0, 28825, 212, }, /* 798 */ - { 69, 21, 12, 0, 0, 28819, 54, }, /* 799 */ - { 23, 6, 12, 0, 0, 18432, 136, }, /* 800 */ - { 69, 7, 12, 0, 0, 18447, 284, }, /* 801 */ - { 23, 14, 12, 0, 0, 18432, 284, }, /* 802 */ - { 69, 22, 12, 0, 0, 28825, 216, }, /* 803 */ - { 69, 18, 12, 0, 0, 28825, 216, }, /* 804 */ - { 69, 22, 12, 0, 0, 28825, 62, }, /* 805 */ - { 69, 18, 12, 0, 0, 28825, 62, }, /* 806 */ - { 69, 26, 12, 0, 0, 28819, 54, }, /* 807 */ - { 69, 17, 12, 0, 0, 28819, 202, }, /* 808 */ - { 69, 22, 12, 0, 0, 28819, 206, }, /* 809 */ - { 69, 18, 12, 0, 0, 28819, 206, }, /* 810 */ - { 84, 12, 3, 0, 0, 26669, 96, }, /* 811 */ - { 18, 10, 3, 0, 0, 18432, 286, }, /* 812 */ - { 69, 17, 14, 0, 0, 28819, 288, }, /* 813 */ - { 69, 6, 12, 0, 0, 18525, 136, }, /* 814 */ - { 69, 26, 12, 0, 0, 28819, 68, }, /* 815 */ - { 23, 6, 12, 0, 0, 18432, 142, }, /* 816 */ - { 69, 7, 12, 0, 0, 18564, 82, }, /* 817 */ - { 69, 21, 14, 0, 0, 28804, 236, }, /* 818 */ - { 69, 26, 12, 0, 0, 28687, 68, }, /* 819 */ - { 20, 7, 12, 0, 0, 18432, 82, }, /* 820 */ - { 84, 12, 3, 0, 0, 26717, 96, }, /* 821 */ - { 69, 24, 12, 0, 0, 28765, 290, }, /* 822 */ - { 20, 6, 12, 0, 0, 18432, 136, }, /* 823 */ - { 69, 17, 12, 0, 0, 28765, 126, }, /* 824 */ - { 21, 7, 12, 0, 0, 18432, 82, }, /* 825 */ - { 69, 21, 12, 0, 0, 28825, 68, }, /* 826 */ - { 69, 6, 12, 0, 0, 18525, 94, }, /* 827 */ - { 21, 6, 12, 0, 0, 18432, 136, }, /* 828 */ - { 22, 7, 12, 0, 0, 18432, 82, }, /* 829 */ - { 18, 7, 12, 0, 0, 18432, 82, }, /* 830 */ - { 18, 7, 12, 0, 0, 18432, 170, }, /* 831 */ - { 69, 26, 12, 0, 0, 18447, 68, }, /* 832 */ - { 69, 15, 12, 0, 0, 18447, 68, }, /* 833 */ - { 18, 26, 12, 0, 0, 18432, 68, }, /* 834 */ - { 18, 26, 12, 0, 0, 28672, 68, }, /* 835 */ - { 69, 15, 12, 0, 0, 18432, 68, }, /* 836 */ - { 69, 26, 14, 0, 0, 18447, 236, }, /* 837 */ - { 21, 26, 12, 0, 0, 18432, 68, }, /* 838 */ - { 23, 7, 12, 0, 0, 18432, 292, }, /* 839 */ - { 24, 7, 12, 0, 0, 18432, 82, }, /* 840 */ - { 24, 6, 12, 0, 0, 18432, 136, }, /* 841 */ - { 24, 26, 12, 0, 0, 28672, 68, }, /* 842 */ - { 111, 7, 12, 0, 0, 18432, 82, }, /* 843 */ - { 111, 6, 12, 0, 0, 18432, 142, }, /* 844 */ - { 111, 21, 12, 0, 0, 18432, 106, }, /* 845 */ - { 111, 21, 12, 0, 0, 18432, 124, }, /* 846 */ - { 99, 7, 12, 0, 0, 18432, 82, }, /* 847 */ - { 99, 6, 12, 0, 0, 18432, 136, }, /* 848 */ - { 99, 21, 12, 0, 0, 28672, 106, }, /* 849 */ - { 99, 21, 12, 0, 0, 28672, 124, }, /* 850 */ - { 99, 13, 12, 0, 0, 18432, 138, }, /* 851 */ - { 2, 9, 12, 108, 1, 18432, 74, }, /* 852 */ - { 2, 5, 12, 108, -35267, 18432, 76, }, /* 853 */ - { 2, 7, 12, 0, 0, 18432, 82, }, /* 854 */ - { 2, 21, 12, 0, 0, 28672, 68, }, /* 855 */ - { 2, 12, 3, 0, 0, 26624, 96, }, /* 856 */ - { 2, 6, 12, 0, 0, 28672, 92, }, /* 857 */ - { 2, 6, 12, 0, 0, 18432, 88, }, /* 858 */ - { 112, 7, 12, 0, 0, 18432, 82, }, /* 859 */ - { 112, 14, 12, 0, 0, 18432, 82, }, /* 860 */ - { 112, 12, 3, 0, 0, 26624, 96, }, /* 861 */ - { 112, 21, 12, 0, 0, 18432, 68, }, /* 862 */ - { 112, 21, 12, 0, 0, 18432, 124, }, /* 863 */ - { 112, 21, 12, 0, 0, 18432, 106, }, /* 864 */ - { 69, 24, 12, 0, 0, 28762, 56, }, /* 865 */ - { 0, 9, 12, 0, -35332, 18432, 74, }, /* 866 */ - { 69, 24, 12, 0, 0, 18432, 56, }, /* 867 */ - { 0, 9, 12, 0, -42280, 18432, 74, }, /* 868 */ - { 0, 5, 12, 0, 48, 18432, 76, }, /* 869 */ - { 0, 9, 12, 0, -42308, 18432, 74, }, /* 870 */ - { 0, 9, 12, 0, -42319, 18432, 74, }, /* 871 */ - { 0, 9, 12, 0, -42315, 18432, 74, }, /* 872 */ - { 0, 9, 12, 0, -42305, 18432, 74, }, /* 873 */ - { 0, 9, 12, 0, -42258, 18432, 74, }, /* 874 */ - { 0, 9, 12, 0, -42282, 18432, 74, }, /* 875 */ - { 0, 9, 12, 0, -42261, 18432, 74, }, /* 876 */ - { 0, 9, 12, 0, 928, 18432, 74, }, /* 877 */ - { 0, 9, 12, 0, -48, 18432, 74, }, /* 878 */ - { 0, 9, 12, 0, -42307, 18432, 74, }, /* 879 */ - { 0, 9, 12, 0, -35384, 18432, 74, }, /* 880 */ - { 36, 7, 12, 0, 0, 18432, 82, }, /* 881 */ - { 36, 12, 3, 0, 0, 26624, 130, }, /* 882 */ - { 36, 12, 3, 0, 0, 26624, 184, }, /* 883 */ - { 36, 10, 5, 0, 0, 18432, 144, }, /* 884 */ - { 36, 26, 12, 0, 0, 28672, 68, }, /* 885 */ - { 69, 15, 12, 0, 0, 18612, 68, }, /* 886 */ - { 69, 15, 12, 0, 0, 18609, 68, }, /* 887 */ - { 69, 26, 12, 0, 0, 18600, 68, }, /* 888 */ - { 69, 23, 12, 0, 0, 14504, 68, }, /* 889 */ - { 69, 26, 12, 0, 0, 14504, 68, }, /* 890 */ - { 37, 7, 12, 0, 0, 18432, 82, }, /* 891 */ - { 37, 21, 12, 0, 0, 28672, 68, }, /* 892 */ - { 37, 21, 12, 0, 0, 28672, 124, }, /* 893 */ - { 100, 10, 5, 0, 0, 18432, 144, }, /* 894 */ - { 100, 7, 12, 0, 0, 18432, 82, }, /* 895 */ - { 100, 12, 3, 0, 0, 26624, 146, }, /* 896 */ - { 100, 12, 3, 0, 0, 26624, 130, }, /* 897 */ - { 100, 21, 12, 0, 0, 18432, 124, }, /* 898 */ - { 100, 13, 12, 0, 0, 18432, 138, }, /* 899 */ - { 6, 12, 3, 0, 0, 26666, 96, }, /* 900 */ - { 6, 7, 12, 0, 0, 18507, 82, }, /* 901 */ - { 39, 13, 12, 0, 0, 18432, 138, }, /* 902 */ - { 39, 7, 12, 0, 0, 18432, 82, }, /* 903 */ - { 39, 12, 3, 0, 0, 26624, 130, }, /* 904 */ - { 39, 12, 3, 0, 0, 26624, 96, }, /* 905 */ - { 69, 21, 12, 0, 0, 18567, 190, }, /* 906 */ - { 39, 21, 12, 0, 0, 18432, 124, }, /* 907 */ - { 101, 7, 12, 0, 0, 18432, 82, }, /* 908 */ - { 101, 12, 3, 0, 0, 26624, 130, }, /* 909 */ - { 101, 10, 5, 0, 0, 18432, 144, }, /* 910 */ - { 101, 10, 5, 0, 0, 18432, 174, }, /* 911 */ - { 101, 21, 12, 0, 0, 18432, 68, }, /* 912 */ - { 40, 12, 3, 0, 0, 26624, 130, }, /* 913 */ - { 40, 10, 5, 0, 0, 18432, 144, }, /* 914 */ - { 40, 7, 12, 0, 0, 18432, 82, }, /* 915 */ - { 40, 12, 3, 0, 0, 26624, 96, }, /* 916 */ - { 40, 10, 5, 0, 0, 18432, 174, }, /* 917 */ - { 40, 21, 12, 0, 0, 18432, 68, }, /* 918 */ - { 40, 21, 12, 0, 0, 18432, 106, }, /* 919 */ - { 40, 21, 12, 0, 0, 18432, 124, }, /* 920 */ - { 69, 6, 12, 0, 0, 18480, 136, }, /* 921 */ - { 40, 13, 12, 0, 0, 18432, 138, }, /* 922 */ - { 16, 6, 12, 0, 0, 18432, 136, }, /* 923 */ - { 105, 7, 12, 0, 0, 18432, 82, }, /* 924 */ - { 105, 12, 3, 0, 0, 26624, 130, }, /* 925 */ - { 105, 10, 5, 0, 0, 18432, 144, }, /* 926 */ - { 105, 13, 12, 0, 0, 18432, 138, }, /* 927 */ - { 105, 21, 12, 0, 0, 18432, 68, }, /* 928 */ - { 105, 21, 12, 0, 0, 18432, 124, }, /* 929 */ - { 107, 7, 12, 0, 0, 18432, 82, }, /* 930 */ - { 107, 12, 3, 0, 0, 26624, 130, }, /* 931 */ - { 107, 7, 12, 0, 0, 18432, 156, }, /* 932 */ - { 107, 12, 3, 0, 0, 26624, 96, }, /* 933 */ - { 107, 7, 12, 0, 0, 18432, 294, }, /* 934 */ - { 107, 6, 12, 0, 0, 18432, 136, }, /* 935 */ - { 107, 21, 12, 0, 0, 18432, 68, }, /* 936 */ - { 107, 21, 12, 0, 0, 18432, 106, }, /* 937 */ - { 113, 7, 12, 0, 0, 18432, 82, }, /* 938 */ - { 113, 10, 5, 0, 0, 18432, 144, }, /* 939 */ - { 113, 12, 3, 0, 0, 26624, 130, }, /* 940 */ - { 113, 21, 12, 0, 0, 18432, 124, }, /* 941 */ - { 113, 6, 12, 0, 0, 18432, 136, }, /* 942 */ - { 113, 12, 3, 0, 0, 26624, 146, }, /* 943 */ - { 0, 5, 12, 0, -928, 18432, 76, }, /* 944 */ - { 76, 5, 12, 0, -38864, 18432, 70, }, /* 945 */ - { 113, 10, 5, 0, 0, 18432, 160, }, /* 946 */ - { 113, 13, 12, 0, 0, 18432, 138, }, /* 947 */ - { 18, 7, 9, 0, 0, 18432, 82, }, /* 948 */ - { 18, 7, 10, 0, 0, 18432, 82, }, /* 949 */ - { 68, 4, 12, 0, 0, 18432, 0, }, /* 950 */ - { 68, 3, 12, 0, 0, 18432, 0, }, /* 951 */ - { 23, 7, 12, 0, 0, 18432, 284, }, /* 952 */ - { 71, 25, 12, 0, 0, 12288, 118, }, /* 953 */ - { 3, 7, 12, 0, 0, 0, 296, }, /* 954 */ - { 69, 18, 12, 0, 0, 28705, 54, }, /* 955 */ - { 69, 22, 12, 0, 0, 28705, 54, }, /* 956 */ - { 68, 2, 12, 0, 0, 6144, 298, }, /* 957 */ - { 3, 7, 12, 0, 0, 39, 82, }, /* 958 */ - { 3, 26, 12, 0, 0, 28711, 68, }, /* 959 */ - { 84, 12, 3, 0, 0, 26624, 180, }, /* 960 */ - { 84, 12, 3, 0, 0, 26624, 300, }, /* 961 */ - { 69, 21, 12, 0, 0, 28672, 68, }, /* 962 */ - { 69, 21, 12, 0, 0, 28672, 122, }, /* 963 */ - { 69, 22, 12, 0, 0, 28672, 68, }, /* 964 */ - { 69, 18, 12, 0, 0, 28672, 68, }, /* 965 */ - { 69, 17, 12, 0, 0, 28672, 126, }, /* 966 */ - { 69, 22, 12, 0, 0, 28672, 302, }, /* 967 */ - { 69, 18, 12, 0, 0, 28672, 302, }, /* 968 */ - { 69, 21, 12, 0, 0, 8192, 106, }, /* 969 */ - { 69, 21, 12, 0, 0, 8192, 304, }, /* 970 */ - { 69, 21, 12, 0, 0, 8192, 306, }, /* 971 */ - { 69, 21, 12, 0, 0, 28672, 124, }, /* 972 */ - { 69, 22, 12, 0, 0, 28672, 158, }, /* 973 */ - { 69, 18, 12, 0, 0, 28672, 158, }, /* 974 */ - { 69, 21, 12, 0, 0, 14336, 68, }, /* 975 */ - { 69, 21, 12, 0, 0, 28672, 118, }, /* 976 */ - { 69, 17, 12, 0, 0, 12288, 224, }, /* 977 */ - { 69, 25, 12, 0, 0, 28672, 226, }, /* 978 */ - { 69, 21, 12, 0, 0, 28672, 302, }, /* 979 */ - { 69, 21, 12, 0, 0, 28672, 308, }, /* 980 */ - { 69, 17, 12, 0, 0, 12288, 126, }, /* 981 */ - { 69, 21, 12, 0, 0, 8192, 68, }, /* 982 */ - { 69, 13, 12, 0, 0, 10240, 310, }, /* 983 */ - { 0, 9, 12, 0, 32, 18432, 312, }, /* 984 */ - { 69, 24, 12, 0, 0, 28672, 314, }, /* 985 */ - { 0, 5, 12, 0, -32, 18432, 316, }, /* 986 */ - { 69, 21, 12, 0, 0, 28825, 124, }, /* 987 */ - { 69, 22, 12, 0, 0, 28825, 318, }, /* 988 */ - { 69, 18, 12, 0, 0, 28825, 318, }, /* 989 */ - { 69, 21, 12, 0, 0, 28825, 106, }, /* 990 */ - { 69, 6, 3, 0, 0, 18525, 320, }, /* 991 */ - { 69, 1, 2, 0, 0, 28672, 322, }, /* 992 */ - { 31, 7, 12, 0, 0, 18432, 82, }, /* 993 */ - { 69, 21, 12, 0, 0, 18552, 68, }, /* 994 */ - { 69, 21, 12, 0, 0, 28792, 68, }, /* 995 */ - { 69, 21, 12, 0, 0, 18483, 68, }, /* 996 */ - { 69, 15, 12, 0, 0, 18555, 68, }, /* 997 */ - { 69, 26, 12, 0, 0, 18483, 68, }, /* 998 */ - { 1, 14, 12, 0, 0, 28672, 82, }, /* 999 */ - { 1, 15, 12, 0, 0, 28672, 68, }, /* 1000 */ - { 1, 26, 12, 0, 0, 28672, 68, }, /* 1001 */ - { 1, 26, 12, 0, 0, 18432, 68, }, /* 1002 */ - { 102, 7, 12, 0, 0, 18432, 82, }, /* 1003 */ - { 103, 7, 12, 0, 0, 18432, 82, }, /* 1004 */ - { 84, 12, 3, 0, 0, 26651, 96, }, /* 1005 */ - { 69, 15, 12, 0, 0, 10267, 68, }, /* 1006 */ - { 81, 7, 12, 0, 0, 18432, 82, }, /* 1007 */ - { 81, 15, 12, 0, 0, 18432, 68, }, /* 1008 */ - { 82, 7, 12, 0, 0, 18432, 82, }, /* 1009 */ - { 82, 14, 12, 0, 0, 18432, 82, }, /* 1010 */ - { 53, 7, 12, 0, 0, 18432, 82, }, /* 1011 */ - { 53, 12, 3, 0, 0, 26624, 130, }, /* 1012 */ - { 85, 7, 12, 0, 0, 18432, 82, }, /* 1013 */ - { 85, 21, 12, 0, 0, 18432, 106, }, /* 1014 */ - { 91, 7, 12, 0, 0, 18432, 82, }, /* 1015 */ - { 91, 21, 12, 0, 0, 18432, 106, }, /* 1016 */ - { 91, 14, 12, 0, 0, 18432, 82, }, /* 1017 */ - { 83, 9, 12, 0, 40, 18432, 74, }, /* 1018 */ - { 83, 5, 12, 0, -40, 18432, 76, }, /* 1019 */ - { 86, 7, 12, 0, 0, 18432, 82, }, /* 1020 */ - { 87, 7, 12, 0, 0, 18432, 82, }, /* 1021 */ - { 87, 13, 12, 0, 0, 18432, 138, }, /* 1022 */ - { 145, 9, 12, 0, 40, 18432, 74, }, /* 1023 */ - { 145, 5, 12, 0, -40, 18432, 76, }, /* 1024 */ - { 127, 7, 12, 0, 0, 18432, 82, }, /* 1025 */ - { 125, 7, 12, 0, 0, 18432, 82, }, /* 1026 */ - { 125, 21, 12, 0, 0, 18432, 68, }, /* 1027 */ - { 161, 9, 12, 0, 39, 18432, 74, }, /* 1028 */ - { 161, 5, 12, 0, -39, 18432, 76, }, /* 1029 */ - { 49, 7, 12, 0, 0, 18432, 82, }, /* 1030 */ - { 0, 6, 12, 0, 0, 18432, 94, }, /* 1031 */ - { 32, 7, 12, 0, 0, 34816, 82, }, /* 1032 */ - { 114, 7, 12, 0, 0, 34816, 82, }, /* 1033 */ - { 114, 21, 12, 0, 0, 34816, 106, }, /* 1034 */ - { 114, 15, 12, 0, 0, 34816, 68, }, /* 1035 */ - { 133, 7, 12, 0, 0, 34816, 82, }, /* 1036 */ - { 133, 26, 12, 0, 0, 34816, 68, }, /* 1037 */ - { 133, 15, 12, 0, 0, 34816, 68, }, /* 1038 */ - { 132, 7, 12, 0, 0, 34816, 82, }, /* 1039 */ - { 132, 15, 12, 0, 0, 34816, 68, }, /* 1040 */ - { 139, 7, 12, 0, 0, 34816, 82, }, /* 1041 */ - { 139, 15, 12, 0, 0, 34816, 68, }, /* 1042 */ - { 95, 7, 12, 0, 0, 34816, 82, }, /* 1043 */ - { 95, 15, 12, 0, 0, 34816, 68, }, /* 1044 */ - { 95, 21, 12, 0, 0, 28672, 106, }, /* 1045 */ - { 104, 7, 12, 0, 0, 34816, 82, }, /* 1046 */ - { 104, 21, 12, 0, 0, 34816, 68, }, /* 1047 */ - { 122, 7, 12, 0, 0, 34816, 82, }, /* 1048 */ - { 121, 7, 12, 0, 0, 34816, 82, }, /* 1049 */ - { 121, 15, 12, 0, 0, 34816, 68, }, /* 1050 */ - { 92, 7, 12, 0, 0, 34816, 82, }, /* 1051 */ - { 92, 12, 3, 0, 0, 26624, 130, }, /* 1052 */ - { 92, 12, 3, 0, 0, 26624, 102, }, /* 1053 */ - { 92, 12, 3, 0, 0, 26624, 184, }, /* 1054 */ - { 92, 15, 12, 0, 0, 34816, 68, }, /* 1055 */ - { 92, 21, 12, 0, 0, 34816, 68, }, /* 1056 */ - { 92, 21, 12, 0, 0, 34816, 124, }, /* 1057 */ - { 115, 7, 12, 0, 0, 34816, 82, }, /* 1058 */ - { 115, 15, 12, 0, 0, 34816, 68, }, /* 1059 */ - { 115, 21, 12, 0, 0, 34816, 68, }, /* 1060 */ - { 131, 7, 12, 0, 0, 34816, 82, }, /* 1061 */ - { 131, 15, 12, 0, 0, 34816, 68, }, /* 1062 */ - { 51, 7, 12, 0, 0, 34816, 82, }, /* 1063 */ - { 51, 26, 12, 0, 0, 34816, 68, }, /* 1064 */ - { 51, 12, 3, 0, 0, 26624, 96, }, /* 1065 */ - { 51, 15, 12, 0, 0, 34816, 68, }, /* 1066 */ - { 51, 21, 12, 0, 0, 34816, 106, }, /* 1067 */ - { 51, 21, 12, 0, 0, 34918, 106, }, /* 1068 */ - { 51, 21, 12, 0, 0, 34816, 68, }, /* 1069 */ - { 108, 7, 12, 0, 0, 34816, 82, }, /* 1070 */ - { 108, 21, 12, 0, 0, 28672, 68, }, /* 1071 */ - { 108, 21, 12, 0, 0, 28672, 106, }, /* 1072 */ - { 116, 7, 12, 0, 0, 34816, 82, }, /* 1073 */ - { 116, 15, 12, 0, 0, 34816, 68, }, /* 1074 */ - { 117, 7, 12, 0, 0, 34816, 82, }, /* 1075 */ - { 117, 15, 12, 0, 0, 34816, 68, }, /* 1076 */ - { 54, 7, 12, 0, 0, 34816, 82, }, /* 1077 */ - { 54, 21, 12, 0, 0, 34816, 106, }, /* 1078 */ - { 54, 15, 12, 0, 0, 34816, 68, }, /* 1079 */ - { 118, 7, 12, 0, 0, 34816, 82, }, /* 1080 */ - { 140, 9, 12, 0, 64, 34816, 74, }, /* 1081 */ - { 140, 5, 12, 0, -64, 34816, 76, }, /* 1082 */ - { 140, 15, 12, 0, 0, 34816, 68, }, /* 1083 */ - { 62, 7, 12, 0, 0, 0, 82, }, /* 1084 */ - { 62, 7, 12, 0, 0, 0, 294, }, /* 1085 */ - { 62, 12, 3, 0, 0, 26624, 128, }, /* 1086 */ - { 62, 13, 12, 0, 0, 2048, 138, }, /* 1087 */ - { 3, 15, 12, 0, 0, 2048, 68, }, /* 1088 */ - { 65, 7, 12, 0, 0, 34816, 82, }, /* 1089 */ - { 65, 12, 3, 0, 0, 26624, 130, }, /* 1090 */ - { 65, 17, 12, 0, 0, 34816, 126, }, /* 1091 */ - { 152, 7, 12, 0, 0, 34816, 82, }, /* 1092 */ - { 152, 15, 12, 0, 0, 34816, 68, }, /* 1093 */ - { 63, 7, 12, 0, 0, 0, 82, }, /* 1094 */ - { 63, 12, 3, 0, 0, 26624, 96, }, /* 1095 */ - { 63, 15, 12, 0, 0, 0, 68, }, /* 1096 */ - { 63, 21, 12, 0, 0, 0, 124, }, /* 1097 */ - { 67, 7, 12, 0, 0, 34816, 82, }, /* 1098 */ - { 67, 12, 3, 0, 0, 26624, 96, }, /* 1099 */ - { 67, 21, 12, 0, 0, 34816, 124, }, /* 1100 */ - { 156, 7, 12, 0, 0, 34816, 82, }, /* 1101 */ - { 156, 15, 12, 0, 0, 34816, 68, }, /* 1102 */ - { 153, 7, 12, 0, 0, 34816, 82, }, /* 1103 */ - { 120, 10, 5, 0, 0, 18432, 144, }, /* 1104 */ - { 120, 12, 3, 0, 0, 26624, 130, }, /* 1105 */ - { 120, 7, 12, 0, 0, 18432, 82, }, /* 1106 */ - { 120, 12, 3, 0, 0, 26624, 146, }, /* 1107 */ - { 120, 21, 12, 0, 0, 18432, 124, }, /* 1108 */ - { 120, 21, 12, 0, 0, 18432, 106, }, /* 1109 */ - { 120, 15, 12, 0, 0, 28672, 68, }, /* 1110 */ - { 120, 13, 12, 0, 0, 18432, 138, }, /* 1111 */ - { 120, 12, 3, 0, 0, 26624, 184, }, /* 1112 */ - { 41, 12, 3, 0, 0, 26624, 130, }, /* 1113 */ - { 41, 10, 5, 0, 0, 18432, 144, }, /* 1114 */ - { 41, 7, 12, 0, 0, 18432, 82, }, /* 1115 */ - { 41, 12, 3, 0, 0, 26624, 146, }, /* 1116 */ - { 41, 12, 3, 0, 0, 26624, 96, }, /* 1117 */ - { 41, 21, 12, 0, 0, 18432, 68, }, /* 1118 */ - { 41, 1, 4, 0, 0, 18432, 132, }, /* 1119 */ - { 41, 21, 12, 0, 0, 18432, 124, }, /* 1120 */ - { 124, 7, 12, 0, 0, 18432, 82, }, /* 1121 */ - { 124, 13, 12, 0, 0, 18432, 138, }, /* 1122 */ - { 43, 12, 3, 0, 0, 26624, 130, }, /* 1123 */ - { 43, 7, 12, 0, 0, 18432, 82, }, /* 1124 */ - { 43, 10, 5, 0, 0, 18432, 144, }, /* 1125 */ - { 43, 12, 3, 0, 0, 26624, 146, }, /* 1126 */ - { 43, 13, 12, 0, 0, 18432, 138, }, /* 1127 */ - { 43, 21, 12, 0, 0, 18432, 68, }, /* 1128 */ - { 43, 21, 12, 0, 0, 18432, 124, }, /* 1129 */ - { 50, 7, 12, 0, 0, 18432, 82, }, /* 1130 */ - { 50, 12, 3, 0, 0, 26624, 96, }, /* 1131 */ - { 50, 21, 12, 0, 0, 18432, 68, }, /* 1132 */ - { 44, 12, 3, 0, 0, 26624, 130, }, /* 1133 */ - { 44, 10, 5, 0, 0, 18432, 144, }, /* 1134 */ - { 44, 7, 12, 0, 0, 18432, 82, }, /* 1135 */ - { 44, 10, 5, 0, 0, 18432, 174, }, /* 1136 */ - { 44, 7, 4, 0, 0, 18432, 82, }, /* 1137 */ - { 44, 21, 12, 0, 0, 18432, 124, }, /* 1138 */ - { 44, 21, 12, 0, 0, 18432, 68, }, /* 1139 */ - { 44, 12, 3, 0, 0, 26624, 102, }, /* 1140 */ - { 44, 12, 3, 0, 0, 26624, 96, }, /* 1141 */ - { 44, 13, 12, 0, 0, 18432, 138, }, /* 1142 */ - { 15, 15, 12, 0, 0, 18432, 68, }, /* 1143 */ - { 48, 7, 12, 0, 0, 18432, 82, }, /* 1144 */ - { 48, 10, 5, 0, 0, 18432, 144, }, /* 1145 */ - { 48, 12, 3, 0, 0, 26624, 130, }, /* 1146 */ - { 48, 10, 5, 0, 0, 18432, 174, }, /* 1147 */ - { 48, 12, 3, 0, 0, 26624, 96, }, /* 1148 */ - { 48, 21, 12, 0, 0, 18432, 124, }, /* 1149 */ - { 48, 21, 12, 0, 0, 18432, 106, }, /* 1150 */ - { 48, 21, 12, 0, 0, 18432, 68, }, /* 1151 */ - { 57, 7, 12, 0, 0, 18432, 82, }, /* 1152 */ - { 57, 21, 12, 0, 0, 18432, 124, }, /* 1153 */ - { 55, 7, 12, 0, 0, 18432, 82, }, /* 1154 */ - { 55, 12, 3, 0, 0, 26624, 130, }, /* 1155 */ - { 55, 10, 5, 0, 0, 18432, 144, }, /* 1156 */ - { 55, 12, 3, 0, 0, 26624, 96, }, /* 1157 */ - { 55, 12, 3, 0, 0, 26624, 146, }, /* 1158 */ - { 55, 13, 12, 0, 0, 18432, 138, }, /* 1159 */ - { 47, 12, 3, 0, 0, 26624, 130, }, /* 1160 */ - { 47, 12, 3, 0, 0, 26705, 130, }, /* 1161 */ - { 47, 10, 5, 0, 0, 18432, 144, }, /* 1162 */ - { 47, 10, 5, 0, 0, 18513, 144, }, /* 1163 */ - { 47, 7, 12, 0, 0, 18432, 82, }, /* 1164 */ - { 84, 12, 3, 0, 0, 26705, 102, }, /* 1165 */ - { 47, 12, 3, 0, 0, 26705, 96, }, /* 1166 */ - { 47, 10, 3, 0, 0, 18432, 148, }, /* 1167 */ - { 47, 10, 5, 0, 0, 18432, 174, }, /* 1168 */ - { 47, 7, 12, 0, 0, 18432, 324, }, /* 1169 */ - { 47, 12, 3, 0, 0, 26624, 96, }, /* 1170 */ - { 144, 7, 12, 0, 0, 18432, 82, }, /* 1171 */ - { 144, 10, 5, 0, 0, 18432, 144, }, /* 1172 */ - { 144, 12, 3, 0, 0, 26624, 130, }, /* 1173 */ - { 144, 12, 3, 0, 0, 26624, 146, }, /* 1174 */ - { 144, 12, 3, 0, 0, 26624, 96, }, /* 1175 */ - { 144, 21, 12, 0, 0, 18432, 124, }, /* 1176 */ - { 144, 21, 12, 0, 0, 18432, 106, }, /* 1177 */ - { 144, 21, 12, 0, 0, 18432, 68, }, /* 1178 */ - { 144, 13, 12, 0, 0, 18432, 138, }, /* 1179 */ - { 144, 12, 3, 0, 0, 26624, 102, }, /* 1180 */ - { 56, 7, 12, 0, 0, 18432, 82, }, /* 1181 */ - { 56, 10, 3, 0, 0, 18432, 148, }, /* 1182 */ - { 56, 10, 5, 0, 0, 18432, 144, }, /* 1183 */ - { 56, 12, 3, 0, 0, 26624, 130, }, /* 1184 */ - { 56, 12, 3, 0, 0, 26624, 146, }, /* 1185 */ - { 56, 12, 3, 0, 0, 26624, 96, }, /* 1186 */ - { 56, 21, 12, 0, 0, 18432, 68, }, /* 1187 */ - { 56, 13, 12, 0, 0, 18432, 138, }, /* 1188 */ - { 135, 7, 12, 0, 0, 18432, 82, }, /* 1189 */ - { 135, 10, 3, 0, 0, 18432, 148, }, /* 1190 */ - { 135, 10, 5, 0, 0, 18432, 144, }, /* 1191 */ - { 135, 12, 3, 0, 0, 26624, 130, }, /* 1192 */ - { 135, 12, 3, 0, 0, 26624, 146, }, /* 1193 */ - { 135, 12, 3, 0, 0, 26624, 96, }, /* 1194 */ - { 135, 21, 12, 0, 0, 18432, 68, }, /* 1195 */ - { 135, 21, 12, 0, 0, 18432, 124, }, /* 1196 */ - { 135, 21, 12, 0, 0, 18432, 106, }, /* 1197 */ - { 135, 21, 12, 0, 0, 18432, 178, }, /* 1198 */ - { 52, 7, 12, 0, 0, 18432, 82, }, /* 1199 */ - { 52, 10, 5, 0, 0, 18432, 144, }, /* 1200 */ - { 52, 12, 3, 0, 0, 26624, 130, }, /* 1201 */ - { 52, 12, 3, 0, 0, 26624, 146, }, /* 1202 */ - { 52, 21, 12, 0, 0, 18432, 124, }, /* 1203 */ - { 52, 21, 12, 0, 0, 18432, 68, }, /* 1204 */ - { 52, 13, 12, 0, 0, 18432, 138, }, /* 1205 */ - { 45, 7, 12, 0, 0, 18432, 82, }, /* 1206 */ - { 45, 12, 3, 0, 0, 26624, 130, }, /* 1207 */ - { 45, 10, 5, 0, 0, 18432, 144, }, /* 1208 */ - { 45, 10, 5, 0, 0, 18432, 174, }, /* 1209 */ - { 45, 12, 3, 0, 0, 26624, 96, }, /* 1210 */ - { 45, 21, 12, 0, 0, 18432, 68, }, /* 1211 */ - { 45, 13, 12, 0, 0, 18432, 138, }, /* 1212 */ - { 137, 7, 12, 0, 0, 18432, 82, }, /* 1213 */ - { 137, 12, 3, 0, 0, 26624, 130, }, /* 1214 */ - { 137, 10, 12, 0, 0, 18432, 144, }, /* 1215 */ - { 137, 10, 5, 0, 0, 18432, 144, }, /* 1216 */ - { 137, 12, 3, 0, 0, 26624, 146, }, /* 1217 */ - { 137, 13, 12, 0, 0, 18432, 138, }, /* 1218 */ - { 137, 15, 12, 0, 0, 18432, 68, }, /* 1219 */ - { 137, 21, 12, 0, 0, 18432, 124, }, /* 1220 */ - { 137, 26, 12, 0, 0, 18432, 68, }, /* 1221 */ - { 60, 7, 12, 0, 0, 18432, 82, }, /* 1222 */ - { 60, 10, 5, 0, 0, 18432, 144, }, /* 1223 */ - { 60, 12, 3, 0, 0, 26624, 130, }, /* 1224 */ - { 60, 12, 3, 0, 0, 26624, 146, }, /* 1225 */ - { 60, 12, 3, 0, 0, 26624, 96, }, /* 1226 */ - { 60, 21, 12, 0, 0, 18432, 68, }, /* 1227 */ - { 136, 9, 12, 0, 32, 18432, 74, }, /* 1228 */ - { 136, 5, 12, 0, -32, 18432, 76, }, /* 1229 */ - { 136, 13, 12, 0, 0, 18432, 138, }, /* 1230 */ - { 136, 15, 12, 0, 0, 18432, 68, }, /* 1231 */ - { 136, 7, 12, 0, 0, 18432, 82, }, /* 1232 */ - { 157, 7, 12, 0, 0, 18432, 82, }, /* 1233 */ - { 157, 10, 3, 0, 0, 18432, 148, }, /* 1234 */ - { 157, 10, 5, 0, 0, 18432, 144, }, /* 1235 */ - { 157, 12, 3, 0, 0, 26624, 130, }, /* 1236 */ - { 157, 10, 5, 0, 0, 18432, 174, }, /* 1237 */ - { 157, 12, 3, 0, 0, 26624, 146, }, /* 1238 */ - { 157, 7, 4, 0, 0, 18432, 82, }, /* 1239 */ - { 157, 12, 3, 0, 0, 26624, 96, }, /* 1240 */ - { 157, 21, 12, 0, 0, 18432, 124, }, /* 1241 */ - { 157, 21, 12, 0, 0, 18432, 68, }, /* 1242 */ - { 157, 13, 12, 0, 0, 18432, 138, }, /* 1243 */ - { 64, 7, 12, 0, 0, 18432, 82, }, /* 1244 */ - { 64, 10, 5, 0, 0, 18432, 144, }, /* 1245 */ - { 64, 12, 3, 0, 0, 26624, 130, }, /* 1246 */ - { 64, 12, 3, 0, 0, 26624, 146, }, /* 1247 */ - { 64, 21, 12, 0, 0, 18432, 68, }, /* 1248 */ - { 149, 7, 12, 0, 0, 18432, 82, }, /* 1249 */ - { 149, 12, 3, 0, 0, 26624, 130, }, /* 1250 */ - { 149, 12, 3, 0, 0, 18432, 130, }, /* 1251 */ - { 149, 12, 3, 0, 0, 26624, 102, }, /* 1252 */ - { 149, 12, 3, 0, 0, 26624, 146, }, /* 1253 */ - { 149, 10, 5, 0, 0, 18432, 144, }, /* 1254 */ - { 149, 7, 4, 0, 0, 18432, 82, }, /* 1255 */ - { 149, 21, 12, 0, 0, 18432, 68, }, /* 1256 */ - { 149, 21, 12, 0, 0, 18432, 124, }, /* 1257 */ - { 148, 7, 12, 0, 0, 18432, 82, }, /* 1258 */ - { 148, 12, 3, 0, 0, 26624, 130, }, /* 1259 */ - { 148, 10, 5, 0, 0, 18432, 144, }, /* 1260 */ - { 148, 7, 4, 0, 0, 18432, 82, }, /* 1261 */ - { 148, 12, 3, 0, 0, 26624, 326, }, /* 1262 */ - { 148, 12, 3, 0, 0, 26624, 146, }, /* 1263 */ - { 148, 21, 12, 0, 0, 18432, 68, }, /* 1264 */ - { 148, 21, 12, 0, 0, 18432, 124, }, /* 1265 */ - { 148, 21, 12, 0, 0, 18432, 106, }, /* 1266 */ - { 134, 7, 12, 0, 0, 18432, 82, }, /* 1267 */ - { 142, 7, 12, 0, 0, 18432, 82, }, /* 1268 */ - { 142, 10, 5, 0, 0, 18432, 144, }, /* 1269 */ - { 142, 12, 3, 0, 0, 26624, 130, }, /* 1270 */ - { 142, 12, 3, 0, 0, 18432, 146, }, /* 1271 */ - { 142, 21, 12, 0, 0, 18432, 124, }, /* 1272 */ - { 142, 21, 12, 0, 0, 18432, 106, }, /* 1273 */ - { 142, 21, 12, 0, 0, 18432, 68, }, /* 1274 */ - { 142, 13, 12, 0, 0, 18432, 138, }, /* 1275 */ - { 142, 15, 12, 0, 0, 18432, 68, }, /* 1276 */ - { 143, 21, 12, 0, 0, 18432, 68, }, /* 1277 */ - { 143, 21, 12, 0, 0, 18432, 106, }, /* 1278 */ - { 143, 7, 12, 0, 0, 18432, 82, }, /* 1279 */ - { 143, 12, 3, 0, 0, 26624, 130, }, /* 1280 */ - { 143, 10, 5, 0, 0, 18432, 144, }, /* 1281 */ - { 59, 7, 12, 0, 0, 18432, 82, }, /* 1282 */ - { 59, 12, 3, 0, 0, 26624, 130, }, /* 1283 */ - { 59, 12, 3, 0, 0, 26624, 96, }, /* 1284 */ - { 59, 12, 3, 0, 0, 26624, 146, }, /* 1285 */ - { 59, 7, 4, 0, 0, 18432, 82, }, /* 1286 */ - { 59, 13, 12, 0, 0, 18432, 138, }, /* 1287 */ - { 61, 7, 12, 0, 0, 18432, 82, }, /* 1288 */ - { 61, 10, 5, 0, 0, 18432, 144, }, /* 1289 */ - { 61, 12, 3, 0, 0, 26624, 130, }, /* 1290 */ - { 61, 12, 3, 0, 0, 26624, 146, }, /* 1291 */ - { 61, 13, 12, 0, 0, 18432, 138, }, /* 1292 */ - { 150, 7, 12, 0, 0, 18432, 82, }, /* 1293 */ - { 150, 12, 3, 0, 0, 26624, 130, }, /* 1294 */ - { 150, 10, 5, 0, 0, 18432, 144, }, /* 1295 */ - { 150, 21, 12, 0, 0, 18432, 124, }, /* 1296 */ - { 162, 12, 3, 0, 0, 26624, 130, }, /* 1297 */ - { 162, 7, 4, 0, 0, 18432, 82, }, /* 1298 */ - { 162, 10, 5, 0, 0, 18432, 144, }, /* 1299 */ - { 162, 7, 12, 0, 0, 18432, 82, }, /* 1300 */ - { 162, 10, 5, 0, 0, 18432, 176, }, /* 1301 */ - { 162, 12, 3, 0, 0, 26624, 184, }, /* 1302 */ - { 162, 21, 12, 0, 0, 18432, 124, }, /* 1303 */ - { 162, 21, 12, 0, 0, 18432, 68, }, /* 1304 */ - { 162, 13, 12, 0, 0, 18432, 138, }, /* 1305 */ - { 11, 15, 12, 0, 0, 18432, 68, }, /* 1306 */ - { 11, 21, 12, 0, 0, 18432, 68, }, /* 1307 */ - { 94, 7, 12, 0, 0, 18432, 82, }, /* 1308 */ - { 94, 14, 12, 0, 0, 18432, 82, }, /* 1309 */ - { 94, 21, 12, 0, 0, 18432, 106, }, /* 1310 */ - { 66, 7, 12, 0, 0, 18432, 82, }, /* 1311 */ - { 66, 21, 12, 0, 0, 18432, 68, }, /* 1312 */ - { 109, 7, 12, 0, 0, 18432, 82, }, /* 1313 */ - { 109, 1, 2, 0, 0, 18432, 322, }, /* 1314 */ - { 109, 12, 3, 0, 0, 26624, 102, }, /* 1315 */ - { 109, 12, 3, 0, 0, 26624, 96, }, /* 1316 */ - { 138, 7, 12, 0, 0, 18432, 82, }, /* 1317 */ - { 130, 7, 12, 0, 0, 18432, 82, }, /* 1318 */ - { 130, 13, 12, 0, 0, 18432, 138, }, /* 1319 */ - { 130, 21, 12, 0, 0, 18432, 124, }, /* 1320 */ - { 159, 7, 12, 0, 0, 18432, 82, }, /* 1321 */ - { 159, 13, 12, 0, 0, 18432, 138, }, /* 1322 */ - { 126, 7, 12, 0, 0, 18432, 82, }, /* 1323 */ - { 126, 12, 3, 0, 0, 26624, 96, }, /* 1324 */ - { 126, 21, 12, 0, 0, 18432, 124, }, /* 1325 */ - { 128, 7, 12, 0, 0, 18432, 82, }, /* 1326 */ - { 128, 12, 3, 0, 0, 26624, 96, }, /* 1327 */ - { 128, 21, 12, 0, 0, 18432, 124, }, /* 1328 */ - { 128, 21, 12, 0, 0, 18432, 106, }, /* 1329 */ - { 128, 21, 12, 0, 0, 18432, 68, }, /* 1330 */ - { 128, 26, 12, 0, 0, 18432, 68, }, /* 1331 */ - { 128, 6, 12, 0, 0, 18432, 142, }, /* 1332 */ - { 128, 6, 12, 0, 0, 18432, 136, }, /* 1333 */ - { 128, 13, 12, 0, 0, 18432, 138, }, /* 1334 */ - { 128, 15, 12, 0, 0, 18432, 68, }, /* 1335 */ - { 151, 9, 12, 0, 32, 18432, 74, }, /* 1336 */ - { 151, 5, 12, 0, -32, 18432, 76, }, /* 1337 */ - { 151, 15, 12, 0, 0, 18432, 68, }, /* 1338 */ - { 151, 21, 12, 0, 0, 18432, 106, }, /* 1339 */ - { 151, 21, 12, 0, 0, 18432, 124, }, /* 1340 */ - { 151, 21, 12, 0, 0, 18432, 68, }, /* 1341 */ - { 123, 7, 12, 0, 0, 18432, 82, }, /* 1342 */ - { 123, 12, 3, 0, 0, 26624, 130, }, /* 1343 */ - { 123, 10, 5, 0, 0, 18432, 144, }, /* 1344 */ - { 123, 12, 3, 0, 0, 26624, 128, }, /* 1345 */ - { 123, 6, 12, 0, 0, 18432, 92, }, /* 1346 */ - { 146, 6, 12, 0, 0, 18432, 136, }, /* 1347 */ - { 147, 6, 12, 0, 0, 18432, 136, }, /* 1348 */ - { 23, 21, 12, 0, 0, 28672, 68, }, /* 1349 */ - { 158, 12, 3, 0, 0, 26624, 328, }, /* 1350 */ - { 23, 10, 5, 0, 0, 18432, 164, }, /* 1351 */ - { 146, 7, 12, 0, 0, 18432, 284, }, /* 1352 */ - { 158, 7, 12, 0, 0, 18432, 284, }, /* 1353 */ - { 21, 6, 12, 0, 0, 18432, 92, }, /* 1354 */ - { 147, 7, 12, 0, 0, 18432, 284, }, /* 1355 */ - { 46, 7, 12, 0, 0, 18432, 82, }, /* 1356 */ - { 46, 26, 12, 0, 0, 18432, 68, }, /* 1357 */ - { 46, 12, 3, 0, 0, 26624, 102, }, /* 1358 */ - { 46, 12, 3, 0, 0, 26624, 130, }, /* 1359 */ - { 46, 21, 12, 0, 0, 18432, 124, }, /* 1360 */ - { 69, 1, 2, 0, 0, 6153, 66, }, /* 1361 */ - { 69, 10, 3, 0, 0, 18432, 330, }, /* 1362 */ - { 69, 10, 5, 0, 0, 18432, 138, }, /* 1363 */ - { 69, 10, 5, 0, 0, 18432, 160, }, /* 1364 */ - { 69, 10, 3, 0, 0, 18432, 286, }, /* 1365 */ - { 1, 12, 3, 0, 0, 26624, 102, }, /* 1366 */ - { 69, 25, 12, 0, 0, 18432, 118, }, /* 1367 */ - { 69, 13, 12, 0, 0, 10240, 214, }, /* 1368 */ - { 141, 26, 12, 0, 0, 18432, 68, }, /* 1369 */ - { 141, 12, 3, 0, 0, 26624, 102, }, /* 1370 */ - { 141, 21, 12, 0, 0, 18432, 106, }, /* 1371 */ - { 141, 21, 12, 0, 0, 18432, 124, }, /* 1372 */ - { 141, 21, 12, 0, 0, 18432, 68, }, /* 1373 */ - { 35, 12, 3, 0, 0, 26624, 130, }, /* 1374 */ - { 2, 6, 12, 0, 0, 18432, 90, }, /* 1375 */ - { 154, 7, 12, 0, 0, 18432, 82, }, /* 1376 */ - { 154, 12, 3, 0, 0, 26624, 96, }, /* 1377 */ - { 154, 6, 12, 0, 0, 18432, 142, }, /* 1378 */ - { 154, 6, 12, 0, 0, 18432, 136, }, /* 1379 */ - { 154, 13, 12, 0, 0, 18432, 138, }, /* 1380 */ - { 154, 26, 12, 0, 0, 18432, 68, }, /* 1381 */ - { 160, 7, 12, 0, 0, 18432, 82, }, /* 1382 */ - { 160, 12, 3, 0, 0, 26624, 96, }, /* 1383 */ - { 155, 7, 12, 0, 0, 18432, 82, }, /* 1384 */ - { 155, 12, 3, 0, 0, 26624, 96, }, /* 1385 */ - { 155, 13, 12, 0, 0, 18432, 138, }, /* 1386 */ - { 155, 23, 12, 0, 0, 14336, 68, }, /* 1387 */ - { 163, 7, 12, 0, 0, 18432, 82, }, /* 1388 */ - { 163, 6, 12, 0, 0, 18432, 142, }, /* 1389 */ - { 163, 12, 3, 0, 0, 26624, 102, }, /* 1390 */ - { 163, 13, 12, 0, 0, 18432, 138, }, /* 1391 */ - { 129, 7, 12, 0, 0, 34816, 82, }, /* 1392 */ - { 129, 15, 12, 0, 0, 34816, 68, }, /* 1393 */ - { 129, 12, 3, 0, 0, 26624, 96, }, /* 1394 */ - { 58, 9, 12, 0, 34, 34816, 74, }, /* 1395 */ - { 58, 5, 12, 0, -34, 34816, 76, }, /* 1396 */ - { 58, 12, 3, 0, 0, 26624, 150, }, /* 1397 */ - { 58, 12, 3, 0, 0, 26624, 130, }, /* 1398 */ - { 58, 12, 3, 0, 0, 26624, 96, }, /* 1399 */ - { 58, 6, 12, 0, 0, 34816, 142, }, /* 1400 */ - { 58, 13, 12, 0, 0, 34816, 138, }, /* 1401 */ - { 58, 21, 12, 0, 0, 34816, 68, }, /* 1402 */ - { 69, 15, 12, 0, 0, 0, 68, }, /* 1403 */ - { 69, 26, 12, 0, 0, 0, 68, }, /* 1404 */ - { 69, 23, 12, 0, 0, 0, 68, }, /* 1405 */ - { 3, 7, 12, 0, 0, 0, 240, }, /* 1406 */ - { 69, 26, 14, 0, 0, 28672, 332, }, /* 1407 */ - { 69, 26, 14, 0, 0, 28672, 334, }, /* 1408 */ - { 68, 2, 14, 0, 0, 18432, 336, }, /* 1409 */ - { 69, 26, 12, 0, 0, 18432, 338, }, /* 1410 */ - { 69, 26, 14, 0, 0, 18432, 340, }, /* 1411 */ - { 69, 26, 14, 0, 0, 18432, 334, }, /* 1412 */ - { 69, 26, 11, 0, 0, 18432, 342, }, /* 1413 */ - { 20, 26, 12, 0, 0, 18432, 68, }, /* 1414 */ - { 69, 26, 14, 0, 0, 18432, 236, }, /* 1415 */ - { 69, 26, 14, 0, 0, 18447, 334, }, /* 1416 */ - { 69, 26, 14, 0, 0, 28672, 344, }, /* 1417 */ - { 69, 26, 14, 0, 0, 28672, 346, }, /* 1418 */ - { 69, 24, 3, 0, 0, 28672, 348, }, /* 1419 */ - { 69, 26, 14, 0, 0, 28672, 350, }, /* 1420 */ - { 69, 13, 12, 0, 0, 10240, 138, }, /* 1421 */ - { 69, 1, 3, 0, 0, 6144, 352, }, /* 1422 */ + { 0, 5, 12, 0, 195, 18432, 78, }, /* 74 */ + { 0, 9, 12, 0, 210, 18432, 76, }, /* 75 */ + { 0, 9, 12, 0, 206, 18432, 76, }, /* 76 */ + { 0, 9, 12, 0, 205, 18432, 76, }, /* 77 */ + { 0, 9, 12, 0, 79, 18432, 76, }, /* 78 */ + { 0, 9, 12, 0, 202, 18432, 76, }, /* 79 */ + { 0, 9, 12, 0, 203, 18432, 76, }, /* 80 */ + { 0, 9, 12, 0, 207, 18432, 76, }, /* 81 */ + { 0, 5, 12, 0, 97, 18432, 78, }, /* 82 */ + { 0, 9, 12, 0, 211, 18432, 76, }, /* 83 */ + { 0, 9, 12, 0, 209, 18432, 76, }, /* 84 */ + { 0, 5, 12, 0, 163, 18432, 78, }, /* 85 */ + { 0, 5, 12, 0, 42561, 18432, 78, }, /* 86 */ + { 0, 9, 12, 0, 213, 18432, 76, }, /* 87 */ + { 0, 5, 12, 0, 130, 18432, 78, }, /* 88 */ + { 0, 9, 12, 0, 214, 18432, 76, }, /* 89 */ + { 0, 9, 12, 0, 218, 18432, 76, }, /* 90 */ + { 0, 9, 12, 0, 217, 18432, 76, }, /* 91 */ + { 0, 9, 12, 0, 219, 18432, 76, }, /* 92 */ + { 0, 7, 12, 0, 0, 18432, 84, }, /* 93 */ + { 0, 5, 12, 0, 56, 18432, 78, }, /* 94 */ + { 0, 9, 12, 5, 2, 18432, 86, }, /* 95 */ + { 0, 8, 12, 5, 1, 18432, 88, }, /* 96 */ + { 0, 5, 12, 5, -2, 18432, 78, }, /* 97 */ + { 0, 9, 12, 9, 2, 18432, 86, }, /* 98 */ + { 0, 8, 12, 9, 1, 18432, 88, }, /* 99 */ + { 0, 5, 12, 9, -2, 18432, 78, }, /* 100 */ + { 0, 9, 12, 13, 2, 18432, 86, }, /* 101 */ + { 0, 8, 12, 13, 1, 18432, 88, }, /* 102 */ + { 0, 5, 12, 13, -2, 18432, 78, }, /* 103 */ + { 0, 5, 12, 0, -79, 18432, 78, }, /* 104 */ + { 0, 9, 12, 17, 2, 18432, 86, }, /* 105 */ + { 0, 8, 12, 17, 1, 18432, 88, }, /* 106 */ + { 0, 5, 12, 17, -2, 18432, 78, }, /* 107 */ + { 0, 9, 12, 0, -97, 18432, 76, }, /* 108 */ + { 0, 9, 12, 0, -56, 18432, 76, }, /* 109 */ + { 0, 9, 12, 0, -130, 18432, 76, }, /* 110 */ + { 0, 9, 12, 0, 10795, 18432, 76, }, /* 111 */ + { 0, 9, 12, 0, -163, 18432, 76, }, /* 112 */ + { 0, 9, 12, 0, 10792, 18432, 76, }, /* 113 */ + { 0, 5, 12, 0, 10815, 18432, 78, }, /* 114 */ + { 0, 9, 12, 0, -195, 18432, 76, }, /* 115 */ + { 0, 9, 12, 0, 69, 18432, 76, }, /* 116 */ + { 0, 9, 12, 0, 71, 18432, 76, }, /* 117 */ + { 0, 5, 12, 0, 10783, 18432, 78, }, /* 118 */ + { 0, 5, 12, 0, 10780, 18432, 78, }, /* 119 */ + { 0, 5, 12, 0, 10782, 18432, 78, }, /* 120 */ + { 0, 5, 12, 0, -210, 18432, 78, }, /* 121 */ + { 0, 5, 12, 0, -206, 18432, 78, }, /* 122 */ + { 0, 5, 12, 0, -205, 18432, 78, }, /* 123 */ + { 0, 5, 12, 0, -202, 18432, 78, }, /* 124 */ + { 0, 5, 12, 0, -203, 18432, 78, }, /* 125 */ + { 0, 5, 12, 0, 42319, 18432, 78, }, /* 126 */ + { 0, 5, 12, 0, 42315, 18432, 78, }, /* 127 */ + { 0, 5, 12, 0, -207, 18432, 78, }, /* 128 */ + { 0, 5, 12, 0, 42343, 18432, 78, }, /* 129 */ + { 0, 5, 12, 0, 42280, 18432, 78, }, /* 130 */ + { 0, 5, 12, 0, 42308, 18432, 78, }, /* 131 */ + { 0, 5, 12, 0, -209, 18432, 80, }, /* 132 */ + { 0, 5, 12, 0, -211, 18432, 78, }, /* 133 */ + { 0, 5, 12, 0, 10743, 18432, 78, }, /* 134 */ + { 0, 5, 12, 0, 42305, 18432, 78, }, /* 135 */ + { 0, 5, 12, 0, 10749, 18432, 78, }, /* 136 */ + { 0, 5, 12, 0, -213, 18432, 78, }, /* 137 */ + { 0, 5, 12, 0, -214, 18432, 78, }, /* 138 */ + { 0, 5, 12, 0, 10727, 18432, 78, }, /* 139 */ + { 0, 5, 12, 0, -218, 18432, 78, }, /* 140 */ + { 0, 5, 12, 0, 42307, 18432, 78, }, /* 141 */ + { 0, 5, 12, 0, 42282, 18432, 78, }, /* 142 */ + { 0, 5, 12, 0, -69, 18432, 78, }, /* 143 */ + { 0, 5, 12, 0, -217, 18432, 78, }, /* 144 */ + { 0, 5, 12, 0, -71, 18432, 78, }, /* 145 */ + { 0, 5, 12, 0, -219, 18432, 78, }, /* 146 */ + { 0, 5, 12, 0, 42261, 18432, 80, }, /* 147 */ + { 0, 5, 12, 0, 42258, 18432, 78, }, /* 148 */ + { 0, 6, 12, 0, 0, 18432, 90, }, /* 149 */ + { 0, 6, 12, 0, 0, 18432, 92, }, /* 150 */ + { 100, 6, 12, 0, 0, 28672, 94, }, /* 151 */ + { 100, 6, 12, 0, 0, 18432, 94, }, /* 152 */ + { 100, 6, 12, 0, 0, 18440, 94, }, /* 153 */ + { 100, 6, 12, 0, 0, 18432, 90, }, /* 154 */ + { 100, 6, 12, 0, 0, 28684, 94, }, /* 155 */ + { 100, 6, 12, 0, 0, 28688, 94, }, /* 156 */ + { 100, 6, 12, 0, 0, 18432, 96, }, /* 157 */ + { 100, 24, 12, 0, 0, 28692, 56, }, /* 158 */ + { 100, 24, 12, 0, 0, 28684, 56, }, /* 159 */ + { 29, 24, 12, 0, 0, 28672, 56, }, /* 160 */ + { 107, 12, 3, 0, 0, 26648, 98, }, /* 161 */ + { 107, 12, 3, 0, 0, 26652, 98, }, /* 162 */ + { 107, 12, 3, 0, 0, 26656, 98, }, /* 163 */ + { 107, 12, 3, 0, 0, 26660, 98, }, /* 164 */ + { 107, 12, 3, 0, 0, 26664, 98, }, /* 165 */ + { 107, 12, 3, 0, 0, 26668, 98, }, /* 166 */ + { 107, 12, 3, 0, 0, 26672, 98, }, /* 167 */ + { 107, 12, 3, 0, 0, 26676, 98, }, /* 168 */ + { 107, 12, 3, 0, 0, 26680, 98, }, /* 169 */ + { 107, 12, 3, 0, 0, 26684, 98, }, /* 170 */ + { 107, 12, 3, 0, 0, 26688, 98, }, /* 171 */ + { 107, 12, 3, 0, 0, 26692, 98, }, /* 172 */ + { 107, 12, 3, 0, 0, 26696, 98, }, /* 173 */ + { 107, 12, 3, 0, 0, 26700, 98, }, /* 174 */ + { 107, 12, 3, 0, 0, 26704, 98, }, /* 175 */ + { 107, 12, 3, 0, 0, 26624, 98, }, /* 176 */ + { 107, 12, 3, 0, 0, 26708, 98, }, /* 177 */ + { 107, 12, 3, 0, 0, 26712, 98, }, /* 178 */ + { 107, 12, 3, 0, 0, 26716, 98, }, /* 179 */ + { 107, 12, 3, 0, 0, 26720, 98, }, /* 180 */ + { 107, 12, 3, 0, 0, 26724, 98, }, /* 181 */ + { 107, 12, 3, 0, 0, 26728, 98, }, /* 182 */ + { 107, 12, 3, 0, 0, 26732, 98, }, /* 183 */ + { 107, 12, 3, 0, 0, 26736, 98, }, /* 184 */ + { 107, 12, 3, 0, 0, 26740, 98, }, /* 185 */ + { 107, 12, 3, 21, 116, 26740, 100, }, /* 186 */ + { 107, 12, 3, 0, 0, 26624, 102, }, /* 187 */ + { 107, 12, 3, 0, 0, 26744, 104, }, /* 188 */ + { 107, 12, 3, 0, 0, 26624, 104, }, /* 189 */ + { 107, 12, 3, 0, 0, 26748, 98, }, /* 190 */ + { 107, 12, 3, 0, 0, 26752, 106, }, /* 191 */ + { 1, 9, 12, 0, 1, 18432, 76, }, /* 192 */ + { 1, 5, 12, 0, -1, 18432, 78, }, /* 193 */ + { 100, 6, 12, 0, 0, 28804, 94, }, /* 194 */ + { 1, 24, 12, 0, 0, 28804, 56, }, /* 195 */ + { 99, 2, 12, 0, 0, 18432, 0, }, /* 196 */ + { 1, 6, 12, 0, 0, 18432, 108, }, /* 197 */ + { 1, 5, 12, 0, 130, 18432, 78, }, /* 198 */ + { 100, 21, 12, 0, 0, 28672, 110, }, /* 199 */ + { 1, 9, 12, 0, 116, 18432, 76, }, /* 200 */ + { 1, 24, 12, 0, 0, 28672, 56, }, /* 201 */ + { 1, 9, 12, 0, 38, 18432, 76, }, /* 202 */ + { 100, 21, 12, 0, 0, 28672, 112, }, /* 203 */ + { 1, 9, 12, 0, 37, 18432, 76, }, /* 204 */ + { 1, 9, 12, 0, 64, 18432, 76, }, /* 205 */ + { 1, 9, 12, 0, 63, 18432, 76, }, /* 206 */ + { 1, 5, 12, 0, 7235, 18432, 78, }, /* 207 */ + { 1, 9, 12, 0, 32, 18432, 76, }, /* 208 */ + { 1, 9, 12, 34, 32, 18432, 76, }, /* 209 */ + { 1, 9, 12, 59, 32, 18432, 76, }, /* 210 */ + { 1, 9, 12, 38, 32, 18432, 76, }, /* 211 */ + { 1, 9, 12, 21, 32, 18432, 76, }, /* 212 */ + { 1, 9, 12, 51, 32, 18432, 76, }, /* 213 */ + { 1, 9, 12, 26, 32, 18432, 76, }, /* 214 */ + { 1, 9, 12, 47, 32, 18432, 76, }, /* 215 */ + { 1, 9, 12, 55, 32, 18432, 76, }, /* 216 */ + { 1, 9, 12, 30, 32, 18432, 76, }, /* 217 */ + { 1, 9, 12, 43, 32, 18432, 76, }, /* 218 */ + { 1, 9, 12, 96, 32, 18432, 76, }, /* 219 */ + { 1, 5, 12, 0, -38, 18432, 78, }, /* 220 */ + { 1, 5, 12, 0, -37, 18432, 78, }, /* 221 */ + { 1, 5, 12, 0, 7219, 18432, 78, }, /* 222 */ + { 1, 5, 12, 0, -32, 18432, 78, }, /* 223 */ + { 1, 5, 12, 34, -32, 18432, 78, }, /* 224 */ + { 1, 5, 12, 59, -32, 18432, 78, }, /* 225 */ + { 1, 5, 12, 38, -32, 18432, 78, }, /* 226 */ + { 1, 5, 12, 21, -116, 18432, 78, }, /* 227 */ + { 1, 5, 12, 51, -32, 18432, 78, }, /* 228 */ + { 1, 5, 12, 26, -775, 18432, 78, }, /* 229 */ + { 1, 5, 12, 47, -32, 18432, 78, }, /* 230 */ + { 1, 5, 12, 55, -32, 18432, 78, }, /* 231 */ + { 1, 5, 12, 30, 1, 18432, 70, }, /* 232 */ + { 1, 5, 12, 30, -32, 18432, 78, }, /* 233 */ + { 1, 5, 12, 43, -32, 18432, 78, }, /* 234 */ + { 1, 5, 12, 96, -32, 18432, 78, }, /* 235 */ + { 1, 5, 12, 0, -64, 18432, 78, }, /* 236 */ + { 1, 5, 12, 0, -63, 18432, 78, }, /* 237 */ + { 1, 9, 12, 0, 8, 18432, 76, }, /* 238 */ + { 1, 5, 12, 34, -30, 18432, 114, }, /* 239 */ + { 1, 5, 12, 38, -25, 18432, 114, }, /* 240 */ + { 1, 9, 12, 0, 0, 18432, 116, }, /* 241 */ + { 1, 9, 12, 0, 0, 18432, 118, }, /* 242 */ + { 1, 5, 12, 43, -15, 18432, 114, }, /* 243 */ + { 1, 5, 12, 47, -22, 18432, 70, }, /* 244 */ + { 1, 5, 12, 0, -8, 18432, 78, }, /* 245 */ + { 43, 9, 12, 0, 1, 18432, 76, }, /* 246 */ + { 43, 5, 12, 0, -1, 18432, 78, }, /* 247 */ + { 1, 5, 12, 51, -54, 18432, 114, }, /* 248 */ + { 1, 5, 12, 55, -48, 18432, 114, }, /* 249 */ + { 1, 5, 12, 0, 7, 18432, 78, }, /* 250 */ + { 1, 5, 12, 0, -116, 18432, 80, }, /* 251 */ + { 1, 9, 12, 38, -60, 18432, 120, }, /* 252 */ + { 1, 5, 12, 59, -64, 18432, 114, }, /* 253 */ + { 1, 25, 12, 0, 0, 28672, 122, }, /* 254 */ + { 1, 9, 12, 0, -7, 18432, 76, }, /* 255 */ + { 1, 5, 12, 0, 0, 18432, 60, }, /* 256 */ + { 1, 9, 12, 0, -130, 18432, 76, }, /* 257 */ + { 2, 9, 12, 0, 80, 18432, 76, }, /* 258 */ + { 2, 9, 12, 0, 32, 18432, 76, }, /* 259 */ + { 2, 9, 12, 63, 32, 18432, 76, }, /* 260 */ + { 2, 9, 12, 67, 32, 18432, 76, }, /* 261 */ + { 2, 9, 12, 71, 32, 18432, 76, }, /* 262 */ + { 2, 9, 12, 75, 32, 18432, 76, }, /* 263 */ + { 2, 9, 12, 79, 32, 18432, 76, }, /* 264 */ + { 2, 9, 12, 84, 32, 18432, 76, }, /* 265 */ + { 2, 5, 12, 0, -32, 18432, 78, }, /* 266 */ + { 2, 5, 12, 63, -32, 18432, 78, }, /* 267 */ + { 2, 5, 12, 67, -32, 18432, 78, }, /* 268 */ + { 2, 5, 12, 71, -32, 18432, 78, }, /* 269 */ + { 2, 5, 12, 75, -32, 18432, 78, }, /* 270 */ + { 2, 5, 12, 79, -32, 18432, 78, }, /* 271 */ + { 2, 5, 12, 84, -32, 18432, 78, }, /* 272 */ + { 2, 5, 12, 0, -80, 18432, 78, }, /* 273 */ + { 2, 5, 12, 0, -80, 18432, 80, }, /* 274 */ + { 2, 9, 12, 0, 1, 18432, 76, }, /* 275 */ + { 2, 5, 12, 0, -1, 18432, 78, }, /* 276 */ + { 2, 9, 12, 88, 1, 18432, 76, }, /* 277 */ + { 2, 5, 12, 88, -1, 18432, 78, }, /* 278 */ + { 2, 26, 12, 0, 0, 18432, 74, }, /* 279 */ + { 2, 12, 3, 0, 0, 26760, 98, }, /* 280 */ + { 2, 12, 3, 0, 0, 26764, 98, }, /* 281 */ + { 107, 12, 3, 0, 0, 26768, 98, }, /* 282 */ + { 2, 11, 3, 0, 0, 26624, 124, }, /* 283 */ + { 2, 9, 12, 0, 15, 18432, 76, }, /* 284 */ + { 2, 5, 12, 0, -15, 18432, 78, }, /* 285 */ + { 3, 9, 12, 0, 48, 18432, 76, }, /* 286 */ + { 3, 6, 12, 0, 0, 18432, 94, }, /* 287 */ + { 3, 21, 12, 0, 0, 18432, 74, }, /* 288 */ + { 3, 21, 12, 0, 0, 18432, 126, }, /* 289 */ + { 3, 5, 12, 0, 0, 18432, 60, }, /* 290 */ + { 3, 5, 12, 0, -48, 18432, 78, }, /* 291 */ + { 3, 5, 12, 0, 0, 18432, 70, }, /* 292 */ + { 3, 21, 12, 0, 0, 18580, 128, }, /* 293 */ + { 3, 17, 12, 0, 0, 28672, 130, }, /* 294 */ + { 3, 26, 12, 0, 0, 28672, 74, }, /* 295 */ + { 3, 23, 12, 0, 0, 14336, 74, }, /* 296 */ + { 99, 2, 12, 0, 0, 34816, 0, }, /* 297 */ + { 4, 12, 3, 0, 0, 26624, 98, }, /* 298 */ + { 4, 12, 3, 0, 0, 26624, 132, }, /* 299 */ + { 4, 17, 12, 0, 0, 34816, 130, }, /* 300 */ + { 4, 21, 12, 0, 0, 34816, 74, }, /* 301 */ + { 4, 21, 12, 0, 0, 34816, 110, }, /* 302 */ + { 4, 7, 12, 0, 0, 34816, 84, }, /* 303 */ + { 4, 21, 12, 0, 0, 34816, 126, }, /* 304 */ + { 5, 1, 4, 0, 0, 2048, 134, }, /* 305 */ + { 100, 1, 4, 0, 0, 2048, 134, }, /* 306 */ + { 5, 25, 12, 0, 0, 28672, 122, }, /* 307 */ + { 5, 25, 12, 0, 0, 0, 122, }, /* 308 */ + { 5, 21, 12, 0, 0, 14336, 74, }, /* 309 */ + { 5, 23, 12, 0, 0, 0, 74, }, /* 310 */ + { 100, 21, 12, 0, 0, 8344, 110, }, /* 311 */ + { 5, 21, 12, 0, 0, 0, 74, }, /* 312 */ + { 5, 26, 12, 0, 0, 28672, 74, }, /* 313 */ + { 5, 12, 3, 0, 0, 26624, 106, }, /* 314 */ + { 100, 21, 12, 0, 0, 152, 110, }, /* 315 */ + { 5, 1, 2, 0, 0, 156, 136, }, /* 316 */ + { 5, 21, 12, 0, 0, 0, 128, }, /* 317 */ + { 100, 21, 12, 0, 0, 160, 128, }, /* 318 */ + { 5, 7, 12, 0, 0, 0, 84, }, /* 319 */ + { 100, 6, 12, 0, 0, 164, 138, }, /* 320 */ + { 107, 12, 3, 0, 0, 26792, 132, }, /* 321 */ + { 107, 12, 3, 0, 0, 26792, 106, }, /* 322 */ + { 107, 12, 3, 0, 0, 26792, 140, }, /* 323 */ + { 5, 12, 3, 0, 0, 26624, 132, }, /* 324 */ + { 5, 12, 3, 0, 0, 26624, 142, }, /* 325 */ + { 5, 13, 12, 0, 0, 2220, 144, }, /* 326 */ + { 5, 21, 12, 0, 0, 2048, 74, }, /* 327 */ + { 5, 7, 12, 0, 0, 0, 146, }, /* 328 */ + { 5, 21, 12, 0, 0, 176, 128, }, /* 329 */ + { 5, 12, 3, 0, 0, 26624, 140, }, /* 330 */ + { 5, 12, 3, 0, 0, 26624, 98, }, /* 331 */ + { 5, 6, 12, 0, 0, 0, 94, }, /* 332 */ + { 5, 13, 12, 0, 0, 10240, 144, }, /* 333 */ + { 5, 26, 12, 0, 0, 0, 74, }, /* 334 */ + { 6, 21, 12, 0, 0, 0, 128, }, /* 335 */ + { 6, 21, 12, 0, 0, 0, 110, }, /* 336 */ + { 6, 21, 12, 0, 0, 0, 74, }, /* 337 */ + { 99, 2, 12, 0, 0, 0, 0, }, /* 338 */ + { 6, 1, 4, 0, 0, 0, 134, }, /* 339 */ + { 6, 7, 12, 0, 0, 0, 84, }, /* 340 */ + { 6, 12, 3, 0, 0, 26624, 106, }, /* 341 */ + { 6, 12, 3, 0, 0, 26624, 132, }, /* 342 */ + { 6, 12, 3, 0, 0, 26624, 98, }, /* 343 */ + { 7, 7, 12, 0, 0, 0, 84, }, /* 344 */ + { 7, 12, 3, 0, 0, 26624, 132, }, /* 345 */ + { 48, 13, 12, 0, 0, 34816, 144, }, /* 346 */ + { 48, 7, 12, 0, 0, 34816, 84, }, /* 347 */ + { 48, 12, 3, 0, 0, 26624, 98, }, /* 348 */ + { 48, 6, 12, 0, 0, 34816, 94, }, /* 349 */ + { 48, 26, 12, 0, 0, 28672, 74, }, /* 350 */ + { 48, 21, 12, 0, 0, 28672, 74, }, /* 351 */ + { 48, 21, 12, 0, 0, 28672, 110, }, /* 352 */ + { 48, 21, 12, 0, 0, 28672, 128, }, /* 353 */ + { 48, 6, 12, 0, 0, 34816, 138, }, /* 354 */ + { 48, 12, 3, 0, 0, 26624, 104, }, /* 355 */ + { 48, 23, 12, 0, 0, 34816, 74, }, /* 356 */ + { 54, 7, 12, 0, 0, 34816, 84, }, /* 357 */ + { 54, 12, 3, 0, 0, 26624, 106, }, /* 358 */ + { 54, 12, 3, 0, 0, 26624, 98, }, /* 359 */ + { 54, 6, 12, 0, 0, 34816, 148, }, /* 360 */ + { 54, 12, 3, 0, 0, 26624, 104, }, /* 361 */ + { 54, 21, 12, 0, 0, 34816, 110, }, /* 362 */ + { 54, 21, 12, 0, 0, 34816, 74, }, /* 363 */ + { 54, 21, 12, 0, 0, 34816, 128, }, /* 364 */ + { 59, 7, 12, 0, 0, 34816, 84, }, /* 365 */ + { 59, 12, 3, 0, 0, 26624, 104, }, /* 366 */ + { 59, 21, 12, 0, 0, 34816, 110, }, /* 367 */ + { 5, 24, 12, 0, 0, 0, 126, }, /* 368 */ + { 5, 12, 3, 0, 0, 26624, 150, }, /* 369 */ + { 5, 12, 3, 0, 0, 26624, 104, }, /* 370 */ + { 5, 12, 3, 0, 0, 26624, 152, }, /* 371 */ + { 8, 12, 3, 0, 0, 26624, 106, }, /* 372 */ + { 8, 10, 5, 0, 0, 18432, 154, }, /* 373 */ + { 8, 7, 12, 0, 0, 18432, 84, }, /* 374 */ + { 8, 7, 12, 0, 0, 18432, 156, }, /* 375 */ + { 8, 12, 3, 0, 0, 26624, 98, }, /* 376 */ + { 8, 12, 3, 0, 0, 26624, 158, }, /* 377 */ + { 107, 12, 3, 0, 0, 26804, 98, }, /* 378 */ + { 107, 12, 3, 0, 0, 26808, 98, }, /* 379 */ + { 100, 21, 12, 0, 0, 18620, 128, }, /* 380 */ + { 100, 21, 12, 0, 0, 18624, 128, }, /* 381 */ + { 8, 13, 12, 0, 0, 18628, 144, }, /* 382 */ + { 8, 21, 12, 0, 0, 18432, 74, }, /* 383 */ + { 8, 6, 12, 0, 0, 18432, 94, }, /* 384 */ + { 9, 7, 12, 0, 0, 18432, 84, }, /* 385 */ + { 9, 12, 3, 0, 0, 26624, 106, }, /* 386 */ + { 9, 10, 5, 0, 0, 18432, 154, }, /* 387 */ + { 9, 7, 12, 0, 0, 18432, 156, }, /* 388 */ + { 9, 12, 3, 0, 0, 26624, 98, }, /* 389 */ + { 9, 10, 3, 0, 0, 18432, 160, }, /* 390 */ + { 9, 12, 3, 0, 0, 26624, 158, }, /* 391 */ + { 9, 13, 12, 0, 0, 18632, 144, }, /* 392 */ + { 9, 23, 12, 0, 0, 14336, 74, }, /* 393 */ + { 9, 15, 12, 0, 0, 18432, 74, }, /* 394 */ + { 9, 26, 12, 0, 0, 18432, 74, }, /* 395 */ + { 9, 21, 12, 0, 0, 18432, 74, }, /* 396 */ + { 9, 12, 3, 0, 0, 26624, 104, }, /* 397 */ + { 10, 12, 3, 0, 0, 26624, 106, }, /* 398 */ + { 10, 10, 5, 0, 0, 18432, 154, }, /* 399 */ + { 10, 7, 12, 0, 0, 18432, 84, }, /* 400 */ + { 10, 12, 3, 0, 0, 26624, 98, }, /* 401 */ + { 10, 12, 3, 0, 0, 26624, 158, }, /* 402 */ + { 10, 13, 12, 0, 0, 18636, 144, }, /* 403 */ + { 10, 12, 3, 0, 0, 26624, 162, }, /* 404 */ + { 10, 21, 12, 0, 0, 18432, 74, }, /* 405 */ + { 11, 12, 3, 0, 0, 26624, 106, }, /* 406 */ + { 11, 10, 5, 0, 0, 18432, 154, }, /* 407 */ + { 11, 7, 12, 0, 0, 18432, 84, }, /* 408 */ + { 11, 7, 12, 0, 0, 18432, 156, }, /* 409 */ + { 11, 12, 3, 0, 0, 26624, 98, }, /* 410 */ + { 11, 12, 3, 0, 0, 26624, 158, }, /* 411 */ + { 11, 13, 12, 0, 0, 18640, 144, }, /* 412 */ + { 11, 21, 12, 0, 0, 18432, 74, }, /* 413 */ + { 11, 23, 12, 0, 0, 14336, 74, }, /* 414 */ + { 11, 12, 3, 0, 0, 26624, 162, }, /* 415 */ + { 12, 12, 3, 0, 0, 26624, 106, }, /* 416 */ + { 12, 10, 5, 0, 0, 18432, 154, }, /* 417 */ + { 12, 7, 12, 0, 0, 18432, 84, }, /* 418 */ + { 12, 7, 12, 0, 0, 18432, 156, }, /* 419 */ + { 12, 12, 3, 0, 0, 26624, 98, }, /* 420 */ + { 12, 10, 3, 0, 0, 18432, 160, }, /* 421 */ + { 12, 12, 3, 0, 0, 26624, 158, }, /* 422 */ + { 12, 12, 3, 0, 0, 26624, 164, }, /* 423 */ + { 12, 13, 12, 0, 0, 18432, 144, }, /* 424 */ + { 12, 26, 12, 0, 0, 18432, 74, }, /* 425 */ + { 12, 15, 12, 0, 0, 18432, 74, }, /* 426 */ + { 13, 12, 3, 0, 0, 26624, 106, }, /* 427 */ + { 13, 7, 12, 0, 0, 18432, 84, }, /* 428 */ + { 13, 10, 3, 0, 0, 18432, 160, }, /* 429 */ + { 13, 10, 5, 0, 0, 18432, 154, }, /* 430 */ + { 13, 12, 3, 0, 0, 26624, 158, }, /* 431 */ + { 13, 13, 12, 0, 0, 18644, 144, }, /* 432 */ + { 13, 15, 12, 0, 0, 18644, 74, }, /* 433 */ + { 13, 26, 12, 0, 0, 28884, 74, }, /* 434 */ + { 13, 26, 12, 0, 0, 28672, 74, }, /* 435 */ + { 13, 23, 12, 0, 0, 14336, 74, }, /* 436 */ + { 14, 12, 3, 0, 0, 26624, 106, }, /* 437 */ + { 14, 10, 5, 0, 0, 18432, 154, }, /* 438 */ + { 14, 7, 12, 0, 0, 18432, 84, }, /* 439 */ + { 14, 7, 12, 0, 0, 18432, 156, }, /* 440 */ + { 14, 12, 3, 0, 0, 26624, 98, }, /* 441 */ + { 14, 12, 3, 0, 0, 26624, 158, }, /* 442 */ + { 14, 13, 12, 0, 0, 18432, 144, }, /* 443 */ + { 14, 21, 12, 0, 0, 18432, 74, }, /* 444 */ + { 14, 15, 12, 0, 0, 28672, 74, }, /* 445 */ + { 14, 26, 12, 0, 0, 18432, 74, }, /* 446 */ + { 15, 7, 12, 0, 0, 18432, 84, }, /* 447 */ + { 15, 12, 3, 0, 0, 26624, 106, }, /* 448 */ + { 15, 10, 5, 0, 0, 18432, 154, }, /* 449 */ + { 15, 21, 12, 0, 0, 18432, 74, }, /* 450 */ + { 15, 12, 3, 0, 0, 26624, 98, }, /* 451 */ + { 15, 12, 3, 0, 0, 18432, 106, }, /* 452 */ + { 15, 10, 3, 0, 0, 18432, 160, }, /* 453 */ + { 15, 12, 3, 0, 0, 26624, 158, }, /* 454 */ + { 15, 13, 12, 0, 0, 18648, 144, }, /* 455 */ + { 16, 12, 3, 0, 0, 26624, 106, }, /* 456 */ + { 16, 10, 5, 0, 0, 18432, 154, }, /* 457 */ + { 16, 7, 12, 0, 0, 18432, 84, }, /* 458 */ + { 16, 7, 12, 0, 0, 18432, 156, }, /* 459 */ + { 16, 12, 3, 0, 0, 26624, 158, }, /* 460 */ + { 16, 10, 3, 0, 0, 18432, 160, }, /* 461 */ + { 16, 7, 4, 0, 0, 18432, 84, }, /* 462 */ + { 16, 26, 12, 0, 0, 18432, 74, }, /* 463 */ + { 16, 15, 12, 0, 0, 18432, 74, }, /* 464 */ + { 16, 13, 12, 0, 0, 18432, 144, }, /* 465 */ + { 17, 12, 3, 0, 0, 26624, 106, }, /* 466 */ + { 17, 10, 5, 0, 0, 18432, 154, }, /* 467 */ + { 17, 7, 12, 0, 0, 18432, 84, }, /* 468 */ + { 17, 12, 3, 0, 0, 26624, 158, }, /* 469 */ + { 17, 10, 3, 0, 0, 18432, 160, }, /* 470 */ + { 17, 13, 12, 0, 0, 18432, 144, }, /* 471 */ + { 17, 21, 12, 0, 0, 18432, 74, }, /* 472 */ + { 18, 7, 12, 0, 0, 18432, 84, }, /* 473 */ + { 18, 12, 3, 0, 0, 26624, 106, }, /* 474 */ + { 18, 7, 5, 0, 0, 18432, 166, }, /* 475 */ + { 18, 12, 3, 0, 0, 26624, 168, }, /* 476 */ + { 100, 23, 12, 0, 0, 14336, 74, }, /* 477 */ + { 18, 7, 12, 0, 0, 18432, 170, }, /* 478 */ + { 18, 6, 12, 0, 0, 18432, 138, }, /* 479 */ + { 18, 12, 3, 0, 0, 26624, 98, }, /* 480 */ + { 18, 21, 12, 0, 0, 18432, 74, }, /* 481 */ + { 18, 13, 12, 0, 0, 18432, 144, }, /* 482 */ + { 18, 21, 12, 0, 0, 18432, 110, }, /* 483 */ + { 101, 7, 12, 0, 0, 18432, 84, }, /* 484 */ + { 101, 12, 3, 0, 0, 26624, 106, }, /* 485 */ + { 101, 7, 5, 0, 0, 18432, 166, }, /* 486 */ + { 101, 12, 3, 0, 0, 26624, 158, }, /* 487 */ + { 101, 7, 12, 0, 0, 18432, 170, }, /* 488 */ + { 101, 6, 12, 0, 0, 18432, 138, }, /* 489 */ + { 101, 12, 3, 0, 0, 26624, 98, }, /* 490 */ + { 101, 12, 3, 0, 0, 26624, 104, }, /* 491 */ + { 101, 13, 12, 0, 0, 18432, 144, }, /* 492 */ + { 19, 7, 12, 0, 0, 18432, 84, }, /* 493 */ + { 19, 26, 12, 0, 0, 18432, 74, }, /* 494 */ + { 19, 21, 12, 0, 0, 18432, 74, }, /* 495 */ + { 19, 21, 12, 0, 0, 18432, 110, }, /* 496 */ + { 19, 12, 3, 0, 0, 26624, 98, }, /* 497 */ + { 19, 13, 12, 0, 0, 18432, 144, }, /* 498 */ + { 19, 15, 12, 0, 0, 18432, 74, }, /* 499 */ + { 19, 22, 12, 0, 0, 28672, 172, }, /* 500 */ + { 19, 18, 12, 0, 0, 28672, 172, }, /* 501 */ + { 19, 10, 5, 0, 0, 18432, 174, }, /* 502 */ + { 19, 12, 3, 0, 0, 26624, 106, }, /* 503 */ + { 19, 12, 3, 0, 0, 26624, 176, }, /* 504 */ + { 19, 10, 5, 0, 0, 18432, 154, }, /* 505 */ + { 19, 12, 3, 0, 0, 26624, 132, }, /* 506 */ + { 19, 12, 3, 0, 0, 26624, 158, }, /* 507 */ + { 100, 26, 12, 0, 0, 18432, 74, }, /* 508 */ + { 20, 7, 12, 0, 0, 18432, 156, }, /* 509 */ + { 20, 10, 12, 0, 0, 18432, 154, }, /* 510 */ + { 20, 12, 3, 0, 0, 26624, 106, }, /* 511 */ + { 20, 10, 5, 0, 0, 18432, 154, }, /* 512 */ + { 20, 12, 3, 0, 0, 26624, 98, }, /* 513 */ + { 20, 12, 3, 0, 0, 26624, 158, }, /* 514 */ + { 20, 13, 12, 0, 0, 18652, 144, }, /* 515 */ + { 20, 21, 12, 0, 0, 18432, 128, }, /* 516 */ + { 20, 21, 12, 0, 0, 18432, 74, }, /* 517 */ + { 20, 10, 12, 0, 0, 18432, 178, }, /* 518 */ + { 20, 12, 3, 0, 0, 26624, 132, }, /* 519 */ + { 20, 13, 12, 0, 0, 18432, 144, }, /* 520 */ + { 20, 26, 12, 0, 0, 18432, 74, }, /* 521 */ + { 21, 9, 12, 0, 7264, 18432, 76, }, /* 522 */ + { 21, 5, 12, 0, 3008, 18432, 180, }, /* 523 */ + { 100, 21, 12, 0, 0, 18656, 74, }, /* 524 */ + { 21, 6, 12, 0, 0, 18432, 182, }, /* 525 */ + { 22, 7, 6, 0, 0, 18432, 84, }, /* 526 */ + { 22, 7, 6, 0, 0, 18432, 184, }, /* 527 */ + { 22, 7, 7, 0, 0, 18432, 184, }, /* 528 */ + { 22, 7, 7, 0, 0, 18432, 84, }, /* 529 */ + { 22, 7, 8, 0, 0, 18432, 84, }, /* 530 */ + { 23, 7, 12, 0, 0, 18432, 84, }, /* 531 */ + { 23, 12, 3, 0, 0, 26624, 98, }, /* 532 */ + { 23, 21, 12, 0, 0, 18432, 74, }, /* 533 */ + { 23, 21, 12, 0, 0, 18432, 110, }, /* 534 */ + { 23, 21, 12, 0, 0, 18432, 128, }, /* 535 */ + { 23, 15, 12, 0, 0, 18432, 144, }, /* 536 */ + { 23, 15, 12, 0, 0, 18432, 74, }, /* 537 */ + { 23, 26, 12, 0, 0, 28672, 74, }, /* 538 */ + { 24, 9, 12, 0, 38864, 18432, 186, }, /* 539 */ + { 24, 9, 12, 0, 8, 18432, 186, }, /* 540 */ + { 24, 5, 12, 0, -8, 18432, 70, }, /* 541 */ + { 102, 17, 12, 0, 0, 28672, 130, }, /* 542 */ + { 102, 7, 12, 0, 0, 18432, 84, }, /* 543 */ + { 102, 26, 12, 0, 0, 18432, 74, }, /* 544 */ + { 102, 21, 12, 0, 0, 18432, 128, }, /* 545 */ + { 103, 29, 12, 0, 0, 45056, 52, }, /* 546 */ + { 103, 7, 12, 0, 0, 18432, 84, }, /* 547 */ + { 103, 22, 12, 0, 0, 28672, 172, }, /* 548 */ + { 103, 18, 12, 0, 0, 28672, 172, }, /* 549 */ + { 25, 7, 12, 0, 0, 18432, 84, }, /* 550 */ + { 100, 21, 12, 0, 0, 18660, 110, }, /* 551 */ + { 25, 14, 12, 0, 0, 18432, 84, }, /* 552 */ + { 33, 7, 12, 0, 0, 18432, 84, }, /* 553 */ + { 33, 12, 3, 0, 0, 26624, 106, }, /* 554 */ + { 33, 12, 3, 0, 0, 26624, 158, }, /* 555 */ + { 33, 10, 3, 0, 0, 18432, 188, }, /* 556 */ + { 34, 7, 12, 0, 0, 18432, 84, }, /* 557 */ + { 34, 12, 3, 0, 0, 26624, 106, }, /* 558 */ + { 34, 10, 3, 0, 0, 18432, 188, }, /* 559 */ + { 100, 21, 12, 0, 0, 18664, 128, }, /* 560 */ + { 35, 7, 12, 0, 0, 18432, 84, }, /* 561 */ + { 35, 12, 3, 0, 0, 26624, 106, }, /* 562 */ + { 36, 7, 12, 0, 0, 18432, 84, }, /* 563 */ + { 36, 12, 3, 0, 0, 26624, 106, }, /* 564 */ + { 104, 7, 12, 0, 0, 18432, 156, }, /* 565 */ + { 104, 7, 12, 0, 0, 18432, 190, }, /* 566 */ + { 104, 12, 3, 0, 0, 26624, 102, }, /* 567 */ + { 104, 10, 5, 0, 0, 18432, 154, }, /* 568 */ + { 104, 12, 3, 0, 0, 26624, 106, }, /* 569 */ + { 104, 12, 3, 0, 0, 26624, 98, }, /* 570 */ + { 104, 12, 3, 0, 0, 26624, 158, }, /* 571 */ + { 104, 21, 12, 0, 0, 18432, 128, }, /* 572 */ + { 104, 21, 12, 0, 0, 18432, 110, }, /* 573 */ + { 104, 6, 12, 0, 0, 18432, 148, }, /* 574 */ + { 104, 21, 12, 0, 0, 18432, 74, }, /* 575 */ + { 104, 23, 12, 0, 0, 14336, 74, }, /* 576 */ + { 104, 7, 12, 0, 0, 18432, 84, }, /* 577 */ + { 104, 13, 12, 0, 0, 18432, 144, }, /* 578 */ + { 104, 15, 12, 0, 0, 28672, 74, }, /* 579 */ + { 26, 21, 12, 0, 0, 28672, 74, }, /* 580 */ + { 100, 21, 12, 0, 0, 28908, 110, }, /* 581 */ + { 100, 21, 12, 0, 0, 28908, 128, }, /* 582 */ + { 26, 21, 12, 0, 0, 28672, 110, }, /* 583 */ + { 26, 17, 12, 0, 0, 28672, 130, }, /* 584 */ + { 26, 21, 12, 0, 0, 28672, 128, }, /* 585 */ + { 26, 21, 12, 0, 0, 28672, 192, }, /* 586 */ + { 26, 12, 3, 0, 0, 26624, 194, }, /* 587 */ + { 26, 1, 2, 0, 0, 6144, 66, }, /* 588 */ + { 26, 13, 12, 0, 0, 18432, 144, }, /* 589 */ + { 26, 7, 12, 0, 0, 18432, 84, }, /* 590 */ + { 26, 6, 12, 0, 0, 18432, 138, }, /* 591 */ + { 26, 12, 3, 0, 0, 26624, 196, }, /* 592 */ + { 26, 12, 3, 0, 0, 26624, 106, }, /* 593 */ + { 37, 7, 12, 0, 0, 18432, 84, }, /* 594 */ + { 37, 12, 3, 0, 0, 26624, 106, }, /* 595 */ + { 37, 10, 5, 0, 0, 18432, 154, }, /* 596 */ + { 37, 12, 3, 0, 0, 26624, 98, }, /* 597 */ + { 37, 26, 12, 0, 0, 28672, 74, }, /* 598 */ + { 37, 21, 12, 0, 0, 28672, 128, }, /* 599 */ + { 37, 13, 12, 0, 0, 18432, 144, }, /* 600 */ + { 38, 7, 12, 0, 0, 18432, 84, }, /* 601 */ + { 111, 7, 12, 0, 0, 18432, 84, }, /* 602 */ + { 111, 7, 12, 0, 0, 18432, 170, }, /* 603 */ + { 111, 13, 12, 0, 0, 18432, 144, }, /* 604 */ + { 111, 15, 12, 0, 0, 18432, 144, }, /* 605 */ + { 111, 26, 12, 0, 0, 28672, 74, }, /* 606 */ + { 104, 26, 12, 0, 0, 28672, 74, }, /* 607 */ + { 42, 7, 12, 0, 0, 18432, 84, }, /* 608 */ + { 42, 12, 3, 0, 0, 26624, 106, }, /* 609 */ + { 42, 10, 5, 0, 0, 18432, 154, }, /* 610 */ + { 42, 21, 12, 0, 0, 18432, 74, }, /* 611 */ + { 124, 7, 12, 0, 0, 18432, 156, }, /* 612 */ + { 124, 10, 5, 0, 0, 18432, 154, }, /* 613 */ + { 124, 12, 3, 0, 0, 26624, 106, }, /* 614 */ + { 124, 12, 3, 0, 0, 26624, 158, }, /* 615 */ + { 124, 10, 12, 0, 0, 18432, 154, }, /* 616 */ + { 124, 12, 3, 0, 0, 26624, 98, }, /* 617 */ + { 124, 13, 12, 0, 0, 18432, 144, }, /* 618 */ + { 124, 21, 12, 0, 0, 18432, 74, }, /* 619 */ + { 124, 6, 12, 0, 0, 18432, 138, }, /* 620 */ + { 124, 21, 12, 0, 0, 18432, 128, }, /* 621 */ + { 107, 11, 3, 0, 0, 26624, 198, }, /* 622 */ + { 107, 12, 3, 0, 0, 26624, 106, }, /* 623 */ + { 114, 12, 3, 0, 0, 26624, 106, }, /* 624 */ + { 114, 10, 5, 0, 0, 18432, 154, }, /* 625 */ + { 114, 7, 12, 0, 0, 18432, 84, }, /* 626 */ + { 114, 7, 12, 0, 0, 18432, 156, }, /* 627 */ + { 114, 12, 3, 0, 0, 26624, 98, }, /* 628 */ + { 114, 10, 3, 0, 0, 18432, 160, }, /* 629 */ + { 114, 10, 3, 0, 0, 18432, 188, }, /* 630 */ + { 114, 21, 12, 0, 0, 18432, 128, }, /* 631 */ + { 114, 13, 12, 0, 0, 18432, 144, }, /* 632 */ + { 114, 21, 12, 0, 0, 18432, 74, }, /* 633 */ + { 114, 21, 12, 0, 0, 18432, 110, }, /* 634 */ + { 114, 26, 12, 0, 0, 18432, 74, }, /* 635 */ + { 117, 12, 3, 0, 0, 26624, 106, }, /* 636 */ + { 117, 10, 5, 0, 0, 18432, 154, }, /* 637 */ + { 117, 7, 12, 0, 0, 18432, 156, }, /* 638 */ + { 117, 10, 3, 0, 0, 18432, 188, }, /* 639 */ + { 117, 12, 3, 0, 0, 26624, 158, }, /* 640 */ + { 117, 13, 12, 0, 0, 18432, 144, }, /* 641 */ + { 117, 7, 12, 0, 0, 18432, 84, }, /* 642 */ + { 133, 7, 12, 0, 0, 18432, 84, }, /* 643 */ + { 133, 12, 3, 0, 0, 26624, 98, }, /* 644 */ + { 133, 10, 5, 0, 0, 18432, 154, }, /* 645 */ + { 133, 12, 3, 0, 0, 26624, 106, }, /* 646 */ + { 133, 10, 3, 0, 0, 18432, 188, }, /* 647 */ + { 133, 21, 12, 0, 0, 18432, 74, }, /* 648 */ + { 118, 7, 12, 0, 0, 18432, 84, }, /* 649 */ + { 118, 10, 5, 0, 0, 18432, 154, }, /* 650 */ + { 118, 12, 3, 0, 0, 26624, 106, }, /* 651 */ + { 118, 12, 3, 0, 0, 26624, 200, }, /* 652 */ + { 118, 12, 3, 0, 0, 26624, 98, }, /* 653 */ + { 118, 21, 12, 0, 0, 18432, 128, }, /* 654 */ + { 118, 21, 12, 0, 0, 18432, 110, }, /* 655 */ + { 118, 13, 12, 0, 0, 18432, 144, }, /* 656 */ + { 119, 13, 12, 0, 0, 18432, 144, }, /* 657 */ + { 119, 7, 12, 0, 0, 18432, 84, }, /* 658 */ + { 119, 6, 12, 0, 0, 18432, 94, }, /* 659 */ + { 119, 6, 12, 0, 0, 18432, 96, }, /* 660 */ + { 119, 21, 12, 0, 0, 18432, 128, }, /* 661 */ + { 2, 5, 12, 63, -6222, 18432, 70, }, /* 662 */ + { 2, 5, 12, 67, -6221, 18432, 70, }, /* 663 */ + { 2, 5, 12, 71, -6212, 18432, 70, }, /* 664 */ + { 2, 5, 12, 75, -6210, 18432, 70, }, /* 665 */ + { 2, 5, 12, 79, -6210, 18432, 70, }, /* 666 */ + { 2, 5, 12, 79, -6211, 18432, 70, }, /* 667 */ + { 2, 5, 12, 84, -6204, 18432, 70, }, /* 668 */ + { 2, 5, 12, 88, -6180, 18432, 70, }, /* 669 */ + { 2, 5, 12, 108, 35267, 18432, 70, }, /* 670 */ + { 21, 9, 12, 0, -3008, 18432, 76, }, /* 671 */ + { 117, 21, 12, 0, 0, 18432, 74, }, /* 672 */ + { 107, 12, 3, 0, 0, 26864, 98, }, /* 673 */ + { 107, 12, 3, 0, 0, 26868, 98, }, /* 674 */ + { 100, 21, 12, 0, 0, 18680, 202, }, /* 675 */ + { 107, 12, 3, 0, 0, 26876, 98, }, /* 676 */ + { 107, 12, 3, 0, 0, 26880, 98, }, /* 677 */ + { 107, 12, 3, 0, 0, 26884, 98, }, /* 678 */ + { 107, 12, 3, 0, 0, 26888, 98, }, /* 679 */ + { 107, 12, 3, 0, 0, 26892, 98, }, /* 680 */ + { 107, 12, 3, 0, 0, 26896, 98, }, /* 681 */ + { 100, 10, 5, 0, 0, 18708, 174, }, /* 682 */ + { 107, 12, 3, 0, 0, 26904, 98, }, /* 683 */ + { 100, 7, 12, 0, 0, 18716, 84, }, /* 684 */ + { 100, 7, 12, 0, 0, 18720, 84, }, /* 685 */ + { 100, 7, 12, 0, 0, 18724, 84, }, /* 686 */ + { 100, 7, 12, 0, 0, 18676, 84, }, /* 687 */ + { 107, 12, 3, 0, 0, 26920, 98, }, /* 688 */ + { 100, 7, 12, 0, 0, 18732, 84, }, /* 689 */ + { 100, 7, 12, 0, 0, 18736, 84, }, /* 690 */ + { 107, 12, 3, 0, 0, 26932, 98, }, /* 691 */ + { 100, 7, 12, 0, 0, 18708, 84, }, /* 692 */ + { 100, 10, 5, 0, 0, 18744, 174, }, /* 693 */ + { 107, 12, 3, 0, 0, 26928, 98, }, /* 694 */ + { 100, 7, 12, 0, 0, 18748, 84, }, /* 695 */ + { 2, 5, 12, 0, 0, 18432, 60, }, /* 696 */ + { 1, 6, 12, 0, 0, 18432, 90, }, /* 697 */ + { 2, 6, 12, 0, 0, 18432, 182, }, /* 698 */ + { 0, 5, 12, 0, 35332, 18432, 78, }, /* 699 */ + { 0, 5, 12, 0, 3814, 18432, 78, }, /* 700 */ + { 0, 5, 12, 0, 35384, 18432, 78, }, /* 701 */ + { 0, 5, 12, 0, 0, 18432, 204, }, /* 702 */ + { 1, 6, 12, 0, 0, 18432, 182, }, /* 703 */ + { 107, 12, 3, 0, 0, 26740, 104, }, /* 704 */ + { 107, 12, 3, 0, 0, 26944, 98, }, /* 705 */ + { 107, 12, 3, 0, 0, 26948, 98, }, /* 706 */ + { 0, 9, 12, 92, 1, 18432, 76, }, /* 707 */ + { 0, 5, 12, 92, -1, 18432, 78, }, /* 708 */ + { 0, 5, 12, 0, 0, 18432, 70, }, /* 709 */ + { 0, 5, 12, 92, -58, 18432, 70, }, /* 710 */ + { 0, 9, 12, 0, -7615, 18432, 76, }, /* 711 */ + { 1, 5, 12, 0, 8, 18432, 78, }, /* 712 */ + { 1, 9, 12, 0, -8, 18432, 76, }, /* 713 */ + { 1, 5, 12, 0, 0, 18432, 78, }, /* 714 */ + { 1, 5, 12, 0, 74, 18432, 78, }, /* 715 */ + { 1, 5, 12, 0, 86, 18432, 78, }, /* 716 */ + { 1, 5, 12, 0, 100, 18432, 78, }, /* 717 */ + { 1, 5, 12, 0, 128, 18432, 78, }, /* 718 */ + { 1, 5, 12, 0, 112, 18432, 78, }, /* 719 */ + { 1, 5, 12, 0, 126, 18432, 78, }, /* 720 */ + { 1, 5, 12, 0, 8, 18432, 70, }, /* 721 */ + { 1, 8, 12, 0, -8, 18432, 88, }, /* 722 */ + { 1, 5, 12, 0, 0, 18432, 70, }, /* 723 */ + { 1, 5, 12, 0, 9, 18432, 70, }, /* 724 */ + { 1, 9, 12, 0, -74, 18432, 76, }, /* 725 */ + { 1, 8, 12, 0, -9, 18432, 88, }, /* 726 */ + { 1, 5, 12, 21, -7173, 18432, 78, }, /* 727 */ + { 1, 9, 12, 0, -86, 18432, 76, }, /* 728 */ + { 1, 5, 12, 0, -7235, 18432, 78, }, /* 729 */ + { 1, 9, 12, 0, -100, 18432, 76, }, /* 730 */ + { 1, 5, 12, 0, -7219, 18432, 78, }, /* 731 */ + { 1, 9, 12, 0, -112, 18432, 76, }, /* 732 */ + { 1, 9, 12, 0, -128, 18432, 76, }, /* 733 */ + { 1, 9, 12, 0, -126, 18432, 76, }, /* 734 */ + { 100, 29, 12, 0, 0, 45056, 52, }, /* 735 */ + { 107, 1, 3, 0, 0, 6144, 206, }, /* 736 */ + { 107, 1, 13, 0, 0, 6144, 208, }, /* 737 */ + { 100, 1, 2, 0, 0, 18432, 210, }, /* 738 */ + { 100, 1, 2, 0, 0, 34816, 210, }, /* 739 */ + { 100, 17, 12, 0, 0, 28672, 212, }, /* 740 */ + { 100, 21, 12, 0, 0, 28672, 64, }, /* 741 */ + { 100, 20, 12, 0, 0, 28672, 214, }, /* 742 */ + { 100, 19, 12, 0, 0, 28672, 214, }, /* 743 */ + { 100, 22, 12, 0, 0, 28672, 216, }, /* 744 */ + { 100, 20, 12, 0, 0, 28672, 216, }, /* 745 */ + { 100, 19, 12, 0, 0, 28672, 216, }, /* 746 */ + { 100, 21, 12, 0, 0, 28672, 218, }, /* 747 */ + { 100, 21, 12, 0, 0, 28672, 220, }, /* 748 */ + { 100, 27, 2, 0, 0, 45056, 50, }, /* 749 */ + { 100, 28, 2, 0, 0, 4096, 50, }, /* 750 */ + { 100, 1, 2, 0, 0, 20480, 136, }, /* 751 */ + { 100, 1, 2, 0, 0, 36864, 136, }, /* 752 */ + { 100, 1, 2, 0, 0, 30720, 136, }, /* 753 */ + { 100, 1, 2, 0, 0, 24576, 136, }, /* 754 */ + { 100, 1, 2, 0, 0, 40960, 136, }, /* 755 */ + { 100, 29, 12, 0, 0, 8520, 52, }, /* 756 */ + { 100, 21, 12, 0, 0, 14336, 54, }, /* 757 */ + { 100, 21, 12, 0, 0, 14336, 64, }, /* 758 */ + { 100, 21, 14, 0, 0, 28672, 222, }, /* 759 */ + { 100, 21, 12, 0, 0, 28672, 224, }, /* 760 */ + { 100, 16, 12, 0, 0, 28672, 144, }, /* 761 */ + { 100, 16, 12, 0, 0, 28672, 226, }, /* 762 */ + { 100, 25, 12, 0, 0, 8192, 64, }, /* 763 */ + { 100, 22, 12, 0, 0, 28672, 228, }, /* 764 */ + { 100, 18, 12, 0, 0, 28672, 228, }, /* 765 */ + { 100, 21, 12, 0, 0, 29004, 54, }, /* 766 */ + { 100, 21, 12, 0, 0, 28672, 212, }, /* 767 */ + { 100, 21, 12, 0, 0, 29008, 54, }, /* 768 */ + { 100, 21, 12, 0, 0, 29012, 54, }, /* 769 */ + { 100, 1, 2, 0, 0, 6144, 230, }, /* 770 */ + { 99, 2, 2, 0, 0, 6144, 232, }, /* 771 */ + { 100, 1, 2, 0, 0, 22528, 136, }, /* 772 */ + { 100, 1, 2, 0, 0, 38912, 136, }, /* 773 */ + { 100, 1, 2, 0, 0, 16384, 136, }, /* 774 */ + { 100, 1, 2, 0, 0, 32768, 136, }, /* 775 */ + { 100, 1, 2, 0, 0, 6144, 234, }, /* 776 */ + { 0, 6, 12, 0, 0, 18432, 236, }, /* 777 */ + { 100, 25, 12, 0, 0, 12288, 238, }, /* 778 */ + { 100, 25, 12, 0, 0, 12288, 240, }, /* 779 */ + { 100, 25, 12, 0, 0, 28672, 238, }, /* 780 */ + { 100, 22, 12, 0, 0, 28672, 242, }, /* 781 */ + { 100, 18, 12, 0, 0, 28672, 242, }, /* 782 */ + { 0, 6, 12, 0, 0, 18432, 182, }, /* 783 */ + { 99, 2, 12, 0, 0, 14336, 0, }, /* 784 */ + { 107, 12, 3, 0, 0, 26624, 244, }, /* 785 */ + { 107, 11, 3, 0, 0, 26624, 124, }, /* 786 */ + { 107, 11, 3, 0, 0, 26624, 246, }, /* 787 */ + { 107, 12, 3, 0, 0, 26968, 104, }, /* 788 */ + { 100, 26, 12, 0, 0, 28672, 74, }, /* 789 */ + { 100, 9, 12, 0, 0, 18432, 116, }, /* 790 */ + { 100, 5, 12, 0, 0, 18432, 248, }, /* 791 */ + { 100, 25, 12, 0, 0, 28672, 250, }, /* 792 */ + { 100, 26, 14, 0, 0, 28672, 252, }, /* 793 */ + { 1, 9, 12, 96, -7517, 18432, 76, }, /* 794 */ + { 100, 26, 12, 0, 0, 28672, 122, }, /* 795 */ + { 0, 9, 12, 100, 0, 18432, 76, }, /* 796 */ + { 0, 9, 12, 104, -8262, 18432, 76, }, /* 797 */ + { 100, 26, 12, 0, 0, 14336, 254, }, /* 798 */ + { 0, 9, 12, 0, 28, 18432, 76, }, /* 799 */ + { 100, 7, 12, 0, 0, 18432, 256, }, /* 800 */ + { 100, 5, 14, 0, 0, 18432, 258, }, /* 801 */ + { 100, 25, 12, 0, 0, 28672, 122, }, /* 802 */ + { 100, 5, 12, 0, 0, 18432, 260, }, /* 803 */ + { 0, 5, 12, 0, -28, 18432, 78, }, /* 804 */ + { 0, 14, 12, 0, 16, 18432, 76, }, /* 805 */ + { 0, 14, 12, 0, -16, 18432, 78, }, /* 806 */ + { 0, 14, 12, 0, 0, 18432, 84, }, /* 807 */ + { 100, 25, 14, 0, 0, 28672, 262, }, /* 808 */ + { 100, 26, 14, 0, 0, 28672, 262, }, /* 809 */ + { 100, 26, 12, 0, 0, 28672, 64, }, /* 810 */ + { 100, 25, 12, 0, 0, 28672, 264, }, /* 811 */ + { 100, 25, 12, 0, 0, 28672, 266, }, /* 812 */ + { 100, 25, 12, 0, 0, 12288, 268, }, /* 813 */ + { 100, 22, 12, 0, 0, 28672, 266, }, /* 814 */ + { 100, 18, 12, 0, 0, 28672, 266, }, /* 815 */ + { 100, 26, 14, 0, 0, 28672, 270, }, /* 816 */ + { 100, 22, 12, 0, 0, 28672, 272, }, /* 817 */ + { 100, 18, 12, 0, 0, 28672, 272, }, /* 818 */ + { 100, 26, 12, 0, 0, 18432, 54, }, /* 819 */ + { 99, 2, 12, 0, 0, 18432, 274, }, /* 820 */ + { 100, 15, 12, 0, 0, 10240, 74, }, /* 821 */ + { 100, 26, 12, 0, 26, 18432, 276, }, /* 822 */ + { 100, 26, 14, 0, 26, 18432, 278, }, /* 823 */ + { 100, 26, 12, 0, -26, 18432, 280, }, /* 824 */ + { 100, 25, 14, 0, 0, 28672, 282, }, /* 825 */ + { 100, 26, 14, 0, 0, 28672, 284, }, /* 826 */ + { 100, 26, 14, 0, 0, 28672, 286, }, /* 827 */ + { 110, 26, 12, 0, 0, 18432, 54, }, /* 828 */ + { 100, 26, 12, 0, 0, 28672, 228, }, /* 829 */ + { 44, 9, 12, 0, 48, 18432, 76, }, /* 830 */ + { 44, 5, 12, 0, -48, 18432, 78, }, /* 831 */ + { 0, 9, 12, 0, -10743, 18432, 76, }, /* 832 */ + { 0, 9, 12, 0, -3814, 18432, 76, }, /* 833 */ + { 0, 9, 12, 0, -10727, 18432, 76, }, /* 834 */ + { 0, 5, 12, 0, -10795, 18432, 78, }, /* 835 */ + { 0, 5, 12, 0, -10792, 18432, 78, }, /* 836 */ + { 0, 9, 12, 0, -10780, 18432, 76, }, /* 837 */ + { 0, 9, 12, 0, -10749, 18432, 76, }, /* 838 */ + { 0, 9, 12, 0, -10783, 18432, 76, }, /* 839 */ + { 0, 9, 12, 0, -10782, 18432, 76, }, /* 840 */ + { 0, 9, 12, 0, -10815, 18432, 76, }, /* 841 */ + { 43, 5, 12, 0, 0, 18432, 60, }, /* 842 */ + { 43, 26, 12, 0, 0, 28672, 74, }, /* 843 */ + { 43, 12, 3, 0, 0, 26624, 98, }, /* 844 */ + { 43, 21, 12, 0, 0, 28672, 128, }, /* 845 */ + { 43, 21, 12, 0, 0, 28672, 74, }, /* 846 */ + { 43, 15, 12, 0, 0, 28672, 74, }, /* 847 */ + { 21, 5, 12, 0, -7264, 18432, 78, }, /* 848 */ + { 45, 7, 12, 0, 0, 18432, 84, }, /* 849 */ + { 45, 6, 12, 0, 0, 18432, 148, }, /* 850 */ + { 45, 21, 12, 0, 0, 18432, 74, }, /* 851 */ + { 45, 12, 3, 0, 0, 26624, 288, }, /* 852 */ + { 2, 12, 3, 0, 0, 26624, 106, }, /* 853 */ + { 100, 20, 12, 0, 0, 28672, 228, }, /* 854 */ + { 100, 19, 12, 0, 0, 28672, 228, }, /* 855 */ + { 100, 17, 12, 0, 0, 29020, 212, }, /* 856 */ + { 100, 6, 12, 0, 0, 28672, 290, }, /* 857 */ + { 100, 21, 12, 0, 0, 29024, 54, }, /* 858 */ + { 100, 21, 12, 0, 0, 29028, 54, }, /* 859 */ + { 100, 21, 12, 0, 0, 29032, 224, }, /* 860 */ + { 100, 21, 12, 0, 0, 29036, 292, }, /* 861 */ + { 100, 21, 12, 0, 0, 28812, 54, }, /* 862 */ + { 100, 21, 12, 0, 0, 28672, 292, }, /* 863 */ + { 30, 26, 12, 0, 0, 28672, 294, }, /* 864 */ + { 100, 26, 12, 0, 0, 29040, 296, }, /* 865 */ + { 100, 26, 12, 0, 0, 29040, 298, }, /* 866 */ + { 100, 26, 12, 0, 0, 29040, 300, }, /* 867 */ + { 100, 21, 12, 0, 0, 29044, 292, }, /* 868 */ + { 100, 21, 12, 0, 0, 29048, 224, }, /* 869 */ + { 100, 21, 12, 0, 0, 29052, 54, }, /* 870 */ + { 30, 6, 12, 0, 0, 18432, 138, }, /* 871 */ + { 100, 7, 12, 0, 0, 18816, 302, }, /* 872 */ + { 30, 14, 12, 0, 0, 18432, 302, }, /* 873 */ + { 100, 22, 12, 0, 0, 29060, 228, }, /* 874 */ + { 100, 18, 12, 0, 0, 29060, 228, }, /* 875 */ + { 100, 22, 12, 0, 0, 29064, 228, }, /* 876 */ + { 100, 18, 12, 0, 0, 29064, 228, }, /* 877 */ + { 100, 22, 12, 0, 0, 29068, 62, }, /* 878 */ + { 100, 18, 12, 0, 0, 29068, 62, }, /* 879 */ + { 100, 22, 12, 0, 0, 29068, 228, }, /* 880 */ + { 100, 18, 12, 0, 0, 29068, 228, }, /* 881 */ + { 100, 26, 12, 0, 0, 29052, 54, }, /* 882 */ + { 100, 17, 12, 0, 0, 29052, 212, }, /* 883 */ + { 100, 22, 12, 0, 0, 29052, 216, }, /* 884 */ + { 100, 18, 12, 0, 0, 29052, 216, }, /* 885 */ + { 107, 12, 3, 0, 0, 27024, 98, }, /* 886 */ + { 22, 10, 3, 0, 0, 18432, 304, }, /* 887 */ + { 100, 17, 14, 0, 0, 29052, 306, }, /* 888 */ + { 100, 6, 12, 0, 0, 18836, 138, }, /* 889 */ + { 100, 26, 12, 0, 0, 29052, 74, }, /* 890 */ + { 30, 6, 12, 0, 0, 18432, 148, }, /* 891 */ + { 100, 7, 12, 0, 0, 18840, 84, }, /* 892 */ + { 100, 21, 14, 0, 0, 29080, 252, }, /* 893 */ + { 100, 26, 12, 0, 0, 29056, 74, }, /* 894 */ + { 27, 7, 12, 0, 0, 18432, 84, }, /* 895 */ + { 107, 12, 3, 0, 0, 27028, 98, }, /* 896 */ + { 100, 24, 12, 0, 0, 29076, 308, }, /* 897 */ + { 27, 6, 12, 0, 0, 18432, 138, }, /* 898 */ + { 100, 17, 12, 0, 0, 29076, 130, }, /* 899 */ + { 28, 7, 12, 0, 0, 18432, 84, }, /* 900 */ + { 100, 21, 12, 0, 0, 29068, 144, }, /* 901 */ + { 100, 6, 12, 0, 0, 18836, 96, }, /* 902 */ + { 28, 6, 12, 0, 0, 18432, 138, }, /* 903 */ + { 29, 7, 12, 0, 0, 18432, 84, }, /* 904 */ + { 22, 7, 12, 0, 0, 18432, 84, }, /* 905 */ + { 22, 7, 12, 0, 0, 18432, 184, }, /* 906 */ + { 100, 26, 12, 0, 0, 18816, 74, }, /* 907 */ + { 100, 15, 12, 0, 0, 18816, 74, }, /* 908 */ + { 22, 26, 12, 0, 0, 18432, 74, }, /* 909 */ + { 22, 26, 12, 0, 0, 28672, 74, }, /* 910 */ + { 100, 15, 12, 0, 0, 18432, 74, }, /* 911 */ + { 100, 26, 14, 0, 0, 18816, 252, }, /* 912 */ + { 28, 26, 12, 0, 0, 18432, 74, }, /* 913 */ + { 30, 7, 12, 0, 0, 18432, 310, }, /* 914 */ + { 31, 7, 12, 0, 0, 18432, 84, }, /* 915 */ + { 31, 6, 12, 0, 0, 18432, 138, }, /* 916 */ + { 31, 26, 12, 0, 0, 28672, 74, }, /* 917 */ + { 55, 7, 12, 0, 0, 18432, 84, }, /* 918 */ + { 55, 6, 12, 0, 0, 18432, 148, }, /* 919 */ + { 55, 21, 12, 0, 0, 18432, 110, }, /* 920 */ + { 55, 21, 12, 0, 0, 18432, 128, }, /* 921 */ + { 120, 7, 12, 0, 0, 18432, 84, }, /* 922 */ + { 120, 6, 12, 0, 0, 18432, 138, }, /* 923 */ + { 120, 21, 12, 0, 0, 28672, 110, }, /* 924 */ + { 120, 21, 12, 0, 0, 28672, 128, }, /* 925 */ + { 120, 13, 12, 0, 0, 18432, 144, }, /* 926 */ + { 2, 9, 12, 108, 1, 18432, 76, }, /* 927 */ + { 2, 5, 12, 108, -35267, 18432, 78, }, /* 928 */ + { 2, 7, 12, 0, 0, 18432, 84, }, /* 929 */ + { 2, 21, 12, 0, 0, 28672, 74, }, /* 930 */ + { 2, 12, 3, 0, 0, 26624, 98, }, /* 931 */ + { 2, 6, 12, 0, 0, 28672, 94, }, /* 932 */ + { 2, 6, 12, 0, 0, 18432, 90, }, /* 933 */ + { 127, 7, 12, 0, 0, 18432, 84, }, /* 934 */ + { 127, 14, 12, 0, 0, 18432, 84, }, /* 935 */ + { 127, 12, 3, 0, 0, 26624, 98, }, /* 936 */ + { 127, 21, 12, 0, 0, 18432, 74, }, /* 937 */ + { 127, 21, 12, 0, 0, 18432, 128, }, /* 938 */ + { 127, 21, 12, 0, 0, 18432, 110, }, /* 939 */ + { 100, 24, 12, 0, 0, 29084, 56, }, /* 940 */ + { 0, 9, 12, 0, -35332, 18432, 76, }, /* 941 */ + { 100, 24, 12, 0, 0, 18432, 56, }, /* 942 */ + { 0, 9, 12, 0, -42280, 18432, 76, }, /* 943 */ + { 0, 5, 12, 0, 48, 18432, 78, }, /* 944 */ + { 0, 9, 12, 0, -42308, 18432, 76, }, /* 945 */ + { 0, 9, 12, 0, -42319, 18432, 76, }, /* 946 */ + { 0, 9, 12, 0, -42315, 18432, 76, }, /* 947 */ + { 0, 9, 12, 0, -42305, 18432, 76, }, /* 948 */ + { 0, 9, 12, 0, -42258, 18432, 76, }, /* 949 */ + { 0, 9, 12, 0, -42282, 18432, 76, }, /* 950 */ + { 0, 9, 12, 0, -42261, 18432, 76, }, /* 951 */ + { 0, 9, 12, 0, 928, 18432, 76, }, /* 952 */ + { 0, 9, 12, 0, -48, 18432, 76, }, /* 953 */ + { 0, 9, 12, 0, -42307, 18432, 76, }, /* 954 */ + { 0, 9, 12, 0, -35384, 18432, 76, }, /* 955 */ + { 0, 9, 12, 0, -42343, 18432, 76, }, /* 956 */ + { 0, 9, 12, 0, -42561, 18432, 76, }, /* 957 */ + { 46, 7, 12, 0, 0, 18432, 84, }, /* 958 */ + { 46, 12, 3, 0, 0, 26624, 106, }, /* 959 */ + { 46, 12, 3, 0, 0, 26624, 158, }, /* 960 */ + { 46, 10, 5, 0, 0, 18432, 154, }, /* 961 */ + { 46, 26, 12, 0, 0, 28672, 74, }, /* 962 */ + { 100, 15, 12, 0, 0, 18848, 74, }, /* 963 */ + { 100, 15, 12, 0, 0, 18852, 74, }, /* 964 */ + { 100, 26, 12, 0, 0, 18856, 74, }, /* 965 */ + { 100, 23, 12, 0, 0, 14764, 74, }, /* 966 */ + { 100, 26, 12, 0, 0, 14760, 74, }, /* 967 */ + { 47, 7, 12, 0, 0, 18432, 84, }, /* 968 */ + { 47, 21, 12, 0, 0, 28672, 74, }, /* 969 */ + { 47, 21, 12, 0, 0, 28672, 128, }, /* 970 */ + { 121, 10, 5, 0, 0, 18432, 154, }, /* 971 */ + { 121, 7, 12, 0, 0, 18432, 84, }, /* 972 */ + { 121, 12, 3, 0, 0, 26624, 158, }, /* 973 */ + { 121, 12, 3, 0, 0, 26624, 106, }, /* 974 */ + { 121, 21, 12, 0, 0, 18432, 128, }, /* 975 */ + { 121, 13, 12, 0, 0, 18432, 144, }, /* 976 */ + { 8, 12, 3, 0, 0, 27056, 98, }, /* 977 */ + { 8, 7, 12, 0, 0, 18868, 84, }, /* 978 */ + { 49, 13, 12, 0, 0, 18432, 144, }, /* 979 */ + { 49, 7, 12, 0, 0, 18432, 84, }, /* 980 */ + { 49, 12, 3, 0, 0, 26624, 106, }, /* 981 */ + { 49, 12, 3, 0, 0, 26624, 98, }, /* 982 */ + { 100, 21, 12, 0, 0, 18872, 202, }, /* 983 */ + { 49, 21, 12, 0, 0, 18432, 128, }, /* 984 */ + { 122, 7, 12, 0, 0, 18432, 84, }, /* 985 */ + { 122, 12, 3, 0, 0, 26624, 106, }, /* 986 */ + { 122, 10, 5, 0, 0, 18432, 154, }, /* 987 */ + { 122, 10, 3, 0, 0, 18432, 188, }, /* 988 */ + { 122, 21, 12, 0, 0, 18432, 74, }, /* 989 */ + { 56, 12, 3, 0, 0, 26624, 106, }, /* 990 */ + { 56, 10, 5, 0, 0, 18432, 154, }, /* 991 */ + { 56, 7, 12, 0, 0, 18432, 84, }, /* 992 */ + { 56, 7, 12, 0, 0, 18432, 156, }, /* 993 */ + { 56, 12, 3, 0, 0, 26624, 98, }, /* 994 */ + { 56, 10, 3, 0, 0, 18432, 188, }, /* 995 */ + { 56, 21, 12, 0, 0, 18432, 74, }, /* 996 */ + { 56, 21, 12, 0, 0, 18432, 110, }, /* 997 */ + { 56, 21, 12, 0, 0, 18432, 128, }, /* 998 */ + { 100, 6, 12, 0, 0, 18876, 138, }, /* 999 */ + { 56, 13, 12, 0, 0, 18432, 144, }, /* 1000 */ + { 20, 6, 12, 0, 0, 18432, 138, }, /* 1001 */ + { 123, 7, 12, 0, 0, 18432, 84, }, /* 1002 */ + { 123, 12, 3, 0, 0, 26624, 106, }, /* 1003 */ + { 123, 10, 5, 0, 0, 18432, 154, }, /* 1004 */ + { 123, 13, 12, 0, 0, 18432, 144, }, /* 1005 */ + { 123, 21, 12, 0, 0, 18432, 74, }, /* 1006 */ + { 123, 21, 12, 0, 0, 18432, 128, }, /* 1007 */ + { 20, 7, 12, 0, 0, 18432, 84, }, /* 1008 */ + { 125, 7, 12, 0, 0, 18432, 84, }, /* 1009 */ + { 125, 12, 3, 0, 0, 26624, 106, }, /* 1010 */ + { 125, 7, 12, 0, 0, 18432, 170, }, /* 1011 */ + { 125, 12, 3, 0, 0, 26624, 98, }, /* 1012 */ + { 125, 7, 12, 0, 0, 18432, 312, }, /* 1013 */ + { 125, 6, 12, 0, 0, 18432, 138, }, /* 1014 */ + { 125, 21, 12, 0, 0, 18432, 74, }, /* 1015 */ + { 125, 21, 12, 0, 0, 18432, 110, }, /* 1016 */ + { 128, 7, 12, 0, 0, 18432, 156, }, /* 1017 */ + { 128, 10, 5, 0, 0, 18432, 154, }, /* 1018 */ + { 128, 12, 3, 0, 0, 26624, 106, }, /* 1019 */ + { 128, 21, 12, 0, 0, 18432, 128, }, /* 1020 */ + { 128, 7, 12, 0, 0, 18432, 84, }, /* 1021 */ + { 128, 6, 12, 0, 0, 18432, 138, }, /* 1022 */ + { 128, 12, 3, 0, 0, 26624, 158, }, /* 1023 */ + { 0, 5, 12, 0, -928, 18432, 78, }, /* 1024 */ + { 24, 5, 12, 0, -38864, 18432, 70, }, /* 1025 */ + { 128, 10, 5, 0, 0, 18432, 174, }, /* 1026 */ + { 128, 13, 12, 0, 0, 18432, 144, }, /* 1027 */ + { 22, 7, 9, 0, 0, 18432, 84, }, /* 1028 */ + { 22, 7, 10, 0, 0, 18432, 84, }, /* 1029 */ + { 99, 4, 12, 0, 0, 18432, 0, }, /* 1030 */ + { 99, 3, 12, 0, 0, 18432, 0, }, /* 1031 */ + { 30, 7, 12, 0, 0, 18432, 302, }, /* 1032 */ + { 0, 5, 12, 0, 1, 18432, 70, }, /* 1033 */ + { 0, 5, 12, 0, -1, 18432, 70, }, /* 1034 */ + { 4, 25, 12, 0, 0, 12288, 122, }, /* 1035 */ + { 5, 7, 12, 0, 0, 0, 314, }, /* 1036 */ + { 100, 18, 12, 0, 0, 29120, 54, }, /* 1037 */ + { 100, 22, 12, 0, 0, 29120, 54, }, /* 1038 */ + { 99, 2, 12, 0, 0, 6144, 316, }, /* 1039 */ + { 5, 7, 12, 0, 0, 452, 84, }, /* 1040 */ + { 5, 26, 12, 0, 0, 29124, 74, }, /* 1041 */ + { 107, 12, 3, 0, 0, 26624, 194, }, /* 1042 */ + { 107, 12, 3, 0, 0, 26624, 318, }, /* 1043 */ + { 100, 21, 12, 0, 0, 28672, 74, }, /* 1044 */ + { 100, 21, 12, 0, 0, 28672, 128, }, /* 1045 */ + { 100, 21, 12, 0, 0, 28672, 126, }, /* 1046 */ + { 100, 22, 12, 0, 0, 28672, 74, }, /* 1047 */ + { 100, 18, 12, 0, 0, 28672, 74, }, /* 1048 */ + { 100, 17, 12, 0, 0, 28672, 130, }, /* 1049 */ + { 100, 22, 12, 0, 0, 28672, 320, }, /* 1050 */ + { 100, 18, 12, 0, 0, 28672, 320, }, /* 1051 */ + { 100, 21, 12, 0, 0, 8192, 110, }, /* 1052 */ + { 100, 21, 12, 0, 0, 8192, 322, }, /* 1053 */ + { 100, 21, 12, 0, 0, 8192, 324, }, /* 1054 */ + { 100, 22, 12, 0, 0, 28672, 172, }, /* 1055 */ + { 100, 18, 12, 0, 0, 28672, 172, }, /* 1056 */ + { 100, 21, 12, 0, 0, 14336, 74, }, /* 1057 */ + { 100, 21, 12, 0, 0, 28672, 122, }, /* 1058 */ + { 100, 25, 12, 0, 0, 12288, 122, }, /* 1059 */ + { 100, 17, 12, 0, 0, 12288, 326, }, /* 1060 */ + { 100, 25, 12, 0, 0, 28672, 328, }, /* 1061 */ + { 100, 21, 12, 0, 0, 28672, 320, }, /* 1062 */ + { 100, 21, 12, 0, 0, 28672, 330, }, /* 1063 */ + { 100, 17, 12, 0, 0, 12288, 130, }, /* 1064 */ + { 100, 21, 12, 0, 0, 8192, 74, }, /* 1065 */ + { 100, 13, 12, 0, 0, 10240, 332, }, /* 1066 */ + { 0, 9, 12, 0, 32, 18432, 334, }, /* 1067 */ + { 100, 24, 12, 0, 0, 28672, 336, }, /* 1068 */ + { 0, 5, 12, 0, -32, 18432, 338, }, /* 1069 */ + { 100, 21, 12, 0, 0, 29068, 128, }, /* 1070 */ + { 100, 22, 12, 0, 0, 29068, 340, }, /* 1071 */ + { 100, 18, 12, 0, 0, 29068, 340, }, /* 1072 */ + { 100, 21, 12, 0, 0, 29068, 110, }, /* 1073 */ + { 100, 6, 3, 0, 0, 18836, 342, }, /* 1074 */ + { 100, 1, 2, 0, 0, 28672, 344, }, /* 1075 */ + { 39, 7, 12, 0, 0, 18432, 84, }, /* 1076 */ + { 100, 21, 12, 0, 0, 18888, 74, }, /* 1077 */ + { 100, 21, 12, 0, 0, 29128, 74, }, /* 1078 */ + { 100, 21, 12, 0, 0, 18892, 74, }, /* 1079 */ + { 100, 15, 12, 0, 0, 18896, 74, }, /* 1080 */ + { 100, 26, 12, 0, 0, 18892, 74, }, /* 1081 */ + { 1, 14, 12, 0, 0, 28672, 84, }, /* 1082 */ + { 1, 15, 12, 0, 0, 28672, 74, }, /* 1083 */ + { 1, 26, 12, 0, 0, 28672, 74, }, /* 1084 */ + { 1, 26, 12, 0, 0, 18432, 74, }, /* 1085 */ + { 50, 7, 12, 0, 0, 18432, 84, }, /* 1086 */ + { 51, 7, 12, 0, 0, 18432, 84, }, /* 1087 */ + { 107, 12, 3, 0, 0, 27092, 98, }, /* 1088 */ + { 100, 15, 12, 0, 0, 10708, 74, }, /* 1089 */ + { 105, 7, 12, 0, 0, 18432, 84, }, /* 1090 */ + { 105, 15, 12, 0, 0, 18432, 74, }, /* 1091 */ + { 32, 7, 12, 0, 0, 18432, 84, }, /* 1092 */ + { 32, 14, 12, 0, 0, 18432, 84, }, /* 1093 */ + { 73, 7, 12, 0, 0, 18432, 84, }, /* 1094 */ + { 73, 12, 3, 0, 0, 26624, 106, }, /* 1095 */ + { 108, 7, 12, 0, 0, 18432, 84, }, /* 1096 */ + { 108, 21, 12, 0, 0, 18432, 110, }, /* 1097 */ + { 112, 7, 12, 0, 0, 18432, 84, }, /* 1098 */ + { 112, 21, 12, 0, 0, 18432, 110, }, /* 1099 */ + { 112, 14, 12, 0, 0, 18432, 84, }, /* 1100 */ + { 106, 9, 12, 0, 40, 18432, 76, }, /* 1101 */ + { 106, 5, 12, 0, -40, 18432, 78, }, /* 1102 */ + { 40, 7, 12, 0, 0, 18432, 84, }, /* 1103 */ + { 109, 7, 12, 0, 0, 18432, 84, }, /* 1104 */ + { 109, 13, 12, 0, 0, 18432, 144, }, /* 1105 */ + { 81, 9, 12, 0, 40, 18432, 76, }, /* 1106 */ + { 81, 5, 12, 0, -40, 18432, 78, }, /* 1107 */ + { 66, 7, 12, 0, 0, 18432, 84, }, /* 1108 */ + { 64, 7, 12, 0, 0, 18432, 84, }, /* 1109 */ + { 64, 21, 12, 0, 0, 18432, 74, }, /* 1110 */ + { 167, 9, 12, 0, 39, 18432, 76, }, /* 1111 */ + { 167, 5, 12, 0, -39, 18432, 78, }, /* 1112 */ + { 97, 7, 12, 0, 0, 18432, 84, }, /* 1113 */ + { 69, 7, 12, 0, 0, 18432, 84, }, /* 1114 */ + { 0, 6, 12, 0, 0, 18432, 96, }, /* 1115 */ + { 41, 7, 12, 0, 0, 34816, 84, }, /* 1116 */ + { 129, 7, 12, 0, 0, 34816, 84, }, /* 1117 */ + { 129, 21, 12, 0, 0, 34816, 110, }, /* 1118 */ + { 129, 15, 12, 0, 0, 34816, 74, }, /* 1119 */ + { 144, 7, 12, 0, 0, 34816, 84, }, /* 1120 */ + { 144, 26, 12, 0, 0, 34816, 74, }, /* 1121 */ + { 144, 15, 12, 0, 0, 34816, 74, }, /* 1122 */ + { 143, 7, 12, 0, 0, 34816, 84, }, /* 1123 */ + { 143, 15, 12, 0, 0, 34816, 74, }, /* 1124 */ + { 150, 7, 12, 0, 0, 34816, 84, }, /* 1125 */ + { 150, 15, 12, 0, 0, 34816, 74, }, /* 1126 */ + { 116, 7, 12, 0, 0, 34816, 84, }, /* 1127 */ + { 116, 15, 12, 0, 0, 34816, 74, }, /* 1128 */ + { 116, 21, 12, 0, 0, 28672, 110, }, /* 1129 */ + { 52, 7, 12, 0, 0, 34816, 84, }, /* 1130 */ + { 52, 21, 12, 0, 0, 34816, 74, }, /* 1131 */ + { 171, 7, 12, 0, 0, 34816, 84, }, /* 1132 */ + { 61, 7, 12, 0, 0, 34816, 84, }, /* 1133 */ + { 135, 7, 12, 0, 0, 34816, 84, }, /* 1134 */ + { 135, 15, 12, 0, 0, 34816, 74, }, /* 1135 */ + { 113, 7, 12, 0, 0, 34816, 156, }, /* 1136 */ + { 113, 12, 3, 0, 0, 26624, 106, }, /* 1137 */ + { 113, 12, 3, 0, 0, 26624, 98, }, /* 1138 */ + { 113, 12, 3, 0, 0, 26624, 158, }, /* 1139 */ + { 113, 15, 12, 0, 0, 34816, 74, }, /* 1140 */ + { 113, 21, 12, 0, 0, 34816, 74, }, /* 1141 */ + { 113, 21, 12, 0, 0, 34816, 128, }, /* 1142 */ + { 130, 7, 12, 0, 0, 34816, 84, }, /* 1143 */ + { 130, 15, 12, 0, 0, 34816, 74, }, /* 1144 */ + { 130, 21, 12, 0, 0, 34816, 74, }, /* 1145 */ + { 142, 7, 12, 0, 0, 34816, 84, }, /* 1146 */ + { 142, 15, 12, 0, 0, 34816, 74, }, /* 1147 */ + { 71, 7, 12, 0, 0, 34816, 84, }, /* 1148 */ + { 71, 26, 12, 0, 0, 34816, 74, }, /* 1149 */ + { 71, 12, 3, 0, 0, 26624, 98, }, /* 1150 */ + { 71, 15, 12, 0, 0, 34816, 74, }, /* 1151 */ + { 71, 21, 12, 0, 0, 34816, 110, }, /* 1152 */ + { 71, 21, 12, 0, 0, 35288, 110, }, /* 1153 */ + { 71, 21, 12, 0, 0, 34816, 74, }, /* 1154 */ + { 53, 7, 12, 0, 0, 34816, 84, }, /* 1155 */ + { 53, 21, 12, 0, 0, 28672, 74, }, /* 1156 */ + { 53, 21, 12, 0, 0, 28672, 110, }, /* 1157 */ + { 131, 7, 12, 0, 0, 34816, 84, }, /* 1158 */ + { 131, 15, 12, 0, 0, 34816, 74, }, /* 1159 */ + { 132, 7, 12, 0, 0, 34816, 84, }, /* 1160 */ + { 132, 15, 12, 0, 0, 34816, 74, }, /* 1161 */ + { 74, 7, 12, 0, 0, 34816, 84, }, /* 1162 */ + { 74, 21, 12, 0, 0, 34816, 110, }, /* 1163 */ + { 74, 15, 12, 0, 0, 34816, 74, }, /* 1164 */ + { 57, 7, 12, 0, 0, 34816, 84, }, /* 1165 */ + { 78, 9, 12, 0, 64, 34816, 76, }, /* 1166 */ + { 78, 5, 12, 0, -64, 34816, 78, }, /* 1167 */ + { 78, 15, 12, 0, 0, 34816, 74, }, /* 1168 */ + { 86, 7, 12, 0, 0, 0, 84, }, /* 1169 */ + { 86, 7, 12, 0, 0, 0, 312, }, /* 1170 */ + { 86, 12, 3, 0, 0, 26624, 132, }, /* 1171 */ + { 86, 13, 12, 0, 0, 2048, 144, }, /* 1172 */ + { 93, 13, 12, 0, 0, 2048, 144, }, /* 1173 */ + { 93, 7, 12, 0, 0, 34816, 84, }, /* 1174 */ + { 93, 6, 12, 0, 0, 34816, 96, }, /* 1175 */ + { 93, 9, 12, 0, 32, 34816, 76, }, /* 1176 */ + { 93, 12, 3, 0, 0, 26624, 132, }, /* 1177 */ + { 93, 12, 3, 0, 0, 26624, 164, }, /* 1178 */ + { 93, 12, 3, 0, 0, 26624, 98, }, /* 1179 */ + { 93, 17, 12, 0, 0, 28672, 130, }, /* 1180 */ + { 93, 6, 12, 0, 0, 34816, 138, }, /* 1181 */ + { 93, 5, 12, 0, -32, 34816, 78, }, /* 1182 */ + { 93, 25, 12, 0, 0, 34816, 122, }, /* 1183 */ + { 5, 15, 12, 0, 0, 2048, 74, }, /* 1184 */ + { 89, 7, 12, 0, 0, 34816, 84, }, /* 1185 */ + { 89, 12, 3, 0, 0, 26624, 106, }, /* 1186 */ + { 89, 17, 12, 0, 0, 34816, 130, }, /* 1187 */ + { 5, 6, 12, 0, 0, 0, 148, }, /* 1188 */ + { 5, 21, 12, 0, 0, 28672, 74, }, /* 1189 */ + { 159, 7, 12, 0, 0, 34816, 84, }, /* 1190 */ + { 159, 15, 12, 0, 0, 34816, 74, }, /* 1191 */ + { 87, 7, 12, 0, 0, 0, 84, }, /* 1192 */ + { 87, 12, 3, 0, 0, 26624, 98, }, /* 1193 */ + { 87, 15, 12, 0, 0, 0, 74, }, /* 1194 */ + { 87, 21, 12, 0, 0, 0, 128, }, /* 1195 */ + { 91, 7, 12, 0, 0, 34816, 84, }, /* 1196 */ + { 91, 12, 3, 0, 0, 26624, 98, }, /* 1197 */ + { 91, 21, 12, 0, 0, 34816, 128, }, /* 1198 */ + { 163, 7, 12, 0, 0, 34816, 84, }, /* 1199 */ + { 163, 15, 12, 0, 0, 34816, 74, }, /* 1200 */ + { 160, 7, 12, 0, 0, 34816, 84, }, /* 1201 */ + { 134, 10, 5, 0, 0, 18432, 154, }, /* 1202 */ + { 134, 12, 3, 0, 0, 26624, 106, }, /* 1203 */ + { 134, 7, 12, 0, 0, 18432, 84, }, /* 1204 */ + { 134, 12, 3, 0, 0, 26624, 158, }, /* 1205 */ + { 134, 21, 12, 0, 0, 18432, 128, }, /* 1206 */ + { 134, 21, 12, 0, 0, 18432, 110, }, /* 1207 */ + { 134, 15, 12, 0, 0, 28672, 74, }, /* 1208 */ + { 134, 13, 12, 0, 0, 18432, 144, }, /* 1209 */ + { 134, 12, 3, 0, 0, 26624, 288, }, /* 1210 */ + { 58, 12, 3, 0, 0, 26624, 106, }, /* 1211 */ + { 58, 10, 5, 0, 0, 18432, 154, }, /* 1212 */ + { 58, 7, 12, 0, 0, 18432, 84, }, /* 1213 */ + { 58, 12, 3, 0, 0, 26624, 158, }, /* 1214 */ + { 58, 12, 3, 0, 0, 26624, 98, }, /* 1215 */ + { 58, 21, 12, 0, 0, 18432, 74, }, /* 1216 */ + { 58, 1, 4, 0, 0, 18432, 134, }, /* 1217 */ + { 58, 21, 12, 0, 0, 18432, 128, }, /* 1218 */ + { 137, 7, 12, 0, 0, 18432, 84, }, /* 1219 */ + { 137, 13, 12, 0, 0, 18432, 144, }, /* 1220 */ + { 60, 12, 3, 0, 0, 26624, 106, }, /* 1221 */ + { 60, 7, 12, 0, 0, 18432, 156, }, /* 1222 */ + { 60, 10, 5, 0, 0, 18432, 154, }, /* 1223 */ + { 60, 12, 3, 0, 0, 26624, 158, }, /* 1224 */ + { 60, 13, 12, 0, 0, 18432, 144, }, /* 1225 */ + { 60, 21, 12, 0, 0, 18432, 74, }, /* 1226 */ + { 60, 21, 12, 0, 0, 18432, 128, }, /* 1227 */ + { 70, 7, 12, 0, 0, 18432, 84, }, /* 1228 */ + { 70, 12, 3, 0, 0, 26624, 98, }, /* 1229 */ + { 70, 21, 12, 0, 0, 18432, 74, }, /* 1230 */ + { 62, 12, 3, 0, 0, 26624, 106, }, /* 1231 */ + { 62, 10, 5, 0, 0, 18432, 154, }, /* 1232 */ + { 62, 7, 12, 0, 0, 18432, 84, }, /* 1233 */ + { 62, 10, 3, 0, 0, 18432, 188, }, /* 1234 */ + { 62, 7, 4, 0, 0, 18432, 84, }, /* 1235 */ + { 62, 21, 12, 0, 0, 18432, 128, }, /* 1236 */ + { 62, 21, 12, 0, 0, 18432, 74, }, /* 1237 */ + { 62, 12, 3, 0, 0, 26624, 104, }, /* 1238 */ + { 62, 12, 3, 0, 0, 26624, 98, }, /* 1239 */ + { 62, 13, 12, 0, 0, 18432, 144, }, /* 1240 */ + { 17, 15, 12, 0, 0, 18432, 74, }, /* 1241 */ + { 68, 7, 12, 0, 0, 18432, 84, }, /* 1242 */ + { 68, 10, 5, 0, 0, 18432, 154, }, /* 1243 */ + { 68, 12, 3, 0, 0, 26624, 106, }, /* 1244 */ + { 68, 10, 3, 0, 0, 18432, 188, }, /* 1245 */ + { 68, 12, 3, 0, 0, 26624, 98, }, /* 1246 */ + { 68, 12, 3, 0, 0, 26624, 162, }, /* 1247 */ + { 68, 21, 12, 0, 0, 18432, 128, }, /* 1248 */ + { 68, 21, 12, 0, 0, 18432, 110, }, /* 1249 */ + { 68, 21, 12, 0, 0, 18432, 74, }, /* 1250 */ + { 77, 7, 12, 0, 0, 18432, 84, }, /* 1251 */ + { 77, 21, 12, 0, 0, 18432, 128, }, /* 1252 */ + { 75, 7, 12, 0, 0, 18432, 84, }, /* 1253 */ + { 75, 12, 3, 0, 0, 26624, 106, }, /* 1254 */ + { 75, 10, 5, 0, 0, 18432, 154, }, /* 1255 */ + { 75, 12, 3, 0, 0, 26624, 98, }, /* 1256 */ + { 75, 12, 3, 0, 0, 26624, 158, }, /* 1257 */ + { 75, 13, 12, 0, 0, 18432, 144, }, /* 1258 */ + { 67, 12, 3, 0, 0, 26624, 106, }, /* 1259 */ + { 67, 12, 3, 0, 0, 26836, 106, }, /* 1260 */ + { 67, 10, 5, 0, 0, 18432, 154, }, /* 1261 */ + { 67, 10, 5, 0, 0, 18644, 154, }, /* 1262 */ + { 67, 7, 12, 0, 0, 18432, 84, }, /* 1263 */ + { 107, 12, 3, 0, 0, 26836, 98, }, /* 1264 */ + { 67, 12, 3, 0, 0, 26836, 98, }, /* 1265 */ + { 67, 10, 3, 0, 0, 18432, 160, }, /* 1266 */ + { 67, 10, 3, 0, 0, 18432, 188, }, /* 1267 */ + { 67, 7, 12, 0, 0, 18432, 346, }, /* 1268 */ + { 67, 12, 3, 0, 0, 26624, 98, }, /* 1269 */ + { 98, 7, 12, 0, 0, 18432, 156, }, /* 1270 */ + { 98, 7, 12, 0, 0, 18432, 84, }, /* 1271 */ + { 98, 10, 3, 0, 0, 18432, 160, }, /* 1272 */ + { 98, 10, 5, 0, 0, 18432, 154, }, /* 1273 */ + { 98, 12, 3, 0, 0, 26624, 106, }, /* 1274 */ + { 98, 12, 3, 0, 0, 26624, 158, }, /* 1275 */ + { 98, 10, 3, 0, 0, 18432, 188, }, /* 1276 */ + { 98, 7, 4, 0, 0, 18432, 84, }, /* 1277 */ + { 98, 12, 3, 0, 0, 26624, 164, }, /* 1278 */ + { 98, 7, 12, 0, 0, 18432, 348, }, /* 1279 */ + { 98, 21, 12, 0, 0, 18432, 128, }, /* 1280 */ + { 98, 21, 12, 0, 0, 18432, 74, }, /* 1281 */ + { 98, 12, 3, 0, 0, 26624, 98, }, /* 1282 */ + { 80, 7, 12, 0, 0, 18432, 84, }, /* 1283 */ + { 80, 10, 5, 0, 0, 18432, 154, }, /* 1284 */ + { 80, 12, 3, 0, 0, 26624, 106, }, /* 1285 */ + { 80, 12, 3, 0, 0, 26624, 158, }, /* 1286 */ + { 80, 12, 3, 0, 0, 26624, 98, }, /* 1287 */ + { 80, 21, 12, 0, 0, 18432, 128, }, /* 1288 */ + { 80, 21, 12, 0, 0, 18432, 110, }, /* 1289 */ + { 80, 21, 12, 0, 0, 18432, 74, }, /* 1290 */ + { 80, 13, 12, 0, 0, 18432, 144, }, /* 1291 */ + { 80, 12, 3, 0, 0, 26624, 104, }, /* 1292 */ + { 76, 7, 12, 0, 0, 18432, 84, }, /* 1293 */ + { 76, 10, 3, 0, 0, 18432, 160, }, /* 1294 */ + { 76, 10, 5, 0, 0, 18432, 154, }, /* 1295 */ + { 76, 12, 3, 0, 0, 26624, 106, }, /* 1296 */ + { 76, 12, 3, 0, 0, 26624, 158, }, /* 1297 */ + { 76, 12, 3, 0, 0, 26624, 98, }, /* 1298 */ + { 76, 21, 12, 0, 0, 18432, 74, }, /* 1299 */ + { 76, 13, 12, 0, 0, 18432, 144, }, /* 1300 */ + { 146, 7, 12, 0, 0, 18432, 84, }, /* 1301 */ + { 146, 10, 3, 0, 0, 18432, 160, }, /* 1302 */ + { 146, 10, 5, 0, 0, 18432, 154, }, /* 1303 */ + { 146, 12, 3, 0, 0, 26624, 106, }, /* 1304 */ + { 146, 12, 3, 0, 0, 26624, 158, }, /* 1305 */ + { 146, 12, 3, 0, 0, 26624, 98, }, /* 1306 */ + { 146, 21, 12, 0, 0, 18432, 74, }, /* 1307 */ + { 146, 21, 12, 0, 0, 18432, 128, }, /* 1308 */ + { 146, 21, 12, 0, 0, 18432, 110, }, /* 1309 */ + { 146, 21, 12, 0, 0, 18432, 192, }, /* 1310 */ + { 72, 7, 12, 0, 0, 18432, 84, }, /* 1311 */ + { 72, 10, 5, 0, 0, 18432, 154, }, /* 1312 */ + { 72, 12, 3, 0, 0, 26624, 106, }, /* 1313 */ + { 72, 12, 3, 0, 0, 26624, 158, }, /* 1314 */ + { 72, 21, 12, 0, 0, 18432, 128, }, /* 1315 */ + { 72, 21, 12, 0, 0, 18432, 74, }, /* 1316 */ + { 72, 13, 12, 0, 0, 18432, 144, }, /* 1317 */ + { 63, 7, 12, 0, 0, 18432, 84, }, /* 1318 */ + { 63, 12, 3, 0, 0, 26624, 106, }, /* 1319 */ + { 63, 10, 5, 0, 0, 18432, 154, }, /* 1320 */ + { 63, 10, 3, 0, 0, 18432, 188, }, /* 1321 */ + { 63, 12, 3, 0, 0, 26624, 98, }, /* 1322 */ + { 63, 21, 12, 0, 0, 18432, 74, }, /* 1323 */ + { 63, 13, 12, 0, 0, 18432, 144, }, /* 1324 */ + { 148, 7, 12, 0, 0, 18432, 84, }, /* 1325 */ + { 148, 12, 3, 0, 0, 26624, 106, }, /* 1326 */ + { 148, 10, 5, 0, 0, 18432, 154, }, /* 1327 */ + { 148, 10, 12, 0, 0, 18432, 154, }, /* 1328 */ + { 148, 12, 3, 0, 0, 26624, 158, }, /* 1329 */ + { 148, 13, 12, 0, 0, 18432, 144, }, /* 1330 */ + { 148, 15, 12, 0, 0, 18432, 74, }, /* 1331 */ + { 148, 21, 12, 0, 0, 18432, 128, }, /* 1332 */ + { 148, 26, 12, 0, 0, 18432, 74, }, /* 1333 */ + { 84, 7, 12, 0, 0, 18432, 84, }, /* 1334 */ + { 84, 10, 5, 0, 0, 18432, 154, }, /* 1335 */ + { 84, 12, 3, 0, 0, 26624, 106, }, /* 1336 */ + { 84, 12, 3, 0, 0, 26624, 158, }, /* 1337 */ + { 84, 12, 3, 0, 0, 26624, 98, }, /* 1338 */ + { 84, 21, 12, 0, 0, 18432, 74, }, /* 1339 */ + { 147, 9, 12, 0, 32, 18432, 76, }, /* 1340 */ + { 147, 5, 12, 0, -32, 18432, 78, }, /* 1341 */ + { 147, 13, 12, 0, 0, 18432, 144, }, /* 1342 */ + { 147, 15, 12, 0, 0, 18432, 74, }, /* 1343 */ + { 147, 7, 12, 0, 0, 18432, 84, }, /* 1344 */ + { 164, 7, 12, 0, 0, 18432, 156, }, /* 1345 */ + { 164, 10, 3, 0, 0, 18432, 160, }, /* 1346 */ + { 164, 10, 5, 0, 0, 18432, 154, }, /* 1347 */ + { 164, 12, 3, 0, 0, 26624, 106, }, /* 1348 */ + { 164, 10, 3, 0, 0, 18432, 188, }, /* 1349 */ + { 164, 12, 3, 0, 0, 26624, 158, }, /* 1350 */ + { 164, 7, 4, 0, 0, 18432, 84, }, /* 1351 */ + { 164, 12, 3, 0, 0, 26624, 98, }, /* 1352 */ + { 164, 21, 12, 0, 0, 18432, 128, }, /* 1353 */ + { 164, 21, 12, 0, 0, 18432, 74, }, /* 1354 */ + { 164, 13, 12, 0, 0, 18432, 144, }, /* 1355 */ + { 88, 7, 12, 0, 0, 18432, 84, }, /* 1356 */ + { 88, 10, 5, 0, 0, 18432, 154, }, /* 1357 */ + { 88, 12, 3, 0, 0, 26624, 106, }, /* 1358 */ + { 88, 12, 3, 0, 0, 26624, 158, }, /* 1359 */ + { 88, 21, 12, 0, 0, 18432, 74, }, /* 1360 */ + { 156, 7, 12, 0, 0, 18432, 156, }, /* 1361 */ + { 156, 12, 3, 0, 0, 26624, 106, }, /* 1362 */ + { 156, 12, 3, 0, 0, 18432, 106, }, /* 1363 */ + { 156, 12, 3, 0, 0, 26624, 104, }, /* 1364 */ + { 156, 12, 3, 0, 0, 26624, 158, }, /* 1365 */ + { 156, 10, 5, 0, 0, 18432, 154, }, /* 1366 */ + { 156, 7, 12, 0, 0, 18432, 84, }, /* 1367 */ + { 156, 21, 12, 0, 0, 18432, 74, }, /* 1368 */ + { 156, 21, 12, 0, 0, 18432, 128, }, /* 1369 */ + { 155, 7, 12, 0, 0, 18432, 156, }, /* 1370 */ + { 155, 12, 3, 0, 0, 26624, 106, }, /* 1371 */ + { 155, 10, 5, 0, 0, 18432, 154, }, /* 1372 */ + { 155, 7, 4, 0, 0, 18432, 84, }, /* 1373 */ + { 155, 12, 3, 0, 0, 26624, 350, }, /* 1374 */ + { 155, 12, 3, 0, 0, 26624, 158, }, /* 1375 */ + { 155, 21, 12, 0, 0, 18432, 74, }, /* 1376 */ + { 155, 21, 12, 0, 0, 18432, 128, }, /* 1377 */ + { 155, 7, 12, 0, 0, 18432, 84, }, /* 1378 */ + { 155, 21, 12, 0, 0, 18432, 110, }, /* 1379 */ + { 145, 7, 12, 0, 0, 18432, 84, }, /* 1380 */ + { 96, 7, 12, 0, 0, 18432, 84, }, /* 1381 */ + { 96, 21, 12, 0, 0, 18432, 74, }, /* 1382 */ + { 96, 13, 12, 0, 0, 18432, 144, }, /* 1383 */ + { 152, 7, 12, 0, 0, 18432, 84, }, /* 1384 */ + { 152, 10, 5, 0, 0, 18432, 154, }, /* 1385 */ + { 152, 12, 3, 0, 0, 26624, 106, }, /* 1386 */ + { 152, 12, 3, 0, 0, 18432, 158, }, /* 1387 */ + { 152, 21, 12, 0, 0, 18432, 128, }, /* 1388 */ + { 152, 21, 12, 0, 0, 18432, 110, }, /* 1389 */ + { 152, 21, 12, 0, 0, 18432, 74, }, /* 1390 */ + { 152, 13, 12, 0, 0, 18432, 144, }, /* 1391 */ + { 152, 15, 12, 0, 0, 18432, 74, }, /* 1392 */ + { 153, 21, 12, 0, 0, 18432, 74, }, /* 1393 */ + { 153, 21, 12, 0, 0, 18432, 110, }, /* 1394 */ + { 153, 7, 12, 0, 0, 18432, 84, }, /* 1395 */ + { 153, 12, 3, 0, 0, 26624, 106, }, /* 1396 */ + { 153, 10, 5, 0, 0, 18432, 154, }, /* 1397 */ + { 83, 7, 12, 0, 0, 18432, 84, }, /* 1398 */ + { 83, 12, 3, 0, 0, 26624, 106, }, /* 1399 */ + { 83, 12, 3, 0, 0, 26624, 98, }, /* 1400 */ + { 83, 12, 3, 0, 0, 26624, 158, }, /* 1401 */ + { 83, 7, 4, 0, 0, 18432, 84, }, /* 1402 */ + { 83, 13, 12, 0, 0, 18432, 144, }, /* 1403 */ + { 85, 7, 12, 0, 0, 18432, 84, }, /* 1404 */ + { 85, 10, 5, 0, 0, 18432, 154, }, /* 1405 */ + { 85, 12, 3, 0, 0, 26624, 106, }, /* 1406 */ + { 85, 12, 3, 0, 0, 26624, 158, }, /* 1407 */ + { 85, 13, 12, 0, 0, 18432, 144, }, /* 1408 */ + { 173, 7, 12, 0, 0, 18432, 84, }, /* 1409 */ + { 173, 6, 12, 0, 0, 18432, 96, }, /* 1410 */ + { 173, 13, 12, 0, 0, 18432, 144, }, /* 1411 */ + { 157, 7, 12, 0, 0, 18432, 84, }, /* 1412 */ + { 157, 12, 3, 0, 0, 26624, 106, }, /* 1413 */ + { 157, 10, 5, 0, 0, 18432, 154, }, /* 1414 */ + { 157, 21, 12, 0, 0, 18432, 128, }, /* 1415 */ + { 168, 12, 3, 0, 0, 26624, 106, }, /* 1416 */ + { 168, 7, 4, 0, 0, 18432, 84, }, /* 1417 */ + { 168, 10, 5, 0, 0, 18432, 154, }, /* 1418 */ + { 168, 7, 12, 0, 0, 18432, 156, }, /* 1419 */ + { 168, 10, 3, 0, 0, 18432, 188, }, /* 1420 */ + { 168, 12, 3, 0, 0, 26624, 158, }, /* 1421 */ + { 168, 21, 12, 0, 0, 18432, 128, }, /* 1422 */ + { 168, 21, 12, 0, 0, 18432, 74, }, /* 1423 */ + { 168, 13, 12, 0, 0, 18432, 144, }, /* 1424 */ + { 168, 12, 3, 0, 0, 26624, 98, }, /* 1425 */ + { 13, 15, 12, 0, 0, 18432, 74, }, /* 1426 */ + { 13, 21, 12, 0, 0, 18432, 74, }, /* 1427 */ + { 115, 7, 12, 0, 0, 18432, 84, }, /* 1428 */ + { 115, 14, 12, 0, 0, 18432, 84, }, /* 1429 */ + { 115, 21, 12, 0, 0, 18432, 110, }, /* 1430 */ + { 90, 7, 12, 0, 0, 18432, 84, }, /* 1431 */ + { 90, 21, 12, 0, 0, 18432, 74, }, /* 1432 */ + { 126, 7, 12, 0, 0, 18432, 84, }, /* 1433 */ + { 126, 1, 2, 0, 0, 18432, 344, }, /* 1434 */ + { 126, 12, 3, 0, 0, 26624, 104, }, /* 1435 */ + { 126, 12, 3, 0, 0, 26624, 98, }, /* 1436 */ + { 149, 7, 12, 0, 0, 18432, 84, }, /* 1437 */ + { 94, 7, 12, 0, 0, 18432, 84, }, /* 1438 */ + { 94, 12, 3, 0, 0, 26624, 106, }, /* 1439 */ + { 94, 10, 5, 0, 0, 18432, 154, }, /* 1440 */ + { 94, 12, 3, 0, 0, 26624, 158, }, /* 1441 */ + { 94, 13, 12, 0, 0, 18432, 144, }, /* 1442 */ + { 141, 7, 12, 0, 0, 18432, 84, }, /* 1443 */ + { 141, 13, 12, 0, 0, 18432, 144, }, /* 1444 */ + { 141, 21, 12, 0, 0, 18432, 128, }, /* 1445 */ + { 166, 7, 12, 0, 0, 18432, 84, }, /* 1446 */ + { 166, 13, 12, 0, 0, 18432, 144, }, /* 1447 */ + { 138, 7, 12, 0, 0, 18432, 84, }, /* 1448 */ + { 138, 12, 3, 0, 0, 26624, 98, }, /* 1449 */ + { 138, 21, 12, 0, 0, 18432, 128, }, /* 1450 */ + { 139, 7, 12, 0, 0, 18432, 84, }, /* 1451 */ + { 139, 12, 3, 0, 0, 26624, 98, }, /* 1452 */ + { 139, 21, 12, 0, 0, 18432, 128, }, /* 1453 */ + { 139, 21, 12, 0, 0, 18432, 110, }, /* 1454 */ + { 139, 21, 12, 0, 0, 18432, 74, }, /* 1455 */ + { 139, 26, 12, 0, 0, 18432, 74, }, /* 1456 */ + { 139, 6, 12, 0, 0, 18432, 148, }, /* 1457 */ + { 139, 6, 12, 0, 0, 18432, 138, }, /* 1458 */ + { 139, 13, 12, 0, 0, 18432, 144, }, /* 1459 */ + { 139, 15, 12, 0, 0, 18432, 74, }, /* 1460 */ + { 170, 6, 12, 0, 0, 18432, 148, }, /* 1461 */ + { 170, 7, 12, 0, 0, 18432, 84, }, /* 1462 */ + { 170, 7, 7, 0, 0, 18432, 84, }, /* 1463 */ + { 170, 6, 12, 0, 0, 18432, 94, }, /* 1464 */ + { 170, 21, 12, 0, 0, 18432, 74, }, /* 1465 */ + { 170, 21, 12, 0, 0, 18432, 128, }, /* 1466 */ + { 170, 13, 12, 0, 0, 18432, 144, }, /* 1467 */ + { 158, 9, 12, 0, 32, 18432, 76, }, /* 1468 */ + { 158, 5, 12, 0, -32, 18432, 78, }, /* 1469 */ + { 158, 15, 12, 0, 0, 18432, 74, }, /* 1470 */ + { 158, 21, 12, 0, 0, 18432, 110, }, /* 1471 */ + { 158, 21, 12, 0, 0, 18432, 128, }, /* 1472 */ + { 158, 21, 12, 0, 0, 18432, 74, }, /* 1473 */ + { 174, 9, 12, 0, 27, 18432, 76, }, /* 1474 */ + { 174, 5, 12, 0, -27, 18432, 78, }, /* 1475 */ + { 136, 7, 12, 0, 0, 18432, 84, }, /* 1476 */ + { 136, 12, 3, 0, 0, 26624, 106, }, /* 1477 */ + { 136, 10, 5, 0, 0, 18432, 154, }, /* 1478 */ + { 136, 12, 3, 0, 0, 26624, 132, }, /* 1479 */ + { 136, 6, 12, 0, 0, 18432, 94, }, /* 1480 */ + { 82, 6, 12, 0, 0, 18432, 138, }, /* 1481 */ + { 154, 6, 12, 0, 0, 18432, 138, }, /* 1482 */ + { 30, 21, 12, 0, 0, 28672, 74, }, /* 1483 */ + { 165, 12, 3, 0, 0, 26624, 352, }, /* 1484 */ + { 30, 10, 3, 0, 0, 18432, 354, }, /* 1485 */ + { 30, 6, 12, 0, 0, 18432, 356, }, /* 1486 */ + { 82, 7, 12, 0, 0, 18432, 302, }, /* 1487 */ + { 165, 7, 12, 0, 0, 18432, 302, }, /* 1488 */ + { 28, 6, 12, 0, 0, 18432, 94, }, /* 1489 */ + { 154, 7, 12, 0, 0, 18432, 302, }, /* 1490 */ + { 65, 7, 12, 0, 0, 18432, 84, }, /* 1491 */ + { 65, 26, 12, 0, 0, 18432, 74, }, /* 1492 */ + { 65, 12, 3, 0, 0, 26624, 104, }, /* 1493 */ + { 65, 12, 3, 0, 0, 26624, 106, }, /* 1494 */ + { 65, 21, 12, 0, 0, 18432, 128, }, /* 1495 */ + { 100, 1, 2, 0, 0, 6504, 66, }, /* 1496 */ + { 100, 13, 12, 0, 0, 10240, 144, }, /* 1497 */ + { 100, 10, 3, 0, 0, 18432, 358, }, /* 1498 */ + { 100, 10, 3, 0, 0, 18432, 304, }, /* 1499 */ + { 1, 12, 3, 0, 0, 26624, 104, }, /* 1500 */ + { 100, 25, 12, 0, 0, 28672, 360, }, /* 1501 */ + { 100, 13, 12, 0, 0, 10240, 226, }, /* 1502 */ + { 151, 26, 12, 0, 0, 18432, 74, }, /* 1503 */ + { 151, 12, 3, 0, 0, 26624, 104, }, /* 1504 */ + { 151, 21, 12, 0, 0, 18432, 110, }, /* 1505 */ + { 151, 21, 12, 0, 0, 18432, 128, }, /* 1506 */ + { 151, 21, 12, 0, 0, 18432, 74, }, /* 1507 */ + { 44, 12, 3, 0, 0, 26624, 106, }, /* 1508 */ + { 2, 6, 12, 0, 0, 18432, 92, }, /* 1509 */ + { 161, 7, 12, 0, 0, 18432, 84, }, /* 1510 */ + { 161, 12, 3, 0, 0, 26624, 98, }, /* 1511 */ + { 161, 6, 12, 0, 0, 18432, 148, }, /* 1512 */ + { 161, 6, 12, 0, 0, 18432, 138, }, /* 1513 */ + { 161, 13, 12, 0, 0, 18432, 144, }, /* 1514 */ + { 161, 26, 12, 0, 0, 18432, 74, }, /* 1515 */ + { 92, 7, 12, 0, 0, 18432, 84, }, /* 1516 */ + { 92, 12, 3, 0, 0, 26624, 98, }, /* 1517 */ + { 162, 7, 12, 0, 0, 18432, 84, }, /* 1518 */ + { 162, 12, 3, 0, 0, 26624, 98, }, /* 1519 */ + { 162, 13, 12, 0, 0, 18432, 144, }, /* 1520 */ + { 162, 23, 12, 0, 0, 14336, 74, }, /* 1521 */ + { 169, 7, 12, 0, 0, 18432, 84, }, /* 1522 */ + { 169, 6, 12, 0, 0, 18432, 148, }, /* 1523 */ + { 169, 12, 3, 0, 0, 26624, 104, }, /* 1524 */ + { 169, 13, 12, 0, 0, 18432, 144, }, /* 1525 */ + { 95, 7, 12, 0, 0, 18432, 84, }, /* 1526 */ + { 95, 12, 3, 0, 0, 26624, 98, }, /* 1527 */ + { 95, 12, 3, 0, 0, 26624, 164, }, /* 1528 */ + { 95, 13, 12, 0, 0, 18432, 144, }, /* 1529 */ + { 95, 21, 12, 0, 0, 18432, 74, }, /* 1530 */ + { 172, 7, 12, 0, 0, 18432, 84, }, /* 1531 */ + { 172, 12, 3, 0, 0, 26624, 106, }, /* 1532 */ + { 172, 6, 12, 0, 0, 18432, 148, }, /* 1533 */ + { 140, 7, 12, 0, 0, 34816, 84, }, /* 1534 */ + { 140, 15, 12, 0, 0, 34816, 74, }, /* 1535 */ + { 140, 12, 3, 0, 0, 26624, 98, }, /* 1536 */ + { 79, 9, 12, 0, 34, 34816, 76, }, /* 1537 */ + { 79, 5, 12, 0, -34, 34816, 78, }, /* 1538 */ + { 79, 12, 3, 0, 0, 26624, 164, }, /* 1539 */ + { 79, 12, 3, 0, 0, 26624, 106, }, /* 1540 */ + { 79, 12, 3, 0, 0, 26624, 98, }, /* 1541 */ + { 79, 6, 12, 0, 0, 34816, 148, }, /* 1542 */ + { 79, 13, 12, 0, 0, 34816, 144, }, /* 1543 */ + { 79, 21, 12, 0, 0, 34816, 74, }, /* 1544 */ + { 100, 15, 12, 0, 0, 0, 74, }, /* 1545 */ + { 100, 26, 12, 0, 0, 0, 74, }, /* 1546 */ + { 100, 23, 12, 0, 0, 0, 74, }, /* 1547 */ + { 5, 7, 12, 0, 0, 0, 256, }, /* 1548 */ + { 100, 26, 14, 0, 0, 28672, 362, }, /* 1549 */ + { 99, 2, 14, 0, 0, 18432, 364, }, /* 1550 */ + { 100, 26, 12, 0, 0, 18432, 366, }, /* 1551 */ + { 100, 26, 14, 0, 0, 18432, 368, }, /* 1552 */ + { 100, 26, 14, 0, 0, 18432, 362, }, /* 1553 */ + { 100, 26, 11, 0, 0, 18432, 370, }, /* 1554 */ + { 27, 26, 12, 0, 0, 18432, 74, }, /* 1555 */ + { 100, 26, 14, 0, 0, 18432, 252, }, /* 1556 */ + { 100, 26, 14, 0, 0, 18816, 362, }, /* 1557 */ + { 100, 26, 14, 0, 0, 28672, 372, }, /* 1558 */ + { 100, 26, 14, 0, 0, 28672, 374, }, /* 1559 */ + { 100, 24, 3, 0, 0, 28672, 376, }, /* 1560 */ + { 100, 26, 14, 0, 0, 28672, 378, }, /* 1561 */ + { 100, 1, 3, 0, 0, 6144, 380, }, /* 1562 */ }; const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ @@ -1885,36 +2158,36 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 128,128,129,129,130,131,132,133,134,135,136,137,138,139,140,141, /* U+F800 */ 142,143,144,145,146,147,148,149,150,151,152,153,154,154,155,156, /* U+10000 */ 157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172, /* U+10800 */ -173,174,175,176,177,178,179,146,180,181,146,182,183,184,185,146, /* U+11000 */ -186,187,188,189,190,191,192,146,193,194,195,196,146,197,198,199, /* U+11800 */ -200,200,200,200,200,200,200,201,202,200,203,146,146,146,146,146, /* U+12000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,204, /* U+12800 */ -205,205,205,205,205,205,205,205,206,146,146,146,146,146,146,146, /* U+13000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+13800 */ -146,146,146,146,146,146,146,146,207,207,207,207,208,146,146,146, /* U+14000 */ +173,174,175,176,177,178,179,180,181,182,146,183,184,185,186,146, /* U+11000 */ +187,188,189,190,191,192,193,194,195,196,197,198,146,199,200,201, /* U+11800 */ +202,202,202,202,202,202,202,203,204,202,205,146,146,146,146,146, /* U+12000 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,206, /* U+12800 */ +207,207,207,207,207,207,207,207,208,207,207,207,207,207,207,207, /* U+13000 */ +207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207, /* U+13800 */ +207,207,207,207,207,207,207,209,210,210,210,210,211,146,146,146, /* U+14000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+14800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+15000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+15800 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+16000 */ -209,209,209,209,210,211,212,213,146,146,146,146,214,215,216,217, /* U+16800 */ -218,218,218,218,218,218,218,218,218,218,218,218,218,218,218,218, /* U+17000 */ -218,218,218,218,218,218,218,218,218,218,218,218,218,218,218,218, /* U+17800 */ -218,218,218,218,218,218,218,218,218,218,218,218,218,218,218,219, /* U+18000 */ -218,218,218,218,218,218,220,220,220,221,222,146,146,146,146,146, /* U+18800 */ +146,146,212,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+16000 */ +213,213,213,213,214,215,216,217,146,146,218,146,219,220,221,222, /* U+16800 */ +223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223, /* U+17000 */ +223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223, /* U+17800 */ +223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223, /* U+18000 */ +223,223,223,223,223,223,224,224,224,225,226,227,146,146,146,146, /* U+18800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+19000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+19800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+1A000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,223, /* U+1A800 */ -224,225,226,227,227,228,146,146,146,146,146,146,146,146,146,146, /* U+1B000 */ -146,146,146,146,146,146,146,146,229,230,146,146,146,146,146,146, /* U+1B800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,228, /* U+1A800 */ +229,230,231,232,232,233,146,146,146,146,146,146,146,146,146,146, /* U+1B000 */ +146,146,146,146,146,146,146,146,234,235,146,146,146,146,146,146, /* U+1B800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+1C000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,231,232, /* U+1C800 */ -233,234,235,236,237,238,239,146,240,241,242,243,244,245,246,247, /* U+1D000 */ -248,248,248,248,249,250,146,146,146,146,146,146,146,146,251,146, /* U+1D800 */ -252,253,254,146,146,255,146,146,146,256,146,146,146,146,146,257, /* U+1E000 */ -258,259,260,168,168,168,168,168,261,262,263,168,264,265,168,168, /* U+1E800 */ -266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281, /* U+1F000 */ -282,283,284,285,286,287,288,289,271,271,271,271,271,271,271,290, /* U+1F800 */ +146,146,146,146,146,146,146,146,236,237,236,236,236,238,239,240, /* U+1C800 */ +241,242,243,244,245,246,247,146,248,249,250,251,252,253,254,255, /* U+1D000 */ +256,256,256,256,257,258,146,146,146,146,146,146,146,146,259,146, /* U+1D800 */ +260,261,262,146,146,263,146,146,146,264,146,265,146,266,146,267, /* U+1E000 */ +268,269,270,271,271,271,271,271,272,273,274,271,275,276,271,271, /* U+1E800 */ +277,278,279,280,281,282,283,284,285,286,287,288,289,290,236,291, /* U+1F000 */ +292,293,294,295,296,297,236,298,282,282,282,282,282,282,282,299, /* U+1F800 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+20000 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+20800 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+21000 */ @@ -1935,25 +2208,25 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+28800 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+29000 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+29800 */ -101,101,101,101,101,101,101,101,101,101,101,101,101,291,101,101, /* U+2A000 */ +101,101,101,101,101,101,101,101,101,101,101,101,101,300,101,101, /* U+2A000 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+2A800 */ -101,101,101,101,101,101,101,101,101,101,101,101,101,101,292,101, /* U+2B000 */ -293,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+2B800 */ +101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+2B000 */ +301,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+2B800 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+2C000 */ -101,101,101,101,101,101,101,101,101,101,101,101,101,294,101,101, /* U+2C800 */ +101,101,101,101,101,101,101,101,101,101,101,101,101,302,101,101, /* U+2C800 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+2D000 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+2D800 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+2E000 */ -101,101,101,101,101,101,101,295,146,146,146,146,146,146,146,146, /* U+2E800 */ +101,101,101,101,101,101,101,303,101,101,101,101,304,146,146,146, /* U+2E800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+2F000 */ -129,129,129,129,296,146,146,146,146,146,146,146,146,146,146,297, /* U+2F800 */ +129,129,129,129,305,146,146,146,146,146,146,146,146,146,146,306, /* U+2F800 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+30000 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+30800 */ -101,101,101,101,101,101,298,101,101,101,101,101,101,101,101,101, /* U+31000 */ +101,101,101,101,101,101,307,101,101,101,101,101,101,101,101,101, /* U+31000 */ 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+31800 */ -101,101,101,101,101,101,101,299,146,146,146,146,146,146,146,146, /* U+32000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+32800 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+33000 */ +101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+32000 */ +101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101, /* U+32800 */ +101,101,101,101,101,101,101,101,308,146,146,146,146,146,146,146, /* U+33000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+33800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+34000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+34800 */ @@ -1978,7 +2251,7 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+3E000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+3E800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+3F000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,297, /* U+3F800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,306, /* U+3F800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+40000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+40800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+41000 */ @@ -2010,7 +2283,7 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+4E000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+4E800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+4F000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,297, /* U+4F800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,306, /* U+4F800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+50000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+50800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+51000 */ @@ -2042,7 +2315,7 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+5E000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+5E800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+5F000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,297, /* U+5F800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,306, /* U+5F800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+60000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+60800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+61000 */ @@ -2074,7 +2347,7 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+6E000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+6E800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+6F000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,297, /* U+6F800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,306, /* U+6F800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+70000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+70800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+71000 */ @@ -2106,7 +2379,7 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+7E000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+7E800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+7F000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,297, /* U+7F800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,306, /* U+7F800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+80000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+80800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+81000 */ @@ -2138,7 +2411,7 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+8E000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+8E800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+8F000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,297, /* U+8F800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,306, /* U+8F800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+90000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+90800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+91000 */ @@ -2170,7 +2443,7 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+9E000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+9E800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+9F000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,297, /* U+9F800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,306, /* U+9F800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+A0000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+A0800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+A1000 */ @@ -2202,7 +2475,7 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+AE000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+AE800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+AF000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,297, /* U+AF800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,306, /* U+AF800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+B0000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+B0800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+B1000 */ @@ -2234,7 +2507,7 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+BE000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+BE800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+BF000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,297, /* U+BF800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,306, /* U+BF800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+C0000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+C0800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+C1000 */ @@ -2266,7 +2539,7 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+CE000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+CE800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+CF000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,297, /* U+CF800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,306, /* U+CF800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+D0000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+D0800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+D1000 */ @@ -2298,9 +2571,9 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+DE000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+DE800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+DF000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,297, /* U+DF800 */ -300,301,302,303,301,301,301,301,301,301,301,301,301,301,301,301, /* U+E0000 */ -301,301,301,301,301,301,301,301,301,301,301,301,301,301,301,301, /* U+E0800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,306, /* U+DF800 */ +309,310,311,312,310,310,310,310,310,310,310,310,310,310,310,310, /* U+E0000 */ +310,310,310,310,310,310,310,310,310,310,310,310,310,310,310,310, /* U+E0800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+E1000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+E1800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+E2000 */ @@ -2330,7 +2603,7 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+EE000 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+EE800 */ 146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146, /* U+EF000 */ -146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,297, /* U+EF800 */ +146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,306, /* U+EF800 */ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /* U+F0000 */ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /* U+F0800 */ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /* U+F1000 */ @@ -2362,7 +2635,7 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /* U+FE000 */ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /* U+FE800 */ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /* U+FF000 */ -128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,304, /* U+FF800 */ +128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,313, /* U+FF800 */ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /* U+100000 */ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /* U+100800 */ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /* U+101000 */ @@ -2394,10 +2667,10 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /* U+10E000 */ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /* U+10E800 */ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /* U+10F000 */ -128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,304, /* U+10F800 */ +128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,313, /* U+10F800 */ }; -const uint16_t PRIV(ucd_stage2)[] = { /* 78080 bytes, block = 128 */ +const uint16_t PRIV(ucd_stage2)[] = { /* 80384 bytes, block = 128 */ /* block 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 3, 4, 0, 0, @@ -2431,553 +2704,553 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 78080 bytes, block = 128 */ /* block 3 */ 74, 75, 65, 66, 65, 66, 76, 65, 66, 77, 77, 65, 66, 70, 78, 79, - 80, 65, 66, 77, 81, 82, 83, 84, 65, 66, 85, 70, 83, 86, 87, 88, - 65, 66, 65, 66, 65, 66, 89, 65, 66, 89, 70, 70, 65, 66, 89, 65, - 66, 90, 90, 65, 66, 65, 66, 91, 65, 66, 70, 92, 65, 66, 70, 93, - 92, 92, 92, 92, 94, 95, 96, 97, 98, 99,100,101,102, 65, 66, 65, - 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66,103, 65, 66, + 80, 65, 66, 77, 81, 82, 83, 84, 65, 66, 85, 86, 83, 87, 88, 89, + 65, 66, 65, 66, 65, 66, 90, 65, 66, 90, 70, 70, 65, 66, 90, 65, + 66, 91, 91, 65, 66, 65, 66, 92, 65, 66, 70, 93, 65, 66, 70, 94, + 93, 93, 93, 93, 95, 96, 97, 98, 99,100,101,102,103, 65, 66, 65, + 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66,104, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, - 69,104,105,106, 65, 66,107,108, 65, 66, 65, 66, 65, 66, 65, 66, + 69,105,106,107, 65, 66,108,109, 65, 66, 65, 66, 65, 66, 65, 66, /* block 4 */ 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, -109, 70, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 70, 70, 70, 70, 70, 70,110, 65, 66,111,112,113, -113, 65, 66,114,115,116, 65, 66, 65, 67, 65, 66, 65, 66, 65, 66, -117,118,119,120,121, 70,122,122, 70,123, 70,124,125, 70, 70, 70, -122,126, 70,127, 70,128,129, 70,130,131,129,132,133, 70, 70,131, - 70,134,135, 70, 70,136, 70, 70, 70, 70, 70, 70, 70,137, 70, 70, +110, 70, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 70, 70, 70, 70, 70, 70,111, 65, 66,112,113,114, +114, 65, 66,115,116,117, 65, 66, 65, 67, 65, 66, 65, 66, 65, 66, +118,119,120,121,122, 70,123,123, 70,124, 70,125,126, 70, 70, 70, +123,127, 70,128,129,130,131, 70,132,133,131,134,135, 70, 70,133, + 70,136,137, 70, 70,138, 70, 70, 70, 70, 70, 70, 70,139, 70, 70, /* block 5 */ -138, 70,139,138, 70, 70, 70,140,138,141,142,142,143, 70, 70, 70, - 70, 70,144, 70, 92, 70, 70, 70, 70, 70, 70, 70, 70,145,146, 70, +140, 70,141,140, 70, 70, 70,142,140,143,144,144,145, 70, 70, 70, + 70, 70,146, 70, 93, 93, 70, 70, 70, 70, 70, 70, 70,147,148, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, -147,147,148,147,147,147,147,147,147,149,149,150,150,150,150,150, -151,151, 46, 46, 46, 46,149,149,149,149,149,149,149,149,149,149, -152,152, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, -147,147,147,147,147, 46, 46, 46, 46, 46,153,153,149, 46,150, 46, +149,149,150,149,149,149,149,149,149,151,151,152,153,152,152,152, +154,154, 46, 46, 46, 46,151,155,151,155,155,155,151,156,151,151, +157,157, 46, 46, 46, 46, 46,158, 46,159, 46, 46, 46, 46, 46, 46, +149,149,149,149,149, 46, 46, 46, 46, 46,160,160,151, 46,152, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, /* block 6 */ -154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154, -154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154, -154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154, -154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154, -154,154,155,154,154,156,154,154,154,154,154,154,154,154,154,157, -154,154,154,154,154,154,154,154,158,158,158,158,158,154,154,154, -154,154,154,159,159,159,159,159,159,159,159,159,159,159,159,159, -160,161,160,161,149,162,160,161,163,163,164,165,165,165,166,167, +161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176, +174,177,176,178,176,176,176,176,176,176,176,176,176,176,176,176, +176,176,176,179,180,181,176,176,176,176,176,176,176,182,181,176, +183,184,176,176,176,176,176,176,176,176,176,176,176,176,176,176, +176,176,185,176,176,186,176,176,176,176,176,176,176,176,176,187, +176,176,176,176,176,176,176,176,188,189,189,189,189,176,190,176, +176,176,176,191,191,191,191,191,191,191,191,191,191,191,191,191, +192,193,192,193,194,195,192,193,196,196,197,198,198,198,199,200, /* block 7 */ -163,163,163,163,162, 46,168,169,170,170,170,163,171,163,172,172, -173,174,175,174,174,176,174,174,177,178,179,174,180,174,174,174, -181,182,163,183,174,174,184,174,174,185,174,174,186,187,187,187, -173,188,189,188,188,190,188,188,191,192,193,188,194,188,188,188, -195,196,197,198,188,188,199,188,188,200,188,188,201,202,202,203, -204,205,206,207,207,208,209,210,160,161,160,161,160,161,160,161, -160,161,211,212,211,212,211,212,211,212,211,212,211,212,211,212, -213,214,215,216,217,218,219,160,161,220,160,161,221,222,222,222, +196,196,196,196,201, 46,202,203,204,204,204,196,205,196,206,206, +207,208,209,208,208,210,208,208,211,212,213,208,214,208,208,208, +215,216,196,217,208,208,218,208,208,219,208,208,220,221,221,221, +222,223,224,223,223,225,223,223,226,227,228,223,229,223,223,223, +230,231,232,233,223,223,234,223,223,235,223,223,236,237,237,238, +239,240,241,242,242,243,244,245,192,193,192,193,192,193,192,193, +192,193,246,247,246,247,246,247,246,247,246,247,246,247,246,247, +248,249,250,251,252,253,254,192,193,255,192,193,256,257,257,257, /* block 8 */ -223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223, -224,224,225,224,226,224,224,224,224,224,224,224,224,224,227,224, -224,228,229,224,224,224,224,224,224,224,230,224,224,224,224,224, -231,231,232,231,233,231,231,231,231,231,231,231,231,231,234,231, -231,235,236,231,231,231,231,231,231,231,237,231,231,231,231,231, -238,238,238,238,238,238,239,238,239,238,238,238,238,238,238,238, -240,241,242,243,240,241,240,241,240,241,240,241,240,241,240,241, -240,241,240,241,240,241,240,241,240,241,240,241,240,241,240,241, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +259,259,260,259,261,259,259,259,259,259,259,259,259,259,262,259, +259,263,264,259,259,259,259,259,259,259,265,259,259,259,259,259, +266,266,267,266,268,266,266,266,266,266,266,266,266,266,269,266, +266,270,271,266,266,266,266,266,266,266,272,266,266,266,266,266, +273,273,273,273,273,273,274,273,274,273,273,273,273,273,273,273, +275,276,277,278,275,276,275,276,275,276,275,276,275,276,275,276, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,275,276, /* block 9 */ -240,241,244,245,246,247,247,246,248,248,240,241,240,241,240,241, -240,241,240,241,240,241,240,241,240,241,240,241,240,241,240,241, -240,241,240,241,240,241,240,241,240,241,240,241,240,241,240,241, -240,241,240,241,240,241,240,241,240,241,240,241,240,241,240,241, -249,240,241,240,241,240,241,240,241,240,241,240,241,240,241,250, -240,241,240,241,240,241,240,241,240,241,240,241,240,241,240,241, -240,241,240,241,240,241,240,241,240,241,240,241,240,241,240,241, -240,241,240,241,240,241,240,241,240,241,240,241,240,241,240,241, +275,276,279,280,281,282,282,281,283,283,275,276,275,276,275,276, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,275,276, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,275,276, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,275,276, +284,275,276,275,276,275,276,275,276,275,276,275,276,275,276,285, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,275,276, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,275,276, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,275,276, /* block 10 */ -240,241,240,241,240,241,240,241,240,241,240,241,240,241,240,241, -240,241,240,241,240,241,240,241,240,241,240,241,240,241,240,241, -240,241,240,241,240,241,240,241,240,241,240,241,240,241,240,241, -163,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251, -251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251, -251,251,251,251,251,251,251,163,163,252,253,253,253,253,253,254, -255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256, -256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,275,276, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,275,276, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,275,276, +196,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, +286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, +286,286,286,286,286,286,286,196,196,287,288,288,288,288,288,289, +290,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291, +291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291, /* block 11 */ -256,256,256,256,256,256,256,257,255,258,259,163,163,260,260,261, -262,263,263,263,263,263,263,263,263,263,263,263,263,263,263,263, -263,263,264,263,263,263,263,263,263,263,263,263,263,263,263,263, -265,265,265,265,265,265,265,265,265,265,265,265,265,265,266,265, -267,265,265,268,265,269,267,269,262,262,262,262,262,262,262,262, -270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270, -270,270,270,270,270,270,270,270,270,270,270,262,262,262,262,270, -270,270,270,267,271,262,262,262,262,262,262,262,262,262,262,262, +291,291,291,291,291,291,291,292,290,293,294,196,196,295,295,296, +297,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, +298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, +299,299,299,299,299,299,299,299,299,299,299,299,299,299,300,299, +301,299,299,302,299,299,301,299,297,297,297,297,297,297,297,297, +303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303, +303,303,303,303,303,303,303,303,303,303,303,297,297,297,297,303, +303,303,303,301,304,297,297,297,297,297,297,297,297,297,297,297, /* block 12 */ -272,272,272,272,272,273,274,274,275,276,276,277,278,279,280,280, -281,281,281,281,281,281,281,281,281,281,281,282,283,284,284,285, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -287,286,286,286,286,286,286,286,286,286,286,288,288,288,288,288, -288,288,288,289,289,289,281,290,291,281,281,281,281,281,281,281, -292,292,292,292,292,292,292,292,292,292,276,293,293,279,286,286, -289,286,286,294,286,286,286,286,286,286,286,286,286,286,286,286, +305,305,305,305,305,306,307,307,308,309,309,310,311,312,313,313, +314,314,314,314,314,314,314,314,314,314,314,315,316,317,317,318, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +320,319,319,319,319,319,319,319,319,319,319,321,321,321,321,321, +321,321,321,322,323,323,314,324,325,314,314,314,314,314,314,314, +326,326,326,326,326,326,326,326,326,326,309,327,327,312,319,319, +322,319,319,328,319,319,319,319,319,319,319,319,319,319,319,319, /* block 13 */ -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,295,286,281,281,281,281,281,281,281,273,280,291, -291,281,281,281,281,296,296,281,281,280,291,291,291,281,286,286, -297,297,297,297,297,297,297,297,297,297,286,286,286,298,298,286, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,329,319,314,314,314,314,314,314,330,306,313,331, +331,314,314,330,314,332,332,330,330,313,331,331,331,314,319,319, +333,333,333,333,333,333,333,333,333,333,319,319,319,334,334,319, /* block 14 */ -299,299,299,300,300,300,300,300,300,300,300,301,300,301,302,303, -304,305,304,304,304,304,304,304,304,304,304,304,304,304,304,304, -304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304, -306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306, -307,307,307,307,307,307,307,307,307,307,307,302,302,304,304,304, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, +335,335,335,336,336,336,336,336,336,336,336,337,336,337,338,339, +340,341,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +342,342,342,342,342,342,342,342,342,342,342,342,342,342,342,342, +343,343,343,343,343,343,343,343,343,343,343,338,338,340,340,340, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, /* block 15 */ -308,308,308,308,308,308,308,308,308,308,308,308,308,308,308,308, -308,308,308,308,308,308,308,308,308,308,308,308,308,308,308,308, -308,308,308,308,308,308,309,309,309,309,309,309,309,309,309,309, -309,308,302,302,302,302,302,302,302,302,302,302,302,302,302,302, -310,310,310,310,310,310,310,310,310,310,311,311,311,311,311,311, -311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311, -311,311,311,311,311,311,311,311,311,311,311,312,312,312,312,312, -312,312,312,312,313,313,314,315,316,317,318,262,262,319,320,320, +344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344, +344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344, +344,344,344,344,344,344,345,345,345,345,345,345,345,345,345,345, +345,344,338,338,338,338,338,338,338,338,338,338,338,338,338,338, +346,346,346,346,346,346,346,346,346,346,347,347,347,347,347,347, +347,347,347,347,347,347,347,347,347,347,347,347,347,347,347,347, +347,347,347,347,347,347,347,347,347,347,347,348,348,348,348,348, +348,348,348,348,349,349,350,351,352,353,354,297,297,355,356,356, /* block 16 */ -321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,321, -321,321,321,321,321,321,322,322,323,323,324,322,322,322,322,322, -322,322,322,322,324,322,322,322,324,322,322,322,322,325,262,262, -326,326,326,326,326,326,326,327,326,327,326,326,326,327,327,262, -328,328,328,328,328,328,328,328,328,328,328,328,328,328,328,328, -328,328,328,328,328,328,328,328,328,329,329,329,262,262,330,262, -304,304,304,304,304,304,304,304,304,304,304,302,302,302,302,302, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, +357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357, +357,357,357,357,357,357,358,358,359,359,360,358,358,358,358,358, +358,358,358,358,360,358,358,358,360,358,358,358,358,361,297,297, +362,362,362,362,362,362,363,364,362,364,362,362,362,364,364,297, +365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365, +365,365,365,365,365,365,365,365,365,366,366,366,297,297,367,297, +340,340,340,340,340,340,340,340,340,340,340,338,338,338,338,338, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, /* block 17 */ -286,286,286,286,286,286,286,286,331,286,286,286,286,286,286,302, -272,272,302,302,302,302,302,302,291,291,291,291,291,291,291,291, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,296,291,291,291,291,291,291, -291,291,291,332,281,281,281,281,281,281,281,281,281,281,281,281, -332,332,273,290,290,290,290,290,290,290,291,291,291,291,291,291, -290,290,290,290,290,290,290,290,290,290,290,290,290,290,290,281, +319,319,319,319,319,319,319,319,368,319,319,319,319,319,319,319, +305,305,338,338,338,338,338,314,331,331,331,331,331,331,331,331, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,332,325,325,331,325,325,325, +331,331,331,369,314,314,314,314,314,314,314,314,314,314,314,314, +370,370,306,324,324,324,324,324,324,324,331,331,331,331,331,331, +324,324,324,371,324,324,324,324,324,324,324,324,324,324,324,314, /* block 18 */ -333,333,333,334,335,335,335,335,335,335,335,335,335,335,335,335, -335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335, -335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335, -335,335,335,335,335,335,335,335,335,335,333,334,336,335,334,334, -334,333,333,333,333,333,333,333,333,334,334,334,334,337,334,334, -335,338,339,154,154,333,333,333,335,335,335,335,335,335,335,335, -335,335,333,333,340,341,342,342,342,342,342,342,342,342,342,342, -343,344,335,335,335,335,335,335,335,335,335,335,335,335,335,335, +372,372,372,373,374,374,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,374,375,375,375,375,375,375,375,375,375,375,375, +375,375,375,375,375,375,375,375,375,375,375,375,375,375,375,375, +375,375,375,375,375,375,375,375,375,375,372,373,376,374,373,373, +373,372,372,372,372,372,372,372,372,373,373,373,373,377,373,373, +374,378,379,176,176,372,372,372,375,375,375,375,375,375,375,375, +374,374,372,372,380,381,382,382,382,382,382,382,382,382,382,382, +383,384,374,374,374,374,374,374,375,375,375,375,375,375,375,375, /* block 19 */ -345,346,347,347,163,345,345,345,345,345,345,345,345,163,163,345, -345,163,163,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,163,345,345,345,345,345,345, -345,163,345,163,163,163,345,345,345,345,163,163,348,345,349,347, -347,346,346,346,346,163,163,347,347,163,163,347,347,350,345,163, -163,163,163,163,163,163,163,349,163,163,163,163,345,345,163,345, -345,345,346,346,163,163,351,351,351,351,351,351,351,351,351,351, -345,345,352,352,353,353,353,353,353,353,354,352,345,355,356,163, +385,386,387,387,196,385,385,385,385,385,385,385,385,196,196,385, +385,196,196,385,385,388,388,388,388,388,388,388,388,388,388,388, +388,388,388,388,388,388,388,388,388,196,388,388,388,388,388,388, +388,196,388,196,196,196,388,388,388,388,196,196,389,385,390,387, +387,386,386,386,386,196,196,387,387,196,196,387,387,391,385,196, +196,196,196,196,196,196,196,390,196,196,196,196,388,388,196,388, +385,385,386,386,196,196,392,392,392,392,392,392,392,392,392,392, +388,388,393,393,394,394,394,394,394,394,395,393,385,396,397,196, /* block 20 */ -163,357,357,358,163,359,359,359,359,359,359,163,163,163,163,359, -359,163,163,359,359,359,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,163,359,359,359,359,359,359, -359,163,359,359,163,359,359,163,359,359,163,163,360,163,358,358, -358,357,357,163,163,163,163,357,357,163,163,357,357,361,163,163, -163,357,163,163,163,163,163,163,163,359,359,359,359,163,359,163, -163,163,163,163,163,163,362,362,362,362,362,362,362,362,362,362, -357,357,359,359,359,357,363,163,163,163,163,163,163,163,163,163, +196,398,398,399,196,400,400,400,400,400,400,196,196,196,196,400, +400,196,196,400,400,400,400,400,400,400,400,400,400,400,400,400, +400,400,400,400,400,400,400,400,400,196,400,400,400,400,400,400, +400,196,400,400,196,400,400,196,400,400,196,196,401,196,399,399, +399,398,398,196,196,196,196,398,398,196,196,398,398,402,196,196, +196,398,196,196,196,196,196,196,196,400,400,400,400,196,400,196, +196,196,196,196,196,196,403,403,403,403,403,403,403,403,403,403, +398,404,400,400,400,398,405,196,196,196,196,196,196,196,196,196, /* block 21 */ -163,364,364,365,163,366,366,366,366,366,366,366,366,366,163,366, -366,366,163,366,366,366,366,366,366,366,366,366,366,366,366,366, -366,366,366,366,366,366,366,366,366,163,366,366,366,366,366,366, -366,163,366,366,163,366,366,366,366,366,163,163,367,366,365,365, -365,364,364,364,364,364,163,364,364,365,163,365,365,368,163,163, -366,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -366,366,364,364,163,163,369,369,369,369,369,369,369,369,369,369, -370,371,163,163,163,163,163,163,163,366,364,364,364,367,367,367, +196,406,406,407,196,408,408,408,408,408,408,408,408,408,196,408, +408,408,196,408,408,409,409,409,409,409,409,409,409,409,409,409, +409,409,409,409,409,409,409,409,409,196,409,409,409,409,409,409, +409,196,409,409,196,409,409,409,409,409,196,196,410,408,407,407, +407,406,406,406,406,406,196,406,406,407,196,407,407,411,196,196, +408,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +408,408,406,406,196,196,412,412,412,412,412,412,412,412,412,412, +413,414,196,196,196,196,196,196,196,409,406,415,406,410,410,410, /* block 22 */ -163,372,373,373,163,374,374,374,374,374,374,374,374,163,163,374, -374,163,163,374,374,374,374,374,374,374,374,374,374,374,374,374, -374,374,374,374,374,374,374,374,374,163,374,374,374,374,374,374, -374,163,374,374,163,374,374,374,374,374,163,163,375,374,376,372, -373,372,372,372,372,163,163,373,373,163,163,373,373,377,163,163, -163,163,163,163,163,378,372,376,163,163,163,163,374,374,163,374, -374,374,372,372,163,163,379,379,379,379,379,379,379,379,379,379, -380,374,381,381,381,381,381,381,163,163,163,163,163,163,163,163, +196,416,417,417,196,418,418,418,418,418,418,418,418,196,196,418, +418,196,196,418,418,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,196,419,419,419,419,419,419, +419,196,419,419,196,419,419,419,419,419,196,196,420,418,421,416, +417,416,416,416,416,196,196,417,417,196,196,417,417,422,196,196, +196,196,196,196,196,423,416,421,196,196,196,196,419,419,196,419, +418,418,416,416,196,196,424,424,424,424,424,424,424,424,424,424, +425,419,426,426,426,426,426,426,196,196,196,196,196,196,196,196, /* block 23 */ -163,163,382,383,163,383,383,383,383,383,383,163,163,163,383,383, -383,163,383,383,383,383,163,163,163,383,383,163,383,163,383,383, -163,163,163,383,383,163,163,163,383,383,383,163,163,163,383,383, -383,383,383,383,383,383,383,383,383,383,163,163,163,163,384,385, -382,385,385,163,163,163,385,385,385,163,385,385,385,386,163,163, -383,163,163,163,163,163,163,384,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,387,387,387,387,387,387,387,387,387,387, -388,388,388,389,390,390,390,390,390,391,390,163,163,163,163,163, +196,196,427,428,196,428,428,428,428,428,428,196,196,196,428,428, +428,196,428,428,428,428,196,196,196,428,428,196,428,196,428,428, +196,196,196,428,428,196,196,196,428,428,428,196,196,196,428,428, +428,428,428,428,428,428,428,428,428,428,196,196,196,196,429,430, +427,430,430,196,196,196,430,430,430,196,430,430,430,431,196,196, +428,196,196,196,196,196,196,429,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,432,432,432,432,432,432,432,432,432,432, +433,433,433,434,435,435,435,435,435,436,435,196,196,196,196,196, /* block 24 */ -392,393,393,393,392,394,394,394,394,394,394,394,394,163,394,394, -394,163,394,394,394,394,394,394,394,394,394,394,394,394,394,394, -394,394,394,394,394,394,394,394,394,163,394,394,394,394,394,394, -394,394,394,394,394,394,394,394,394,394,163,163,395,394,392,392, -392,393,393,393,393,163,392,392,392,163,392,392,392,396,163,163, -163,163,163,163,163,392,392,163,394,394,394,163,163,394,163,163, -394,394,392,392,163,163,397,397,397,397,397,397,397,397,397,397, -163,163,163,163,163,163,163,398,399,399,399,399,399,399,399,400, +437,438,438,438,437,439,439,439,439,439,439,439,439,196,439,439, +439,196,439,439,439,440,440,440,440,440,440,440,440,440,440,440, +440,440,440,440,440,440,440,440,440,196,440,440,440,440,440,440, +440,440,440,440,440,440,440,440,440,440,196,196,441,439,437,437, +437,438,438,438,438,196,437,437,437,196,437,437,437,442,196,196, +196,196,196,196,196,437,437,196,440,440,440,196,439,439,196,196, +439,439,437,437,196,196,443,443,443,443,443,443,443,443,443,443, +196,196,196,196,196,196,196,444,445,445,445,445,445,445,445,446, /* block 25 */ -401,402,403,403,404,401,401,401,401,401,401,401,401,163,401,401, -401,163,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,163,401,401,401,401,401,401, -401,401,401,401,163,401,401,401,401,401,163,163,405,401,403,406, -403,403,407,403,403,163,406,403,403,163,403,403,402,408,163,163, -163,163,163,163,163,407,407,163,163,163,163,163,163,401,401,163, -401,401,402,402,163,163,409,409,409,409,409,409,409,409,409,409, -163,401,401,403,163,163,163,163,163,163,163,163,163,163,163,163, +447,448,449,449,450,447,447,447,447,447,447,447,447,196,447,447, +447,196,447,447,447,447,447,447,447,447,447,447,447,447,447,447, +447,447,447,447,447,447,447,447,447,196,447,447,447,447,447,447, +447,447,447,447,196,447,447,447,447,447,196,196,451,447,449,452, +453,449,453,449,449,196,452,453,453,196,453,453,448,454,196,196, +196,196,196,196,196,453,453,196,196,196,196,196,447,447,447,196, +447,447,448,448,196,196,455,455,455,455,455,455,455,455,455,455, +196,447,447,449,196,196,196,196,196,196,196,196,196,196,196,196, /* block 26 */ -410,410,411,411,412,412,412,412,412,412,412,412,412,163,412,412, -412,163,412,412,412,412,412,412,412,412,412,412,412,412,412,412, -412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412, -412,412,412,412,412,412,412,412,412,412,412,413,413,412,414,411, -411,410,410,410,410,163,411,411,411,163,411,411,411,413,415,416, -163,163,163,163,412,412,412,414,417,417,417,417,417,417,417,412, -412,412,410,410,163,163,418,418,418,418,418,418,418,418,418,418, -417,417,417,417,417,417,417,417,417,416,412,412,412,412,412,412, +456,456,457,457,458,458,458,458,458,458,458,458,458,196,458,458, +458,196,458,458,458,459,459,459,459,459,459,459,459,459,459,459, +459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459, +459,459,459,459,459,459,459,459,459,459,459,460,460,458,461,457, +457,456,456,456,456,196,457,457,457,196,457,457,457,460,462,463, +196,196,196,196,458,458,458,461,464,464,464,464,464,464,464,458, +458,458,456,456,196,196,465,465,465,465,465,465,465,465,465,465, +464,464,464,464,464,464,464,464,464,463,458,458,458,458,458,458, /* block 27 */ -163,419,420,420,163,421,421,421,421,421,421,421,421,421,421,421, -421,421,421,421,421,421,421,163,163,163,421,421,421,421,421,421, -421,421,421,421,421,421,421,421,421,421,421,421,421,421,421,421, -421,421,163,421,421,421,421,421,421,421,421,421,163,421,163,163, -421,421,421,421,421,421,421,163,163,163,422,163,163,163,163,423, -420,420,419,419,419,163,419,163,420,420,420,420,420,420,420,423, -163,163,163,163,163,163,424,424,424,424,424,424,424,424,424,424, -163,163,420,420,425,163,163,163,163,163,163,163,163,163,163,163, +196,466,467,467,196,468,468,468,468,468,468,468,468,468,468,468, +468,468,468,468,468,468,468,196,196,196,468,468,468,468,468,468, +468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468, +468,468,196,468,468,468,468,468,468,468,468,468,196,468,196,196, +468,468,468,468,468,468,468,196,196,196,469,196,196,196,196,470, +467,467,466,466,466,196,466,196,467,467,467,467,467,467,467,470, +196,196,196,196,196,196,471,471,471,471,471,471,471,471,471,471, +196,196,467,467,472,196,196,196,196,196,196,196,196,196,196,196, /* block 28 */ -163,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, -426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, -426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, -426,427,426,428,427,427,427,427,427,427,429,163,163,163,163,430, -431,431,431,431,431,426,432,433,433,433,433,433,433,427,433,434, -435,435,435,435,435,435,435,435,435,435,436,436,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +196,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,474,473,475,474,474,474,474,474,474,476,196,196,196,196,477, +478,478,478,478,478,473,479,480,480,480,480,480,480,474,480,481, +482,482,482,482,482,482,482,482,482,482,483,483,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 29 */ -163,437,437,163,437,163,437,437,437,437,437,163,437,437,437,437, -437,437,437,437,437,437,437,437,437,437,437,437,437,437,437,437, -437,437,437,437,163,437,163,437,437,437,437,437,437,437,437,437, -437,438,437,439,438,438,438,438,438,438,440,438,438,437,163,163, -441,441,441,441,441,163,442,163,443,443,443,443,443,438,444,163, -445,445,445,445,445,445,445,445,445,445,163,163,437,437,437,437, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +196,484,484,196,484,196,484,484,484,484,484,196,484,484,484,484, +484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, +484,484,484,484,196,484,196,484,484,484,484,484,484,484,484,484, +484,485,484,486,485,485,485,485,485,485,487,485,485,484,196,196, +488,488,488,488,488,196,489,196,490,490,490,490,490,485,491,196, +492,492,492,492,492,492,492,492,492,492,196,196,484,484,484,484, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 30 */ -446,447,447,447,448,448,448,448,449,448,448,448,448,449,449,449, -449,449,449,447,448,447,447,447,450,450,447,447,447,447,447,447, -451,451,451,451,451,451,451,451,451,451,452,452,452,452,452,452, -452,452,452,452,447,450,447,450,447,450,453,454,453,454,455,455, -446,446,446,446,446,446,446,446,163,446,446,446,446,446,446,446, -446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,446, -446,446,446,446,446,446,446,446,446,446,446,446,446,163,163,163, -163,456,456,456,456,456,456,457,456,457,456,456,456,456,456,458, +493,494,494,494,495,495,495,495,496,495,495,495,495,496,496,496, +496,496,496,494,495,494,494,494,497,497,494,494,494,494,494,494, +498,498,498,498,498,498,498,498,498,498,499,499,499,499,499,499, +499,499,499,499,494,497,494,497,494,497,500,501,500,501,502,502, +493,493,493,493,493,493,493,493,196,493,493,493,493,493,493,493, +493,493,493,493,493,493,493,493,493,493,493,493,493,493,493,493, +493,493,493,493,493,493,493,493,493,493,493,493,493,196,196,196, +196,503,503,503,503,503,503,504,503,504,503,503,503,503,503,505, /* block 31 */ -456,456,459,459,460,448,450,450,446,446,446,446,446,456,456,456, -456,456,456,456,456,456,456,456,163,456,456,456,456,456,456,456, -456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, -456,456,456,456,456,456,456,456,456,456,456,456,456,163,447,447, -447,447,447,447,447,447,450,447,447,447,447,447,447,163,447,447, -448,448,448,448,448,461,461,461,461,448,448,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +503,503,506,506,507,495,497,497,493,493,493,493,493,503,503,503, +503,503,503,503,503,503,503,503,196,503,503,503,503,503,503,503, +503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, +503,503,503,503,503,503,503,503,503,503,503,503,503,196,494,494, +494,494,494,494,494,494,497,494,494,494,494,494,494,196,494,494, +495,495,495,495,495,508,508,508,508,495,495,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 32 */ -462,462,462,462,462,462,462,462,462,462,462,462,462,462,462,462, -462,462,462,462,462,462,462,462,462,462,462,462,462,462,462,462, -462,462,462,462,462,462,462,462,462,462,462,463,463,464,464,464, -464,465,464,464,464,464,464,466,463,467,467,465,465,464,464,462, -468,468,468,468,468,468,468,468,468,468,469,469,470,470,470,470, -462,462,462,462,462,462,465,465,464,464,462,462,462,462,464,464, -464,462,463,471,471,462,462,463,463,471,471,471,471,471,462,462, -462,464,464,464,464,462,462,462,462,462,462,462,462,462,462,462, +509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, +509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, +509,509,509,509,509,509,509,509,509,509,509,510,510,511,511,511, +511,512,511,511,511,511,511,513,510,514,514,512,512,511,511,509, +515,515,515,515,515,515,515,515,515,515,516,516,517,517,517,517, +509,509,509,509,509,509,512,512,511,511,509,509,509,509,511,511, +511,509,510,518,518,509,509,510,510,518,518,518,518,518,509,509, +509,511,511,511,511,509,509,509,509,509,509,509,509,509,509,509, /* block 33 */ -462,462,464,463,465,464,464,471,471,471,471,471,471,472,462,471, -473,473,473,473,473,473,473,473,473,473,471,471,463,464,474,474, -475,475,475,475,475,475,475,475,475,475,475,475,475,475,475,475, -475,475,475,475,475,475,475,475,475,475,475,475,475,475,475,475, -475,475,475,475,475,475,163,475,163,163,163,163,163,475,163,163, -476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,476, -476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,476, -476,476,476,476,476,476,476,476,476,476,476,477,478,476,476,476, +509,509,511,510,512,511,511,518,518,518,518,518,518,519,509,518, +520,520,520,520,520,520,520,520,520,520,518,518,510,511,521,521, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,196,522,196,196,196,196,196,522,196,196, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,524,525,523,523,523, /* block 34 */ -479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479, -479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479, -479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479, -479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479, -479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479, -479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,480, -481,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482, -482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482, +526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, +526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, +526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, +526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, +526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, +526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,527, +528,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529, +529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529, /* block 35 */ -482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482, -482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482, -482,482,482,482,482,482,482,482,483,483,483,483,483,483,483,483, -483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, -483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, -483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, -483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, -483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, +529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529, +529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529, +529,529,529,529,529,529,529,529,530,530,530,530,530,530,530,530, +530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, +530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, +530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, +530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, +530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, /* block 36 */ -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,484,484,163,484,484,484,484,163,163, -484,484,484,484,484,484,484,163,484,163,484,484,484,484,163,163, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,531,531,196,531,531,531,531,196,196, +531,531,531,531,531,531,531,196,531,196,531,531,531,531,196,196, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, /* block 37 */ -484,484,484,484,484,484,484,484,484,163,484,484,484,484,163,163, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,163,484,484,484,484,163,163,484,484,484,484,484,484,484,163, -484,163,484,484,484,484,163,163,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,163,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, +531,531,531,531,531,531,531,531,531,196,531,531,531,531,196,196, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,196,531,531,531,531,196,196,531,531,531,531,531,531,531,196, +531,196,531,531,531,531,196,196,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,196,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, /* block 38 */ -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,163,484,484,484,484,163,163,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,484,484,484,484,163,163,485,485,485, -486,487,488,487,487,487,487,488,488,489,489,489,489,489,489,489, -489,489,490,490,490,490,490,490,490,490,490,490,490,163,163,163, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,196,531,531,531,531,196,196,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,531,531,531,531,196,196,532,532,532, +533,534,535,534,534,534,534,535,535,536,536,536,536,536,536,536, +536,536,537,537,537,537,537,537,537,537,537,537,537,196,196,196, /* block 39 */ -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -491,491,491,491,491,491,491,491,491,491,163,163,163,163,163,163, -492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, -492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, -492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, -492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, -492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, -493,493,493,493,493,493,163,163,494,494,494,494,494,494,163,163, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +538,538,538,538,538,538,538,538,538,538,196,196,196,196,196,196, +539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,539, +539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,539, +539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,539, +539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,539, +539,539,539,539,539,539,539,539,539,539,539,539,539,539,539,539, +540,540,540,540,540,540,196,196,541,541,541,541,541,541,196,196, /* block 40 */ -495,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, +542,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, /* block 41 */ -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, /* block 42 */ -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,497,498,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,544,545,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, /* block 43 */ -499,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500, -500,500,500,500,500,500,500,500,500,500,500,501,502,163,163,163, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,504,504,504,505,505, -505,503,503,503,503,503,503,503,503,163,163,163,163,163,163,163, +546,547,547,547,547,547,547,547,547,547,547,547,547,547,547,547, +547,547,547,547,547,547,547,547,547,547,547,548,549,196,196,196, +550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550, +550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550, +550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550, +550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550, +550,550,550,550,550,550,550,550,550,550,550,551,551,551,552,552, +552,550,550,550,550,550,550,550,550,196,196,196,196,196,196,196, /* block 44 */ -506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,506, -506,506,507,507,508,509,163,163,163,163,163,163,163,163,163,506, -510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, -510,510,511,511,512,513,513,163,163,163,163,163,163,163,163,163, -514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514, -514,514,515,515,163,163,163,163,163,163,163,163,163,163,163,163, -516,516,516,516,516,516,516,516,516,516,516,516,516,163,516,516, -516,163,517,517,163,163,163,163,163,163,163,163,163,163,163,163, +553,553,553,553,553,553,553,553,553,553,553,553,553,553,553,553, +553,553,554,554,555,556,196,196,196,196,196,196,196,196,196,553, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,558,558,559,560,560,196,196,196,196,196,196,196,196,196, +561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, +561,561,562,562,196,196,196,196,196,196,196,196,196,196,196,196, +563,563,563,563,563,563,563,563,563,563,563,563,563,196,563,563, +563,196,564,564,196,196,196,196,196,196,196,196,196,196,196,196, /* block 45 */ -518,518,518,518,518,518,518,518,518,518,518,518,518,518,518,518, -518,518,518,518,518,518,518,518,518,518,518,518,518,518,518,518, -518,518,518,519,519,518,518,518,518,518,518,518,518,518,518,518, -518,518,518,518,520,520,521,522,522,522,522,522,522,522,521,521, -521,521,521,521,521,521,522,521,521,523,523,523,523,523,523,523, -523,523,524,523,525,525,525,526,527,527,525,528,518,523,163,163, -529,529,529,529,529,529,529,529,529,529,163,163,163,163,163,163, -530,530,530,530,530,530,530,530,530,530,163,163,163,163,163,163, +565,565,565,565,565,565,565,565,565,565,565,565,565,565,565,565, +565,565,565,565,565,565,565,565,565,565,565,565,565,565,565,565, +565,565,565,566,566,565,565,565,565,565,565,565,565,565,565,565, +565,565,565,565,567,567,568,569,569,569,569,569,569,569,568,568, +568,568,568,568,568,568,569,568,568,570,570,570,570,570,570,570, +570,570,571,570,572,572,573,574,575,575,573,576,577,570,196,196, +578,578,578,578,578,578,578,578,578,578,196,196,196,196,196,196, +579,579,579,579,579,579,579,579,579,579,196,196,196,196,196,196, /* block 46 */ -531,531,532,533,534,532,535,531,534,536,537,538,538,538,539,538, -540,540,540,540,540,540,540,540,540,540,163,163,163,163,163,163, -541,541,541,541,541,541,541,541,541,541,541,541,541,541,541,541, -541,541,541,541,541,541,541,541,541,541,541,541,541,541,541,541, -541,541,541,542,541,541,541,541,541,541,541,541,541,541,541,541, -541,541,541,541,541,541,541,541,541,541,541,541,541,541,541,541, -541,541,541,541,541,541,541,541,541,541,541,541,541,541,541,541, -541,541,541,541,541,541,541,541,541,163,163,163,163,163,163,163, +580,580,581,582,583,581,584,580,583,585,586,587,587,587,588,587, +589,589,589,589,589,589,589,589,589,589,196,196,196,196,196,196, +590,590,590,590,590,590,590,590,590,590,590,590,590,590,590,590, +590,590,590,590,590,590,590,590,590,590,590,590,590,590,590,590, +590,590,590,591,590,590,590,590,590,590,590,590,590,590,590,590, +590,590,590,590,590,590,590,590,590,590,590,590,590,590,590,590, +590,590,590,590,590,590,590,590,590,590,590,590,590,590,590,590, +590,590,590,590,590,590,590,590,590,196,196,196,196,196,196,196, /* block 47 */ -541,541,541,541,541,543,543,541,541,541,541,541,541,541,541,541, -541,541,541,541,541,541,541,541,541,541,541,541,541,541,541,541, -541,541,541,541,541,541,541,541,541,544,541,163,163,163,163,163, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,163,163,163,163,163,163,163,163,163,163, +590,590,590,590,590,592,592,590,590,590,590,590,590,590,590,590, +590,590,590,590,590,590,590,590,590,590,590,590,590,590,590,590, +590,590,590,590,590,590,590,590,590,593,590,196,196,196,196,196, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +543,543,543,543,543,543,196,196,196,196,196,196,196,196,196,196, /* block 48 */ -545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, -545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,163, -546,546,546,547,547,547,547,546,546,547,547,547,163,163,163,163, -547,547,546,547,547,547,547,547,547,548,548,548,163,163,163,163, -549,163,163,163,550,550,551,551,551,551,551,551,551,551,551,551, -552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552, -552,552,552,552,552,552,552,552,552,552,552,552,552,552,163,163, -552,552,552,552,552,163,163,163,163,163,163,163,163,163,163,163, +594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,594, +594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,196, +595,595,595,596,596,596,596,595,595,596,596,596,196,196,196,196, +596,596,595,596,596,596,596,596,596,597,597,597,196,196,196,196, +598,196,196,196,599,599,600,600,600,600,600,600,600,600,600,600, +601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, +601,601,601,601,601,601,601,601,601,601,601,601,601,601,196,196, +601,601,601,601,601,196,196,196,196,196,196,196,196,196,196,196, /* block 49 */ -553,553,553,553,553,553,553,553,553,553,553,553,553,553,553,553, -553,553,553,553,553,553,553,553,553,553,553,553,553,553,553,553, -553,553,553,553,553,553,553,553,553,553,553,553,163,163,163,163, -553,553,553,553,553,554,554,554,553,553,554,553,553,553,553,553, -553,553,553,553,553,553,553,553,553,553,163,163,163,163,163,163, -555,555,555,555,555,555,555,555,555,555,556,163,163,163,557,557, -558,558,558,558,558,558,558,558,558,558,558,558,558,558,558,558, -558,558,558,558,558,558,558,558,558,558,558,558,558,558,558,558, +602,602,602,602,602,602,602,602,602,602,602,602,602,602,602,602, +602,602,602,602,602,602,602,602,602,602,602,602,602,602,602,602, +602,602,602,602,602,602,602,602,602,602,602,602,196,196,196,196, +602,602,602,602,602,603,603,603,602,602,603,602,602,602,602,602, +602,602,602,602,602,602,602,602,602,602,196,196,196,196,196,196, +604,604,604,604,604,604,604,604,604,604,605,196,196,196,606,606, +607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,607, +607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,607, /* block 50 */ -559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,559, -559,559,559,559,559,559,559,560,560,561,561,560,163,163,562,562, -563,563,563,563,563,563,563,563,563,563,563,563,563,563,563,563, -563,563,563,563,563,563,563,563,563,563,563,563,563,563,563,563, -563,563,563,563,563,563,563,563,563,563,563,563,563,563,563,563, -563,563,563,563,563,564,565,564,565,565,565,565,565,565,565,163, -566,567,565,567,567,565,565,565,565,565,565,565,565,564,564,564, -564,564,564,565,565,568,568,568,568,568,568,568,568,163,163,568, +608,608,608,608,608,608,608,608,608,608,608,608,608,608,608,608, +608,608,608,608,608,608,608,609,609,610,610,609,196,196,611,611, +612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,612, +612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,612, +612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,612, +612,612,612,612,612,613,614,613,614,614,614,614,614,614,614,196, +615,616,614,616,616,614,614,614,614,614,614,614,614,613,613,613, +613,613,613,614,614,617,617,617,617,617,617,617,617,196,196,617, /* block 51 */ -569,569,569,569,569,569,569,569,569,569,163,163,163,163,163,163, -569,569,569,569,569,569,569,569,569,569,163,163,163,163,163,163, -570,570,570,570,570,570,570,571,572,572,572,572,570,570,163,163, -154,154,154,154,154,154,154,154,154,154,154,154,154,154,573,574, -574,154,154,154,154,154,154,154,154,154,154,154,574,574,574,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +618,618,618,618,618,618,618,618,618,618,196,196,196,196,196,196, +618,618,618,618,618,618,618,618,618,618,196,196,196,196,196,196, +619,619,619,619,619,619,619,620,621,621,621,621,619,619,196,196, +176,176,176,176,176,176,176,176,176,176,176,176,176,176,622,623, +623,176,176,176,176,176,176,176,176,176,176,176,623,623,623,176, +176,176,176,176,176,176,176,176,176,176,176,176,176,176,196,196, +176,176,176,176,176,176,176,176,176,176,176,176,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 52 */ -575,575,575,575,576,577,577,577,577,577,577,577,577,577,577,577, -577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, -577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, -577,577,577,577,578,579,575,575,575,575,575,576,575,576,576,576, -576,576,575,576,580,577,577,577,577,577,577,577,577,163,163,163, -581,581,581,581,581,581,581,581,581,581,582,582,583,584,582,582, -583,585,585,585,585,585,585,585,585,585,585,578,578,578,578,578, -578,578,578,578,585,585,585,585,585,585,585,585,585,582,582,163, +624,624,624,624,625,626,626,626,626,626,626,627,627,626,626,626, +626,626,626,627,627,627,627,627,627,627,627,627,627,627,627,627, +627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,627, +627,627,627,627,628,629,624,624,624,624,624,629,624,629,625,625, +625,625,624,629,630,627,627,627,627,627,627,627,627,196,631,631, +632,632,632,632,632,632,632,632,632,632,631,631,633,634,631,631, +633,635,635,635,635,635,635,635,635,635,635,628,628,628,628,628, +628,628,628,628,635,635,635,635,635,635,635,635,635,631,631,631, /* block 53 */ -586,586,587,588,588,588,588,588,588,588,588,588,588,588,588,588, -588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588, -588,587,586,586,586,586,587,587,586,586,589,590,586,586,588,588, -591,591,591,591,591,591,591,591,591,591,588,588,588,588,588,588, -592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, -592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, -592,592,592,592,592,592,593,594,595,595,594,594,594,595,594,595, -595,595,596,596,163,163,163,163,163,163,163,163,597,597,597,597, +636,636,637,638,638,638,638,638,638,638,638,638,638,638,638,638, +638,638,638,638,638,638,638,638,638,638,638,638,638,638,638,638, +638,637,636,636,636,636,637,637,636,636,639,640,636,636,638,638, +641,641,641,641,641,641,641,641,641,641,642,638,638,638,642,642, +643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,643, +643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,643, +643,643,643,643,643,643,644,645,646,646,645,645,645,646,645,646, +646,646,647,647,196,196,196,196,196,196,196,196,648,648,648,648, /* block 54 */ -598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,598, -598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,598, -598,598,598,598,599,599,599,599,599,599,599,599,600,600,600,600, -600,600,600,600,599,599,601,602,163,163,163,603,603,604,604,604, -605,605,605,605,605,605,605,605,605,605,163,163,163,598,598,598, -606,606,606,606,606,606,606,606,606,606,607,607,607,607,607,607, -607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,607, -607,607,607,607,607,607,607,607,608,608,608,609,608,608,610,610, +649,649,649,649,649,649,649,649,649,649,649,649,649,649,649,649, +649,649,649,649,649,649,649,649,649,649,649,649,649,649,649,649, +649,649,649,649,650,650,650,650,650,650,650,650,651,651,651,651, +651,651,651,651,650,650,652,653,196,196,196,654,654,655,655,655, +656,656,656,656,656,656,656,656,656,656,196,196,196,649,649,649, +657,657,657,657,657,657,657,657,657,657,658,658,658,658,658,658, +658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658, +658,658,658,658,658,658,658,658,659,659,659,660,659,659,661,661, /* block 55 */ -611,612,613,614,615,616,617,618,619,163,163,163,163,163,163,163, -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, -620,620,620,620,620,620,620,620,620,620,620,163,163,620,620,620, -621,621,621,621,621,621,621,621,163,163,163,163,163,163,163,163, -622,623,622,624,623,625,625,626,625,626,627,623,626,626,623,623, -626,628,623,623,623,623,623,623,623,629,630,631,631,625,631,631, -631,631,632,633,634,630,630,635,636,636,637,163,163,163,163,163, +662,663,664,665,666,667,668,669,670,275,276,196,196,196,196,196, +671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, +671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, +671,671,671,671,671,671,671,671,671,671,671,196,196,671,671,671, +672,672,672,672,672,672,672,672,196,196,196,196,196,196,196,196, +673,674,673,675,674,676,677,678,679,680,681,674,680,680,674,674, +680,682,683,674,674,674,674,674,674,684,685,686,687,688,687,687, +687,687,689,690,691,692,692,693,694,694,695,196,196,196,196,196, /* block 56 */ 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70,221,221,221,221,221,638,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,639,639,639, -639,639,148,147,147,147,639,639,639,639,639, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70,640,641, 70, 70, 70,642, 70, 70, + 70, 70, 70, 70, 70, 70,256,256,256,256,256,696,149,149,149,149, +149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149, +149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149, +149,149,149,149,149,149,149,149,149,149,149,149,149,697,697,697, +697,697,150,149,149,149,697,697,697,697,697, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70,698,699, 70, 70, 70,700, 70, 70, /* block 57 */ - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,643, 70, - 70, 70, 70, 70, 70, 70,644, 70, 70, 70, 70,645,645,645,645,645, -645,645,645,645,646,645,645,645,646,645,645,645,645,645,645,645, -645,645,645,645,645,645,645,645,645,645,645,645,645,645,645,647, -648,648,158,158,154,154,154,154,154,154,154,154,154,154,154,154, -158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158, -158,158,158,158,158,158,158,574,574,574,574,574,574,574,574,574, -574,574,574,574,574,154,154,154,649,154,650,154,154,154,154,154, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,701, 70, + 70, 70, 70, 70, 70, 70,702, 70, 70, 70, 70,149,149,149,149,149, +149,149,149,149,150,149,149,149,150,149,149,149,149,149,149,149, +149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,703, +704,704,189,189,176,176,176,176,176,176,176,176,176,176,176,176, +189,189,189,623,623,623,623,623,623,623,623,623,623,623,623,623, +623,623,623,623,623,623,623,623,623,623,623,623,623,623,623,623, +623,623,623,623,623,176,176,176,705,176,706,176,176,176,176,176, /* block 58 */ 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, @@ -2986,12 +3259,12 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 78080 bytes, block = 128 */ 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, -651,652, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, +707,708, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, /* block 59 */ 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 69, 69, 69, 69,653,654, 70, 70,655, 70, + 65, 66, 65, 66, 65, 66, 69, 69, 69, 69,709,710, 70, 70,711, 70, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 67, 65, 66, 65, 66, @@ -3000,123 +3273,123 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 78080 bytes, block = 128 */ 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, /* block 60 */ -656,656,656,656,656,656,656,656,657,657,657,657,657,657,657,657, -656,656,656,656,656,656,163,163,657,657,657,657,657,657,163,163, -656,656,656,656,656,656,656,656,657,657,657,657,657,657,657,657, -656,656,656,656,656,656,656,656,657,657,657,657,657,657,657,657, -656,656,656,656,656,656,163,163,657,657,657,657,657,657,163,163, -173,656,173,656,173,656,173,656,163,657,163,657,163,657,163,657, -656,656,656,656,656,656,656,656,657,657,657,657,657,657,657,657, -658,658,659,659,659,659,660,660,661,661,662,662,663,663,163,163, +712,712,712,712,712,712,712,712,713,713,713,713,713,713,713,713, +712,712,712,712,712,712,196,196,713,713,713,713,713,713,196,196, +712,712,712,712,712,712,712,712,713,713,713,713,713,713,713,713, +712,712,712,712,712,712,712,712,713,713,713,713,713,713,713,713, +712,712,712,712,712,712,196,196,713,713,713,713,713,713,196,196, +714,712,714,712,714,712,714,712,196,713,196,713,196,713,196,713, +712,712,712,712,712,712,712,712,713,713,713,713,713,713,713,713, +715,715,716,716,716,716,717,717,718,718,719,719,720,720,196,196, /* block 61 */ -664,664,664,664,664,664,664,664,665,665,665,665,665,665,665,665, -664,664,664,664,664,664,664,664,665,665,665,665,665,665,665,665, -664,664,664,664,664,664,664,664,665,665,665,665,665,665,665,665, -656,656,666,667,666,163,173,666,657,657,668,668,669,162,670,162, -162,162,666,667,666,163,173,666,671,671,671,671,669,162,162,162, -656,656,173,173,163,163,173,173,657,657,672,672,163,162,162,162, -656,656,173,173,173,215,173,173,657,657,673,673,220,162,162,162, -163,163,666,667,666,163,173,666,674,674,675,675,669,162,162,163, +721,721,721,721,721,721,721,721,722,722,722,722,722,722,722,722, +721,721,721,721,721,721,721,721,722,722,722,722,722,722,722,722, +721,721,721,721,721,721,721,721,722,722,722,722,722,722,722,722, +712,712,723,724,723,196,714,723,713,713,725,725,726,201,727,201, +201,201,723,724,723,196,714,723,728,728,728,728,726,201,201,201, +712,712,714,729,196,196,714,714,713,713,730,730,196,201,201,201, +712,712,714,731,714,250,714,714,713,713,732,732,255,201,201,201, +196,196,723,724,723,196,714,723,733,733,734,734,726,201,201,196, /* block 62 */ -676,676,676,676,676,676,676,676,676,676,676, 51,677,678,679,680, -681,681,681,681,681,681,682, 43,683,684,685,686,686,687,685,686, - 43, 43, 43, 43,688, 43, 43,688,689,690,691,692,693,694,695,696, -697,697,698,698,698, 43, 43, 43, 43, 49, 57, 43,699,700, 43,701, -702, 43, 43, 43,703,704,705,700,700,699, 43, 43, 43, 43, 43, 43, - 43, 43, 50,706,701, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,676, - 51,707,707,707,707,708,709,710,711,712,713,713,713,713,713,713, - 54,646,163,163, 54, 54, 54, 54, 54, 54,714,715,716,717,718,645, +735,735,735,735,735,735,735,735,735,735,735, 51,736,737,738,739, +740,740,740,740,740,740,741, 43,742,743,744,745,745,746,744,745, + 43, 43, 43, 43,747, 43, 43,748,749,750,751,752,753,754,755,756, +757,757,758,758,758, 43, 43, 43, 43, 49, 57, 43,759,760, 43,761, +762, 43, 43, 43,763,764,765,760,760,759, 43, 43, 43, 43, 43,766, + 43, 43, 50,767,761, 43, 43, 43, 43, 43,768, 43, 43,769, 43,735, + 51,770,770,770,770,771,772,773,774,775,776,776,776,776,776,776, + 54,777,196,196, 54, 54, 54, 54, 54, 54,778,779,780,781,782,783, /* block 63 */ - 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,714,715,716,717,718,163, -645,645,645,645,645,645,645,645,645,645,645,645,645,163,163,163, -430,430,430,430,430,430,430,430,430,430,430,430,430,430,430,430, -430,430,430,430,430,430,430,430,430,430,430,430,430,430,430,430, -430,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719, -720,720,720,720,720,720,720,720,720,720,720,720,720,721,721,721, -721,720,721,722,721,720,720,158,158,158,158,720,720,720,720,720, -723,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, + 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,778,779,780,781,782,196, +783,783,783,783,783,783,783,783,783,783,783,783,783,196,196,196, +477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477, +477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477, +477,477,784,784,784,784,784,784,784,784,784,784,784,784,784,784, +785,785,785,785,785,785,785,785,785,785,785,785,785,786,786,786, +786,785,786,787,786,785,785,189,189,189,189,785,785,785,785,785, +788,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 64 */ -724,724,725,724,724,724,724,725,724,724,726,725,725,725,726,726, -725,725,725,726,724,725,724,724,727,725,725,725,725,725,724,724, -724,724,728,724,725,724,729,724,725,730,731,732,725,725,733,726, -725,725,734,725,726,735,735,735,735,736,724,724,726,726,725,725, -716,716,716,716,716,725,726,726,737,737,724,716,724,724,738,461, +789,789,790,789,789,789,789,790,789,789,791,790,790,790,791,791, +790,790,790,791,789,790,789,789,792,790,790,790,790,790,789,789, +789,789,793,789,790,789,794,789,790,795,796,797,790,790,798,791, +790,790,799,790,791,800,800,800,800,801,789,789,791,791,790,790, +802,802,802,802,802,790,791,791,803,803,789,802,789,789,804,508, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, -739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739, -740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +806,806,806,806,806,806,806,806,806,806,806,806,806,806,806,806, /* block 65 */ -741,741,741, 65, 66,741,741,741,741, 58,724,724,163,163,163,163, - 50, 50, 50, 50,742,743,743,743,743,743, 50, 50,744,744,744,744, - 50,744,744, 50,744,744, 50,744, 45,743,743,744,744,744, 50, 45, -744,744, 45, 45, 45, 45,744,744, 45, 45, 45, 45,744,744,744,744, -744,744,744,744,744,744,744,744,744,744,744,744,744,744, 50, 50, -744,744, 50,744, 50,744,744,744,744,744,744,744, 45,744, 45, 45, - 45, 45, 45, 45,744,744, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, +807,807,807, 65, 66,807,807,807,807, 58,789,789,196,196,196,196, + 50, 50, 50, 50,808,809,809,809,809,809, 50, 50,810,810,810,810, + 50,810,810, 50,810,810, 50,810, 45,809,809,810,810,810, 50, 45, +810,810, 45, 45, 45, 45,810,810, 45, 45, 45, 45,810,810,810,810, +810,810,810,810,810,810,810,810,810,810,810,810,810,810, 50, 50, +810,810, 50,810, 50,810,810,810,810,810,810,810, 45,810, 45, 45, + 45, 45, 45, 45,810,810, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, /* block 66 */ - 50, 50, 50, 50, 50, 50, 50, 50,745,745,745,745,745,745, 50, 50, - 50, 50,746, 53, 50,745, 50, 50, 50, 50, 50, 50, 50, 50, 50,745, -745,745,745, 50,745, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,745,745, 50, 50, - 50, 50, 50,745, 50,745, 50, 50, 50, 50, 50, 50,745, 50, 50, 50, - 50, 50,745,745,745,745, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50,745,745,745,745,745,745,745,745, 50, 50,745,745, -745,745,745,745,745,745,745,745,745,745,745,745,745,745,745,745, + 50, 50,811, 50, 50, 50, 50,811,812,812,812,812,812,812, 50, 50, + 50, 50,813, 53, 50,812, 50, 50, 50, 50, 50, 50, 50, 50,811,812, +812,812,812, 50,812, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,812,812, 50, 50, + 50, 50, 50,812, 50,812, 50, 50, 50, 50, 50, 50,812, 50, 50, 50, + 50, 50,812,812,812,812, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50,812,812,812,812,812,812,812,812, 50, 50,812,812, +812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, /* block 67 */ -745,745,745,745,745,745,745,745,745,745,745,745, 50, 50, 50,745, -745,745,745, 50, 50, 50, 50, 50,745, 50, 50, 50, 50, 50, 50, 50, - 50, 50,745,745, 50, 50,745, 50,745,745, 50,745, 50, 50, 50, 50, -745,745,745,745,745,745,745,745,745, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50,745,745,745,745,745, 50, 50, -745,745, 50, 50, 50, 50,745,745,745,745,745,745,745,745,745,745, -745,745,745,745,745,745,745,745,745,745,745,745,745,745, 50, 50, -745,745,745,745,745, 50,745,745, 50, 50,745,745,745,745,745, 50, +812,812,812,812,812,812,812,812,812,812,812,812, 50, 50, 50,812, +812,812,812, 50, 50, 50, 50, 50,812, 50, 50, 50, 50, 50, 50, 50, + 50, 50,812,812, 50, 50,812, 50,812,812, 50,812, 50, 50, 50, 50, +812,812,812,812,812,812,812,812,812, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50,812,812,812,812,812, 50, 50, +812,812, 50, 50, 50, 50,812,812,812,812,812,812,812,812,812,812, +812,812,812,812,812,812,812,812,812,812,812,812,812,812, 50, 50, +812,812,812,812,812, 50,812,812, 50, 50,812,812,812,812,812, 50, /* block 68 */ - 45, 45, 45, 45, 45, 45, 45, 45,747,748,747,748, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,749,749, 45, 45, 45, 45, - 50, 50, 45, 45, 45, 45, 45, 45, 47,750,751, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45,752,752,752,752,752,752,752,752,752,752, -752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752, -752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752, -752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752, -752,752,752,752,752,752,752,752,752,752,752, 45, 50, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45,814,815,814,815, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,816,816, 45, 45, 45, 45, + 50, 50, 45, 45, 45, 45, 45, 45, 47,817,818, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45,819,819,819,819,819,819,819,819,819,819, +819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,819, +819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,819, +819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,819, +819,819,819,819,819,819,819,819,819,819,819, 45, 50, 45, 45, 45, /* block 69 */ - 45, 45, 45, 45, 45, 45, 45, 45,753, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45,752, 45, 45, 45, 45, 45, 50, 50, 50, 50, 50, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45,819, 45, 45, 45, 45, 45, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50,744,744, 45,744, 45, 45, 45, 45, 45, 45, 45, 45, + 50, 50, 50, 50,810,810, 45,810, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 47, -744, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 50, 50, 50, 50, - 50, 50,744, 45, 45, 45, 45, 45, 45,749,749,749,749, 47, 47, 47, -749, 47, 47,749, 45, 45, 45, 45, 47, 47, 47, 45, 45, 45, 45, 45, +810, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 50, 50, 50, 50, + 50, 50,810, 45, 45, 45, 45, 45, 45,816,816,816,816, 47, 47, 47, +816, 47, 47,816, 45, 45, 45, 45, 47, 47, 47, 45, 45, 45, 45, 45, /* block 70 */ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45,754,754,754,754,754,754,754,754,754, -754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,754,754,754,754,754, -754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,820,820,820,820,820,820, +820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,820,820,820,820,820, +820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, /* block 71 */ - 58, 58, 58, 58, 58, 58, 58, 58, 54, 54, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,755,755,755,755,755,755,755,755,755,755, -755,755,756,755,755,755,755,755,755,755,755,755,755,755,755,755, -757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,757, -757,757,757,757,757,757,757,757,757,757, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58,821,821,821,821,821,821,821,821, +821,821,821,821,821,821,821,821,821,821,821,821,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,822,822,822,822,822,822,822,822,822,822, +822,822,823,822,822,822,822,822,822,822,822,822,822,822,822,822, +824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824, +824,824,824,824,824,824,824,824,824,824, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, /* block 72 */ @@ -3132,2322 +3405,2412 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 78080 bytes, block = 128 */ /* block 73 */ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, -744,744, 45, 45, 45, 45, 45, 45, 45, 45, 47, 47, 45, 45,744,744, -744,744,744,744,744,744,743, 50, 45, 45, 45, 45,744,744,744,744, -743, 50, 45, 45, 45, 45,744,744, 45, 45,744,744, 45, 45, 45,744, -744,744,744,744, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45,744, 45,744, 45, 45,744,744,744,744,744,744, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 50, 50, 50,742,742,758,758, 50, +810,810, 45, 45, 45, 45, 45, 45, 45, 45, 47, 47, 45, 45,810,810, +810,810,810,810,810,810,809, 50, 45, 45, 45, 45,810,810,810,810, +809, 50, 45, 45, 45, 45,810,810, 45, 45,810,810, 45, 45, 45,810, +810,810,810,810, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45,810, 45,810, 45, 45,810,810,810,810,810,810, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 50, 50, 50,808,808,825,825, 50, /* block 74 */ - 47, 47, 47, 47, 47,759,744,753,753,753,753,753,753,753, 47,753, -753, 47,753, 45,749,749,753,753, 47,753,753,753,753,760,753,753, - 47,753, 47, 47,753,753, 47,753,753,753, 47,753,753,753, 47, 47, -753,753,753,753,753,753,753,753, 47, 47, 47,753,753,753,753,753, -743,753,743,753,753,753,753,753,749,749,749,749,749,749,749,749, -749,749,749,749,753,753,753,753,753,753,753,753,753,753,753, 47, -743,759,759,743,753, 47, 47,753, 47,753,753,753,753,759,759,761, -753,753,753,753,753,753,753,753,753,753,753, 47,753,753, 47,749, + 47, 47, 47, 47, 47,810,810, 45, 45, 45, 45, 45, 45, 45, 47, 45, + 45, 47, 45, 45,816,816, 45, 45, 47, 45, 45, 45, 45,826, 45, 45, + 47, 45, 47, 47, 45, 45, 47, 45, 45, 45, 47, 45, 45, 45, 47, 47, + 45, 45, 45, 45, 45, 45, 45, 45, 47, 47, 47, 45, 45, 45, 45, 45, +809, 45,809, 45, 45, 45, 45, 45,816,816,816,816,816,816,816,816, +816,816,816,816, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 47, +809,810,810,809, 45, 47, 47, 45, 47, 45, 45, 45, 45,810,810, 50, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 47, 45, 45, 47,816, /* block 75 */ -753,753,753,753,753,753, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, -753,753, 47,749, 47, 47, 47, 47,753, 47,753, 47, 47,753,753,753, - 47,749,753,753,753,753,753, 47,753,753,749,749,762,753,753,753, - 47, 47,753,753,753,753,753,753,753,753,753,753,753,749,749,753, -753,753,753,753,749,749,753,753, 47,753,753,753,753,753,749, 47, -753, 47,753, 47,749,753,753,753,753,753,753,753,753,753,753,753, -753,753,753,753,753,753,753,753,753, 47,749,753,753,753,753,753, - 47, 47,749,749, 47,749,753, 47, 47,760,749,753,753,749,753,753, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 47,816, 47, 47, 47, 47, 45, 47, 45, 47, 47, 45, 45, 45, + 47,816, 45, 45, 45, 45, 45, 47, 45, 45,816,816,819, 45, 45, 45, + 47, 47, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,816,816, 45, + 45, 45, 45, 45,816,816, 45, 45, 47, 45, 45, 45, 45, 45,816, 47, + 45, 47, 45, 47,816, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 47,816, 45, 45, 45, 45, 45, + 47, 47,816,816, 47,816, 45, 47, 47,826,816, 45, 45,816, 45, 45, /* block 76 */ -753,753, 47,753,753,749, 45, 45, 47, 47,763,763,760,760,753, 47, -753,753, 47, 45, 47, 45, 47, 45, 45, 45, 45, 45, 45, 47, 45, 45, - 45, 47, 45, 45, 45, 45, 45, 45,749, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 47, 45, 45,816, 45, 45, 47, 47,827,827,826,826, 45, 47, + 45, 45, 47, 45, 47, 45, 47, 45, 45, 45, 45, 45, 45, 47, 45, 45, + 45, 47, 45, 45, 45, 45, 45, 45,816, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 47, 47, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 47, 45, 45, 47, 45, 45, 45, 45,749, 45,749, 45, - 45, 45, 45,749,749,749, 45,749, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 47, 47,753,753,753,704,705,704,705,704,705,704,705, -704,705,704,705,704,705, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 45, 45, 45, 45, 47, 45, 45, 47, 45, 45, 45, 45,816, 45,816, 45, + 45, 45, 45,816,816,816, 45,816, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 47, 47, 45, 45, 45,764,765,764,765,764,765,764,765, +764,765,764,765,764,765, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, /* block 77 */ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 45,749,749,749, 45, 45, 45, 45, 45, 45, 45, 45, + 58, 58, 58, 58, 45,816,816,816, 45, 45, 45, 45, 45, 45, 45, 45, 45, 47, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, -749, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,749, - 50, 50, 50,745,745,747,748, 50,745,745, 50,745, 50,745, 50, 50, - 50, 50, 50, 50, 50,745,745, 50, 50, 50, 50, 50,745,745,745, 50, - 50, 50,745,745,745,745,747,748,747,748,747,748,747,748,747,748, +816, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,816, + 50, 50, 50,812,812,814,815, 50,812,812, 50,812, 50,812, 50, 50, + 50, 50, 50, 50, 50,812,812, 50, 50, 50, 50, 50,812,812,812, 50, + 50, 50,812,812,812,812,814,815,814,815,814,815,814,815,814,815, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, /* block 78 */ -764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764, -764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764, -764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764, -764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764, -764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764, -764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764, -764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764, -764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764, +828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828, +828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828, +828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828, +828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828, +828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828, +828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828, +828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828, +828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828, /* block 79 */ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50,742,742, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50,808,808, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, /* block 80 */ - 50, 50, 50,747,748,747,748,747,748,747,748,747,748,747,748,747, -748,747,748,747,748,747,748,747,748, 50, 50,745, 50, 50, 50, 50, -745, 50, 50,745,745,745, 50, 50,745,745,745,745,745,745,745,745, - 50, 50, 50, 50, 50, 50, 50, 50,745, 50, 50, 50, 50, 50, 50, 50, -745,745, 50, 50,745,745, 50, 50, 50, 50, 50, 50, 50, 50, 50,745, -745,745,745, 50,745,745, 50, 50,747,748,747,748, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50,745,745, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50,745, 50, 50,745,745, 50, 50,747,748, 50, 50, + 50, 50, 50,814,815,814,815,814,815,814,815,814,815,814,815,814, +815,814,815,814,815,814,815,814,815, 50, 50,812, 50, 50, 50, 50, +812, 50, 50,812,812,812, 50, 50,812,812,812,812,812,812,812,812, + 50, 50, 50, 50, 50, 50, 50, 50,812, 50, 50, 50, 50, 50, 50, 50, +812,812, 50, 50,812,812, 50, 50, 50, 50, 50, 50, 50, 50, 50,812, +812,812,812, 50,812,812, 50, 50,814,815,814,815, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50,812,812, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50,812, 50, 50,812,812, 50, 50,814,815, 50, 50, /* block 81 */ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,745,745,745,745, 50, - 50, 50, 50, 50,745,745, 50, 50, 50, 50, 50, 50,745,745, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,812,812,812,812, 50, + 50, 50, 50, 50,812,812, 50, 50, 50, 50, 50, 50,812,812, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50,745,745, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50,745,745,745,745,745,745,745, + 50, 50, 50, 50,812,812, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50,812,812,812,812,812,812,812, /* block 82 */ -745,745,745,745,745,745,745,745,745,745,745,745,745,745,745,745, -745,745,745,745,745,745,745,745,745,745,745,745,745,745,745,745, -745,745,745, 50, 50, 50,745,745,745,745,745,745,745,745, 50,745, -745,745,745,745,745,745,745,745,745,745,745,745,745,745,745,745, -745,745,745,745,745,745,745,745,745,745,745,745,745,745,745,745, -745,745,745,745,745,745,745, 50, 50, 50, 50, 50, 50, 50,745, 50, - 50, 50, 50,745,745,745, 50, 50, 50, 50, 50, 50,745,745,745, 50, - 50, 50, 50, 50, 50, 50, 50,745,745,745,745, 50, 50, 50, 50, 50, +812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, +812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, +812,812,812, 50, 50, 50,812,812,812,812,812,812,812,812, 50,812, +812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, +812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, +812,812,812,812,812,812,812, 50, 50, 50, 50, 50, 50, 50,812, 50, + 50, 50, 50,812,812,812, 50, 50, 50, 50, 50, 50,812,812,812, 50, + 50, 50, 50, 50, 50, 50, 50,812,812,812,812, 50, 50, 50, 50, 50, /* block 83 */ 45, 45, 45, 45, 45, 47, 47, 47, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,749,749, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,816,816, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 45, 45, 50, 50, 50, 50, 50, 50, 45, 45, 45, -749, 45, 45, 45, 45,749, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, +816, 45, 45, 45, 45,816, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45,754,754, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45,820,820, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, /* block 84 */ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45,754, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,765, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,829, 45, /* block 85 */ -766,766,766,766,766,766,766,766,766,766,766,766,766,766,766,766, -766,766,766,766,766,766,766,766,766,766,766,766,766,766,766,766, -766,766,766,766,766,766,766,766,766,766,766,766,766,766,766,766, -767,767,767,767,767,767,767,767,767,767,767,767,767,767,767,767, -767,767,767,767,767,767,767,767,767,767,767,767,767,767,767,767, -767,767,767,767,767,767,767,767,767,767,767,767,767,767,767,767, - 65, 66,768,769,770,771,772, 65, 66, 65, 66, 65, 66,773,774,775, -776, 70, 65, 66, 70, 65, 66, 70, 70, 70, 70, 70,646,645,777,777, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, +831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, +831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, + 65, 66,832,833,834,835,836, 65, 66, 65, 66, 65, 66,837,838,839, +840, 70, 65, 66, 70, 65, 66, 70, 70, 70, 70, 70,777,783,841,841, /* block 86 */ -211,212,211,212,211,212,211,212,211,212,211,212,211,212,211,212, -211,212,211,212,211,212,211,212,211,212,211,212,211,212,211,212, -211,212,211,212,211,212,211,212,211,212,211,212,211,212,211,212, -211,212,211,212,211,212,211,212,211,212,211,212,211,212,211,212, -211,212,211,212,211,212,211,212,211,212,211,212,211,212,211,212, -211,212,211,212,211,212,211,212,211,212,211,212,211,212,211,212, -211,212,211,212,778,779,779,779,779,779,779,211,212,211,212,780, -780,780,211,212,163,163,163,163,163,781,781,781,781,782,781,781, +246,247,246,247,246,247,246,247,246,247,246,247,246,247,246,247, +246,247,246,247,246,247,246,247,246,247,246,247,246,247,246,247, +246,247,246,247,246,247,246,247,246,247,246,247,246,247,246,247, +246,247,246,247,246,247,246,247,246,247,246,247,246,247,246,247, +246,247,246,247,246,247,246,247,246,247,246,247,246,247,246,247, +246,247,246,247,246,247,246,247,246,247,246,247,246,247,246,247, +246,247,246,247,842,843,843,843,843,843,843,246,247,246,247,844, +844,844,246,247,196,196,196,196,196,845,845,845,846,847,846,846, /* block 87 */ -783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,783, -783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,783, -783,783,783,783,783,783,163,783,163,163,163,163,163,783,163,163, -784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784, -784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784, -784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784, -784,784,784,784,784,784,784,784,163,163,163,163,163,163,163,785, -786,163,163,163,163,163,163,163,163,163,163,163,163,163,163,787, +848,848,848,848,848,848,848,848,848,848,848,848,848,848,848,848, +848,848,848,848,848,848,848,848,848,848,848,848,848,848,848,848, +848,848,848,848,848,848,196,848,196,196,196,196,196,848,196,196, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,196,196,196,196,196,196,196,850, +851,196,196,196,196,196,196,196,196,196,196,196,196,196,196,852, /* block 88 */ -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,484,484,484,484,484,484,163,163,163,163,163,163,163,163,163, -484,484,484,484,484,484,484,163,484,484,484,484,484,484,484,163, -484,484,484,484,484,484,484,163,484,484,484,484,484,484,484,163, -484,484,484,484,484,484,484,163,484,484,484,484,484,484,484,163, -484,484,484,484,484,484,484,163,484,484,484,484,484,484,484,163, -788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788, -788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,196,196,196,196,196,196,196,196,196, +531,531,531,531,531,531,531,196,531,531,531,531,531,531,531,196, +531,531,531,531,531,531,531,196,531,531,531,531,531,531,531,196, +531,531,531,531,531,531,531,196,531,531,531,531,531,531,531,196, +531,531,531,531,531,531,531,196,531,531,531,531,531,531,531,196, +853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, +853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, /* block 89 */ - 43, 43,789,790,789,790, 43, 43, 43,789,790, 43,789,790, 43, 43, - 43, 43, 43, 43, 43, 43, 43,681, 43, 43,681, 43,789,790, 43, 43, -789,790,704,705,704,705,704,705,704,705, 43, 43, 43, 43,700,791, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,681,681,700, 43, 43, 43, -681,792,685,793, 43, 43, 43, 43, 43, 43, 43, 43,792, 43,792,792, - 45, 45, 43,700,700,704,705,704,705,704,705,704,705,681,754,754, -754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754, -754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754, + 43, 43,854,855,854,855, 43, 43, 43,854,855, 43,854,855, 43, 43, + 43, 43, 43, 43, 43, 43, 43,856, 43, 43,740, 43,854,855, 43, 43, +854,855,764,765,764,765,764,765,764,765, 43, 43, 43, 43,760,857, +858,859, 43, 43, 43, 43, 43, 43, 43, 43,740,740,860, 43, 43, 43, +740,861,744,862, 43, 43, 43, 43, 43, 43, 43, 43,863, 43,863,863, + 45, 45, 43,760,760,764,765,764,765,764,765,764,765,740,820,820, +820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, +820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, /* block 90 */ -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,163,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,163,163,163,163,163,163,163,163,163,163,163,163, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,196,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,196,196,196,196,196,196,196,196,196,196,196,196, /* block 91 */ -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, /* block 92 */ -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,794,794,794,794,794,794,794,794,794,794, -794,794,794,794,794,794,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -795,795,796,796,795,795,795,795,795,795,795,795,163,163,163,163, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,864,864,864,864,864,864,864,864,864,864, +864,864,864,864,864,864,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +865,865,866,866,865,865,865,865,865,865,865,865,865,865,867,867, /* block 93 */ -676,797,798,799,724,800,801,802,803,804,803,804,805,806,805,806, -803,804, 45,807,803,804,803,804,803,804,803,804,808,809,810,810, - 45,802,802,802,802,802,802,802,802,802,811,811,811,811,812,812, -813,814,814,814,814,814,724,815,802,802,802,816,817,818,819,819, -163,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, +735,868,869,870,789,871,872,873,874,875,876,877,878,879,878,879, +880,881, 45,882,880,881,880,881,880,881,880,881,883,884,885,885, + 45,873,873,873,873,873,873,873,873,873,886,886,886,886,887,887, +888,889,889,889,889,889,789,890,873,873,873,891,892,893,894,894, +196,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, /* block 94 */ -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,163,163,821,821,822,822,823,823,820, -824,825,825,825,825,825,825,825,825,825,825,825,825,825,825,825, -825,825,825,825,825,825,825,825,825,825,825,825,825,825,825,825, -825,825,825,825,825,825,825,825,825,825,825,825,825,825,825,825, -825,825,825,825,825,825,825,825,825,825,825,825,825,825,825,825, -825,825,825,825,825,825,825,825,825,825,825,825,825,825,825,825, -825,825,825,825,825,825,825,825,825,825,825,826,827,828,828,825, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,196,196,896,896,897,897,898,898,895, +899,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900, +900,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900, +900,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900, +900,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900, +900,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900, +900,900,900,900,900,900,900,900,900,900,900,901,902,903,903,900, /* block 95 */ -163,163,163,163,163,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -163,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,831,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +196,196,196,196,196,904,904,904,904,904,904,904,904,904,904,904, +904,904,904,904,904,904,904,904,904,904,904,904,904,904,904,904, +904,904,904,904,904,904,904,904,904,904,904,904,904,904,904,904, +196,905,905,905,905,905,905,905,905,905,905,905,905,905,905,905, +905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,905, +905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,905, +905,905,905,905,906,905,905,905,905,905,905,905,905,905,905,905, +905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,905, /* block 96 */ -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,163, -832,832,833,833,833,833,832,832,832,832,832,832,832,832,832,832, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, -819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,819, -819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,819, -819,819,819,819,163,163,163,163,163,163,163,163,163,163,163,163, -825,825,825,825,825,825,825,825,825,825,825,825,825,825,825,825, +905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,196, +907,907,908,908,908,908,907,907,907,907,907,907,907,907,907,907, +904,904,904,904,904,904,904,904,904,904,904,904,904,904,904,904, +904,904,904,904,904,904,904,904,904,904,904,904,904,904,904,904, +894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894, +894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894, +894,894,894,894,894,894,196,196,196,196,196,196,196,196,196,865, +900,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900, /* block 97 */ -834,834,834,834,834,834,834,834,834,834,834,834,834,834,834,834, -834,834,834,834,834,834,834,834,834,834,834,834,834,835,835,163, -833,833,833,833,833,833,833,833,833,833,832,832,832,832,832,832, -832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832, -832,832,832,832,832,832,832,832,836,836,836,836,836,836,836,836, -724, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, -834,834,834,834,834,834,834,834,834,834,834,834,834,834,834,834, -834,834,834,834,834,834,834,834,834,834,834,834,835,835,835,461, +909,909,909,909,909,909,909,909,909,909,909,909,909,909,909,909, +909,909,909,909,909,909,909,909,909,909,909,909,909,910,910,196, +908,908,908,908,908,908,908,908,908,908,907,907,907,907,907,907, +907,907,907,907,907,907,907,907,907,907,907,907,907,907,907,907, +907,907,907,907,907,907,907,907,911,911,911,911,911,911,911,911, +789, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, +909,909,909,909,909,909,909,909,909,909,909,909,909,909,909,909, +909,909,909,909,909,909,909,909,909,909,909,909,910,910,910,508, /* block 98 */ -833,833,833,833,833,833,833,833,833,833,832,832,832,832,832,832, -832,832,832,832,832,832,832,837,832,837,832,832,832,832,832,832, -832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832, -832, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, -832,832,832,832,832,832,832,832,832,832,832,832,724,724,724,724, -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,832, +908,908,908,908,908,908,908,908,908,908,907,907,907,907,907,907, +907,907,907,907,907,907,907,912,907,912,907,907,907,907,907,907, +907,907,907,907,907,907,907,907,907,907,907,907,907,907,907,907, +907, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, +907,907,907,907,907,907,907,907,907,907,907,907,789,789,789,789, +913,913,913,913,913,913,913,913,913,913,913,913,913,913,913,913, +913,913,913,913,913,913,913,913,913,913,913,913,913,913,913,913, +913,913,913,913,913,913,913,913,913,913,913,913,913,913,913,907, /* block 99 */ -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, -838,838,838,838,838,838,838,838,832,832,832,832,832,832,832,832, -832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832, -832,461,461,461,461,461,461,724,724,724,724,832,832,832,832,832, +913,913,913,913,913,913,913,913,913,913,913,913,913,913,913,913, +913,913,913,913,913,913,913,913,913,913,913,913,913,913,913,913, +913,913,913,913,913,913,913,913,913,913,913,913,913,913,913,913, +913,913,913,913,913,913,913,913,913,913,913,913,913,913,913,913, +913,913,913,913,913,913,913,913,913,913,913,913,913,913,913,913, +913,913,913,913,913,913,913,913,907,907,907,907,907,907,907,907, +907,907,907,907,907,907,907,907,907,907,907,907,907,907,907,907, +907,508,508,508,508,508,508,789,789,789,789,907,907,907,907,907, /* block 100 */ -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,724,724, -832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832, -832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,724, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,789,789, +907,907,907,907,907,907,907,907,907,907,907,907,907,907,907,907, +907,907,907,907,907,907,907,907,907,907,907,907,907,907,907,789, /* block 101 */ -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, /* block 102 */ -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, /* block 103 */ -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,841,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,916,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, /* block 104 */ -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, -840,840,840,840,840,840,840,840,840,840,840,840,840,840,840,840, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, +915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, /* block 105 */ -840,840,840,840,840,840,840,840,840,840,840,840,840,163,163,163, -842,842,842,842,842,842,842,842,842,842,842,842,842,842,842,842, -842,842,842,842,842,842,842,842,842,842,842,842,842,842,842,842, -842,842,842,842,842,842,842,842,842,842,842,842,842,842,842,842, -842,842,842,842,842,842,842,163,163,163,163,163,163,163,163,163, -843,843,843,843,843,843,843,843,843,843,843,843,843,843,843,843, -843,843,843,843,843,843,843,843,843,843,843,843,843,843,843,843, -843,843,843,843,843,843,843,843,844,844,844,844,844,844,845,846, +915,915,915,915,915,915,915,915,915,915,915,915,915,196,196,196, +917,917,917,917,917,917,917,917,917,917,917,917,917,917,917,917, +917,917,917,917,917,917,917,917,917,917,917,917,917,917,917,917, +917,917,917,917,917,917,917,917,917,917,917,917,917,917,917,917, +917,917,917,917,917,917,917,196,196,196,196,196,196,196,196,196, +918,918,918,918,918,918,918,918,918,918,918,918,918,918,918,918, +918,918,918,918,918,918,918,918,918,918,918,918,918,918,918,918, +918,918,918,918,918,918,918,918,919,919,919,919,919,919,920,921, /* block 106 */ -847,847,847,847,847,847,847,847,847,847,847,847,847,847,847,847, -847,847,847,847,847,847,847,847,847,847,847,847,847,847,847,847, -847,847,847,847,847,847,847,847,847,847,847,847,847,847,847,847, -847,847,847,847,847,847,847,847,847,847,847,847,847,847,847,847, -847,847,847,847,847,847,847,847,847,847,847,847,847,847,847,847, -847,847,847,847,847,847,847,847,847,847,847,847,847,847,847,847, -847,847,847,847,847,847,847,847,847,847,847,847,847,847,847,847, -847,847,847,847,847,847,847,847,847,847,847,847,847,847,847,847, +922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922, +922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922, +922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922, +922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922, +922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922, +922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922, +922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922, +922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922, /* block 107 */ -847,847,847,847,847,847,847,847,847,847,847,847,848,849,850,850, -847,847,847,847,847,847,847,847,847,847,847,847,847,847,847,847, -851,851,851,851,851,851,851,851,851,851,847,847,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -240,241,240,241,240,241,240,241,240,241,852,853,240,241,240,241, -240,241,240,241,240,241,240,241,240,241,240,241,240,241,240,241, -240,241,240,241,240,241,240,241,240,241,240,241,240,241,854,246, -248,248,248,855,788,788,788,788,788,788,788,788,856,856,855,857, +922,922,922,922,922,922,922,922,922,922,922,922,923,924,925,925, +922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922, +926,926,926,926,926,926,926,926,926,926,922,922,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +275,276,275,276,275,276,275,276,275,276,927,928,275,276,275,276, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,275,276, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,929,281, +283,283,283,930,853,853,853,853,853,853,853,853,931,931,930,932, /* block 108 */ -240,241,240,241,240,241,240,241,240,241,240,241,240,241,240,241, -240,241,240,241,240,241,240,241,240,241,240,241,858,858,788,788, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,860,860,860,860,860,860,860,860,860,860, -861,861,862,863,864,864,864,863,163,163,163,163,163,163,163,163, +275,276,275,276,275,276,275,276,275,276,275,276,275,276,275,276, +275,276,275,276,275,276,275,276,275,276,275,276,933,933,853,853, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,935,935,935,935,935,935,935,935,935,935, +936,936,937,938,939,939,939,938,196,196,196,196,196,196,196,196, /* block 109 */ -865,865,865,865,865,865,865,865, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46,149,149,149,149,149,149,149,149,149, +940,940,940,940,940,940,940,940, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46,151,151,151,151,151,151,151,151,151, 46, 46, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 70, 70, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, -645, 70, 70, 70, 70, 70, 70, 70, 70, 65, 66, 65, 66,866, 65, 66, +783, 70, 70, 70, 70, 70, 70, 70, 70, 65, 66, 65, 66,941, 65, 66, /* block 110 */ - 65, 66, 65, 66, 65, 66, 65, 66,149,867,867, 65, 66,868, 70, 92, - 65, 66, 65, 66,869, 70, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, 65, 66,870,871,872,873,870, 70, -874,875,876,877, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66,878,879,880, 65, 66, 65, 66,163,163,163,163,163, - 65, 66,163, 70,163, 70, 65, 66, 65, 66,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,645,645,645, 65, 66, 92,147,147, 70, 92, 92, 92, 92, 92, + 65, 66, 65, 66, 65, 66, 65, 66,151,942,942, 65, 66,943, 70, 93, + 65, 66, 65, 66,944, 70, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, 65, 66,945,946,947,948,945, 70, +949,950,951,952, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66,953,954,955, 65, 66, 65, 66,956, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, 65, 66, 65, 66,957,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,149,783,783,783, 65, 66, 93,149,149, 70, 93, 93, 93, 93, 93, /* block 111 */ -881,881,882,881,881,881,883,881,881,881,881,882,881,881,881,881, -881,881,881,881,881,881,881,881,881,881,881,881,881,881,881,881, -881,881,881,884,884,882,882,884,885,885,885,885,883,163,163,163, -886,886,886,887,887,887,888,888,889,890,163,163,163,163,163,163, -891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891, -891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891, -891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891, -891,891,891,891,892,892,893,893,163,163,163,163,163,163,163,163, +958,958,959,958,958,958,960,958,958,958,958,959,958,958,958,958, +958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,958, +958,958,958,961,961,959,959,961,962,962,962,962,960,196,196,196, +963,963,963,964,964,964,965,965,966,967,196,196,196,196,196,196, +968,968,968,968,968,968,968,968,968,968,968,968,968,968,968,968, +968,968,968,968,968,968,968,968,968,968,968,968,968,968,968,968, +968,968,968,968,968,968,968,968,968,968,968,968,968,968,968,968, +968,968,968,968,969,969,970,970,196,196,196,196,196,196,196,196, /* block 112 */ -894,894,895,895,895,895,895,895,895,895,895,895,895,895,895,895, -895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, -895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, -895,895,895,895,894,894,894,894,894,894,894,894,894,894,894,894, -894,894,894,894,896,897,163,163,163,163,163,163,163,163,898,898, -899,899,899,899,899,899,899,899,899,899,163,163,163,163,163,163, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,900,335,901,335,335,335,335,343,343,343,335,343,335,335,333, +971,971,972,972,972,972,972,972,972,972,972,972,972,972,972,972, +972,972,972,972,972,972,972,972,972,972,972,972,972,972,972,972, +972,972,972,972,972,972,972,972,972,972,972,972,972,972,972,972, +972,972,972,972,971,971,971,971,971,971,971,971,971,971,971,971, +971,971,971,971,973,974,196,196,196,196,196,196,196,196,975,975, +976,976,976,976,976,976,976,976,976,976,196,196,196,196,196,196, +376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, +376,977,374,978,374,374,374,374,383,383,383,374,383,374,374,372, /* block 113 */ -902,902,902,902,902,902,902,902,902,902,903,903,903,903,903,903, -903,903,903,903,903,903,903,903,903,903,903,903,903,903,903,903, -903,903,903,903,903,903,904,904,904,904,904,905,905,905,906,907, -908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908, -908,908,908,908,908,908,908,909,909,909,909,909,909,909,909,909, -909,909,910,911,163,163,163,163,163,163,163,163,163,163,163,912, -479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479, -479,479,479,479,479,479,479,479,479,479,479,479,479,163,163,163, +979,979,979,979,979,979,979,979,979,979,980,980,980,980,980,980, +980,980,980,980,980,980,980,980,980,980,980,980,980,980,980,980, +980,980,980,980,980,980,981,981,981,981,981,982,982,982,983,984, +985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985, +985,985,985,985,985,985,985,986,986,986,986,986,986,986,986,986, +986,986,987,988,196,196,196,196,196,196,196,196,196,196,196,989, +526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, +526,526,526,526,526,526,526,526,526,526,526,526,526,196,196,196, /* block 114 */ -913,913,913,914,915,915,915,915,915,915,915,915,915,915,915,915, -915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, -915,915,915,915,915,915,915,915,915,915,915,915,915,915,915,915, -915,915,915,916,914,914,913,913,913,913,914,914,913,913,914,914, -917,918,918,918,918,918,918,919,920,920,918,918,918,918,163,921, -922,922,922,922,922,922,922,922,922,922,163,163,163,163,918,918, -462,462,462,462,462,472,923,462,462,462,462,462,462,462,462,462, -473,473,473,473,473,473,473,473,473,473,462,462,462,462,462,163, +990,990,990,991,992,992,992,992,992,993,993,993,992,992,992,993, +993,993,993,993,993,993,993,993,993,993,993,993,993,993,993,993, +993,993,993,993,993,993,993,993,993,993,993,993,993,993,993,993, +993,993,993,994,991,991,990,990,990,990,991,991,990,990,991,991, +995,996,996,996,996,996,996,997,998,998,996,996,996,996,196,999, +1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,196,196,196,196,996,996, +509,509,509,509,509,519,1001,509,509,509,509,509,509,509,509,509, +520,520,520,520,520,520,520,520,520,520,509,509,509,509,509,196, /* block 115 */ -924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,924, -924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,924, -924,924,924,924,924,924,924,924,924,925,925,925,925,925,925,926, -926,925,925,926,926,925,925,163,163,163,163,163,163,163,163,163, -924,924,924,925,924,924,924,924,924,924,924,924,925,926,163,163, -927,927,927,927,927,927,927,927,927,927,163,163,928,929,929,929, -462,462,462,462,462,462,462,462,462,462,462,462,462,462,462,462, -923,462,462,462,462,462,462,474,474,474,462,471,472,471,462,462, +1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002, +1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002, +1002,1002,1002,1002,1002,1002,1002,1002,1002,1003,1003,1003,1003,1003,1003,1004, +1004,1003,1003,1004,1004,1003,1003,196,196,196,196,196,196,196,196,196, +1002,1002,1002,1003,1002,1002,1002,1002,1002,1002,1002,1002,1003,1004,196,196, +1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,196,196,1006,1007,1007,1007, +509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, +1001,509,509,509,1008,1008,1008,521,521,521,509,518,519,518,509,509, /* block 116 */ -930,930,930,930,930,930,930,930,930,930,930,930,930,930,930,930, -930,930,930,930,930,930,930,930,930,930,930,930,930,930,930,930, -930,930,930,930,930,930,930,930,930,930,930,930,930,930,930,930, -931,930,931,931,931,932,932,931,931,932,930,932,932,930,931,933, -934,933,934,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,930,930,935,936,937, -938,938,938,938,938,938,938,938,938,938,938,939,940,940,939,939, -941,941,938,942,942,939,943,163,163,163,163,163,163,163,163,163, +1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009, +1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009, +1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009, +1010,1009,1010,1010,1010,1011,1011,1010,1010,1011,1009,1011,1011,1009,1010,1012, +1013,1012,1013,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,1009,1009,1014,1015,1016, +1017,1017,1017,1017,1017,1017,1017,1017,1017,1017,1017,1018,1019,1019,1018,1018, +1020,1020,1021,1022,1022,1018,1023,196,196,196,196,196,196,196,196,196, /* block 117 */ -163,484,484,484,484,484,484,163,163,484,484,484,484,484,484,163, -163,484,484,484,484,484,484,163,163,163,163,163,163,163,163,163, -484,484,484,484,484,484,484,163,484,484,484,484,484,484,484,163, +196,531,531,531,531,531,531,196,196,531,531,531,531,531,531,196, +196,531,531,531,531,531,531,196,196,196,196,196,196,196,196,196, +531,531,531,531,531,531,531,196,531,531,531,531,531,531,531,196, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70,944, 70, 70, 70, 70, 70, 70, 70,867,147,147,147,147, - 70, 70, 70, 70, 70,221, 70, 70, 70,147, 46, 46,163,163,163,163, -945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945, + 70, 70, 70,1024, 70, 70, 70, 70, 70, 70, 70,942,149,149,149,149, + 70, 70, 70, 70, 70,256, 70, 70, 70,149, 46, 46,196,196,196,196, +1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025, /* block 118 */ -945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945, -945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945, -945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945, -945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945, -938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938, -938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938, -938,938,938,939,939,940,939,939,940,939,939,941,946,943,163,163, -947,947,947,947,947,947,947,947,947,947,163,163,163,163,163,163, +1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025, +1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025, +1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025, +1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025, +1017,1017,1017,1017,1017,1017,1017,1017,1017,1017,1017,1017,1017,1017,1017,1017, +1017,1017,1017,1017,1017,1017,1017,1017,1017,1017,1017,1021,1021,1021,1021,1021, +1021,1021,1021,1018,1018,1019,1018,1018,1019,1018,1018,1020,1026,1023,196,196, +1027,1027,1027,1027,1027,1027,1027,1027,1027,1027,196,196,196,196,196,196, /* block 119 */ -948,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,948,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,948,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,948,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -948,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, +1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, /* block 120 */ -949,949,949,949,949,949,949,949,949,949,949,949,948,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,948,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,948,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -948,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,948,949,949,949, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029, /* block 121 */ -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,948,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,948,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -948,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,948,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, /* block 122 */ -949,949,949,949,949,949,949,949,948,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,948,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -948,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,948,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,948,949,949,949,949,949,949,949, +1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029, /* block 123 */ -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,948,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -948,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,948,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,948,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, /* block 124 */ -949,949,949,949,948,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -948,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,948,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,948,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,948,949,949,949,949,949,949,949,949,949,949,949, +1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, /* block 125 */ -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -948,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,948,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,948,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,948,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, /* block 126 */ -949,949,949,949,949,949,949,949,948,949,949,949,949,949,949,949, -949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949, -949,949,949,949,163,163,163,163,163,163,163,163,163,163,163,163, -482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482, -482,482,482,482,482,482,482,163,163,163,163,483,483,483,483,483, -483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, -483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, -483,483,483,483,483,483,483,483,483,483,483,483,163,163,163,163, +1029,1029,1029,1029,1029,1029,1029,1029,1028,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, +1029,1029,1029,1029,196,196,196,196,196,196,196,196,196,196,196,196, +529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529, +529,529,529,529,529,529,529,196,196,196,196,530,530,530,530,530, +530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, +530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, +530,530,530,530,530,530,530,530,530,530,530,530,196,196,196,196, /* block 127 */ -950,950,950,950,950,950,950,950,950,950,950,950,950,950,950,950, -950,950,950,950,950,950,950,950,950,950,950,950,950,950,950,950, -950,950,950,950,950,950,950,950,950,950,950,950,950,950,950,950, -950,950,950,950,950,950,950,950,950,950,950,950,950,950,950,950, -950,950,950,950,950,950,950,950,950,950,950,950,950,950,950,950, -950,950,950,950,950,950,950,950,950,950,950,950,950,950,950,950, -950,950,950,950,950,950,950,950,950,950,950,950,950,950,950,950, -950,950,950,950,950,950,950,950,950,950,950,950,950,950,950,950, +1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, +1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, +1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, +1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, +1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, +1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, +1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, +1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, /* block 128 */ -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, /* block 129 */ -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, /* block 130 */ -952,952,952,952,952,952,952,952,952,952,952,952,952,952,839,839, -952,839,952,839,839,952,952,952,952,952,952,952,952,952,952,839, -952,839,952,839,839,952,952,839,839,839,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,163,163, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,914,914, +1032,914,1032,914,914,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,914, +1032,914,1032,914,914,1032,1032,914,914,914,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,196,196, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, /* block 131 */ -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 132 */ -653,653,653,653,653,653,653,163,163,163,163,163,163,163,163,163, -163,163,163,257,257,257,257,257,163,163,163,163,163,270,265,270, -270,270,270,270,270,270,270,270,270,953,270,270,270,270,270,270, -270,270,270,270,270,270,270,262,270,270,270,270,270,262,270,262, -270,270,262,270,270,262,270,270,270,270,270,270,270,270,270,270, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, +709,709,709,709,709,1033,1034,196,196,196,196,196,196,196,196,196, +196,196,196,292,292,292,292,292,196,196,196,196,196,303,299,303, +303,303,303,303,303,303,303,303,303,1035,303,303,303,303,303,303, +303,303,303,303,303,303,303,297,303,303,303,303,303,297,303,297, +303,303,297,303,303,297,303,303,303,303,303,303,303,303,303,303, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, /* block 133 */ -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,331,331,331,331,331,331,331,331,331,331,331,331,331,331, -331,331,331,302,302,302,302,302,302,302,302,302,302,302,302,302, -302,302,302,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,368,368,368,368,368,368,368,368,368,368,368,368,368,368, +368,368,368,313,313,313,313,313,313,313,313,313,313,313,313,313, +313,313,313,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, /* block 134 */ -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,954,954, -954,954,954,954,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,1036,1036, +1036,1036,1036,1036,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, /* block 135 */ -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, /* block 136 */ -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,955,956, -280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,1037,1038, +313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, /* block 137 */ -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -302,302,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,302,302,302,302,302,302,302,280, -957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957, -957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957, -286,286,958,286,286,286,286,286,286,286,954,954,277,959,280,280, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +313,313,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,313,313,313,313,313,313,313,313, +1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039, +1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039, +319,319,1040,319,319,319,319,319,319,319,1036,1036,310,1041,313,313, /* block 138 */ -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,961, -962,962,962,963,962,962,962,964,965,962,163,163,163,163,163,163, -154,154,154,154,154,154,154,154,154,154,154,154,154,154,856,856, -962,966,966,701,701,964,965,964,965,964,965,964,965,964,965,964, -965,967,968,967,968,799,799,964,965,962,962,962,962,701,701,701, -969,166,970,163,166,971,972,972,966,973,974,973,974,973,974,975, -962,976,714,977,978,978,716,163,976,430,975,962,163,163,163,163, -954,286,954,286,954,302,954,286,954,286,954,286,954,286,954,286, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1043, +1044,1044,1045,1046,1044,1045,1045,1047,1048,1044,196,196,196,196,196,196, +176,176,176,176,176,176,176,176,176,176,176,176,176,176,931,931, +1044,1049,1049,761,761,1047,1048,1047,1048,1047,1048,1047,1048,1047,1048,1047, +1048,1050,1051,1050,1051,870,870,1047,1048,1044,1044,1044,1044,761,761,761, +1052,199,1053,196,199,1054,1045,1045,1049,1055,1056,1055,1056,1055,1056,1057, +1044,1058,1059,1060,1061,1061,802,196,1058,477,1057,1044,196,196,196,196, +1036,319,1036,319,1036,338,1036,319,1036,319,1036,319,1036,319,1036,319, /* block 139 */ -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286, -286,286,286,286,286,286,286,286,286,286,286,286,286,302,302, 51, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, +319,319,319,319,319,319,319,319,319,319,319,319,319,338,338, 51, /* block 140 */ -163,972,979,975,430,975,962,980,973,974,962,714,969,981,970,982, -983,983,983,983,983,983,983,983,983,983,971,166,978,716,978,972, -962,984,984,984,984,984,984, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,973,976,974,985,701, - 46,986,986,986,986,986,986, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,973,716,974,716,973, -974,987,988,989,990,826,825,825,825,825,825,825,825,825,825,825, -827,825,825,825,825,825,825,825,825,825,825,825,825,825,825,825, +196,1045,1062,1057,477,1057,1044,1063,1055,1056,1044,1059,1052,1064,1053,1065, +1066,1066,1066,1066,1066,1066,1066,1066,1066,1066,1054,199,1061,802,1061,1045, +1044,1067,1067,1067,1067,1067,1067, 59, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,1055,1058,1056,1068,761, + 46,1069,1069,1069,1069,1069,1069, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,1055,802,1056,802,1055, +1056,1070,1071,1072,1073,901,900,900,900,900,900,900,900,900,900,900, +902,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900, /* block 141 */ -825,825,825,825,825,825,825,825,825,825,825,825,825,825,825,825, -825,825,825,825,825,825,825,825,825,825,825,825,825,825,991,991, -831,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, -830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,163, -163,163,830,830,830,830,830,830,163,163,830,830,830,830,830,830, -163,163,830,830,830,830,830,830,163,163,830,830,830,163,163,163, -430,430,716, 46,724,430,430,163,724,716,716,716,716,724,724,163, -708,708,708,708,708,708,708,708,708,992,992,992,724,724,957,957, +900,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900, +900,900,900,900,900,900,900,900,900,900,900,900,900,900,1074,1074, +906,905,905,905,905,905,905,905,905,905,905,905,905,905,905,905, +905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,196, +196,196,905,905,905,905,905,905,196,196,905,905,905,905,905,905, +196,196,905,905,905,905,905,905,196,196,905,905,905,196,196,196, +477,477,802, 46,789,477,477,196,789,802,802,802,802,789,789,196, +771,771,771,771,771,771,771,771,771,1075,1075,1075,789,789,1039,1039, /* block 142 */ -993,993,993,993,993,993,993,993,993,993,993,993,163,993,993,993, -993,993,993,993,993,993,993,993,993,993,993,993,993,993,993,993, -993,993,993,993,993,993,993,163,993,993,993,993,993,993,993,993, -993,993,993,993,993,993,993,993,993,993,993,163,993,993,163,993, -993,993,993,993,993,993,993,993,993,993,993,993,993,993,163,163, -993,993,993,993,993,993,993,993,993,993,993,993,993,993,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,196,1076,1076,1076, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076, +1076,1076,1076,1076,1076,1076,1076,196,1076,1076,1076,1076,1076,1076,1076,1076, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,196,1076,1076,196,1076, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,196,196, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 143 */ -993,993,993,993,993,993,993,993,993,993,993,993,993,993,993,993, -993,993,993,993,993,993,993,993,993,993,993,993,993,993,993,993, -993,993,993,993,993,993,993,993,993,993,993,993,993,993,993,993, -993,993,993,993,993,993,993,993,993,993,993,993,993,993,993,993, -993,993,993,993,993,993,993,993,993,993,993,993,993,993,993,993, -993,993,993,993,993,993,993,993,993,993,993,993,993,993,993,993, -993,993,993,993,993,993,993,993,993,993,993,993,993,993,993,993, -993,993,993,993,993,993,993,993,993,993,993,163,163,163,163,163, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076, +1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,1076,196,196,196,196,196, /* block 144 */ -994,995,996,163,163,163,163,997,997,997,997,997,997,997,997,997, -997,997,997,997,997,997,997,997,997,997,997,997,997,997,997,997, -997,997,997,997,997,997,997,997,997,997,997,997,997,997,997,997, -997,997,997,997,163,163,163,998,998,998,998,998,998,998,998,998, -999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999, -999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999, -999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999, -999,999,999,999,999,1000,1000,1000,1000,1001,1001,1001,1001,1001,1001,1001, +1077,1078,1079,196,196,196,196,1080,1080,1080,1080,1080,1080,1080,1080,1080, +1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080, +1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080, +1080,1080,1080,1080,196,196,196,1081,1081,1081,1081,1081,1081,1081,1081,1081, +1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082, +1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082, +1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082, +1082,1082,1082,1082,1082,1083,1083,1083,1083,1084,1084,1084,1084,1084,1084,1084, /* block 145 */ -1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1000,1000,1001,1002,1002,163, -724,724,724,724,724,724,724,724,724,724,724,724,724,163,163,163, -1001,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,158,163,163, +1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1083,1083,1084,1085,1085,196, +789,789,789,789,789,789,789,789,789,789,789,789,789,196,196,196, +1084,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,189,196,196, /* block 146 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 147 */ -1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,1003, -1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,163,163,163, -1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004, -1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004, -1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004,1004, -1004,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1005,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006, -1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,163,163,163,163, +1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086, +1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,196,196,196, +1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087, +1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087, +1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,1087, +1087,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1088,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089, +1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,196,196,196,196, /* block 148 */ -1007,1007,1007,1007,1007,1007,1007,1007,1007,1007,1007,1007,1007,1007,1007,1007, -1007,1007,1007,1007,1007,1007,1007,1007,1007,1007,1007,1007,1007,1007,1007,1007, -1008,1008,1008,1008,163,163,163,163,163,163,163,163,163,1007,1007,1007, -1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009, -1009,1010,1009,1009,1009,1009,1009,1009,1009,1009,1010,163,163,163,163,163, -1011,1011,1011,1011,1011,1011,1011,1011,1011,1011,1011,1011,1011,1011,1011,1011, -1011,1011,1011,1011,1011,1011,1011,1011,1011,1011,1011,1011,1011,1011,1011,1011, -1011,1011,1011,1011,1011,1011,1012,1012,1012,1012,1012,163,163,163,163,163, +1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090, +1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090, +1091,1091,1091,1091,196,196,196,196,196,196,196,196,196,1090,1090,1090, +1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092, +1092,1093,1092,1092,1092,1092,1092,1092,1092,1092,1093,196,196,196,196,196, +1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094, +1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094, +1094,1094,1094,1094,1094,1094,1095,1095,1095,1095,1095,196,196,196,196,196, /* block 149 */ -1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013, -1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,163,1014, -1015,1015,1015,1015,1015,1015,1015,1015,1015,1015,1015,1015,1015,1015,1015,1015, -1015,1015,1015,1015,1015,1015,1015,1015,1015,1015,1015,1015,1015,1015,1015,1015, -1015,1015,1015,1015,163,163,163,163,1015,1015,1015,1015,1015,1015,1015,1015, -1016,1017,1017,1017,1017,1017,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096, +1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,196,1097, +1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098, +1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098, +1098,1098,1098,1098,196,196,196,196,1098,1098,1098,1098,1098,1098,1098,1098, +1099,1100,1100,1100,1100,1100,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 150 */ -1018,1018,1018,1018,1018,1018,1018,1018,1018,1018,1018,1018,1018,1018,1018,1018, -1018,1018,1018,1018,1018,1018,1018,1018,1018,1018,1018,1018,1018,1018,1018,1018, -1018,1018,1018,1018,1018,1018,1018,1018,1019,1019,1019,1019,1019,1019,1019,1019, -1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019, -1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019, -1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020, -1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020, -1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020,1020, +1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101, +1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101, +1101,1101,1101,1101,1101,1101,1101,1101,1102,1102,1102,1102,1102,1102,1102,1102, +1102,1102,1102,1102,1102,1102,1102,1102,1102,1102,1102,1102,1102,1102,1102,1102, +1102,1102,1102,1102,1102,1102,1102,1102,1102,1102,1102,1102,1102,1102,1102,1102, +1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103, +1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103, +1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103, /* block 151 */ -1021,1021,1021,1021,1021,1021,1021,1021,1021,1021,1021,1021,1021,1021,1021,1021, -1021,1021,1021,1021,1021,1021,1021,1021,1021,1021,1021,1021,1021,1021,163,163, -1022,1022,1022,1022,1022,1022,1022,1022,1022,1022,163,163,163,163,163,163, -1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023, -1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023, -1023,1023,1023,1023,163,163,163,163,1024,1024,1024,1024,1024,1024,1024,1024, -1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024, -1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,163,163,163,163, +1104,1104,1104,1104,1104,1104,1104,1104,1104,1104,1104,1104,1104,1104,1104,1104, +1104,1104,1104,1104,1104,1104,1104,1104,1104,1104,1104,1104,1104,1104,196,196, +1105,1105,1105,1105,1105,1105,1105,1105,1105,1105,196,196,196,196,196,196, +1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106, +1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106, +1106,1106,1106,1106,196,196,196,196,1107,1107,1107,1107,1107,1107,1107,1107, +1107,1107,1107,1107,1107,1107,1107,1107,1107,1107,1107,1107,1107,1107,1107,1107, +1107,1107,1107,1107,1107,1107,1107,1107,1107,1107,1107,1107,196,196,196,196, /* block 152 */ -1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025, -1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025, -1025,1025,1025,1025,1025,1025,1025,1025,163,163,163,163,163,163,163,163, -1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026, -1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026, -1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026, -1026,1026,1026,1026,163,163,163,163,163,163,163,163,163,163,163,1027, -1028,1028,1028,1028,1028,1028,1028,1028,1028,1028,1028,163,1028,1028,1028,1028, +1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108, +1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108, +1108,1108,1108,1108,1108,1108,1108,1108,196,196,196,196,196,196,196,196, +1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109, +1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109, +1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109, +1109,1109,1109,1109,196,196,196,196,196,196,196,196,196,196,196,1110, +1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,196,1111,1111,1111,1111, /* block 153 */ -1028,1028,1028,1028,1028,1028,1028,1028,1028,1028,1028,163,1028,1028,1028,1028, -1028,1028,1028,163,1028,1028,163,1029,1029,1029,1029,1029,1029,1029,1029,1029, -1029,1029,163,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029, -1029,1029,163,1029,1029,1029,1029,1029,1029,1029,163,1029,1029,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111,196,1111,1111,1111,1111, +1111,1111,1111,196,1111,1111,196,1112,1112,1112,1112,1112,1112,1112,1112,1112, +1112,1112,196,1112,1112,1112,1112,1112,1112,1112,1112,1112,1112,1112,1112,1112, +1112,1112,196,1112,1112,1112,1112,1112,1112,1112,196,1112,1112,196,196,196, +1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113, +1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113, +1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113, +1113,1113,1113,1113,196,196,196,196,196,196,196,196,196,196,196,196, /* block 154 */ -1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, -1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, -1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, -1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, -1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, -1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, -1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, -1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, +1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114, +1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114, +1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114, +1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114, +1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114, +1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114, +1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114, +1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114, /* block 155 */ -1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, -1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, -1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, -1030,1030,1030,1030,1030,1030,1030,163,163,163,163,163,163,163,163,163, -1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030,1030, -1030,1030,1030,1030,1030,1030,163,163,163,163,163,163,163,163,163,163, -1030,1030,1030,1030,1030,1030,1030,1030,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114, +1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114, +1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114, +1114,1114,1114,1114,1114,1114,1114,196,196,196,196,196,196,196,196,196, +1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114,1114, +1114,1114,1114,1114,1114,1114,196,196,196,196,196,196,196,196,196,196, +1114,1114,1114,1114,1114,1114,1114,1114,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 156 */ -147,1031,1031,147,147,147,163,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,163,147,147,147,147,147,147,147,147,147,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +149,1115,1115,149,149,149,196,149,149,149,149,149,149,149,149,149, +149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149, +149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149, +149,196,149,149,149,149,149,149,149,149,149,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 157 */ -1032,1032,1032,1032,1032,1032,262,262,1032,262,1032,1032,1032,1032,1032,1032, -1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, -1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, -1032,1032,1032,1032,1032,1032,262,1032,1032,262,262,262,1032,262,262,1032, -1033,1033,1033,1033,1033,1033,1033,1033,1033,1033,1033,1033,1033,1033,1033,1033, -1033,1033,1033,1033,1033,1033,262,1034,1035,1035,1035,1035,1035,1035,1035,1035, -1036,1036,1036,1036,1036,1036,1036,1036,1036,1036,1036,1036,1036,1036,1036,1036, -1036,1036,1036,1036,1036,1036,1036,1037,1037,1038,1038,1038,1038,1038,1038,1038, +1116,1116,1116,1116,1116,1116,297,297,1116,297,1116,1116,1116,1116,1116,1116, +1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116, +1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116, +1116,1116,1116,1116,1116,1116,297,1116,1116,297,297,297,1116,297,297,1116, +1117,1117,1117,1117,1117,1117,1117,1117,1117,1117,1117,1117,1117,1117,1117,1117, +1117,1117,1117,1117,1117,1117,297,1118,1119,1119,1119,1119,1119,1119,1119,1119, +1120,1120,1120,1120,1120,1120,1120,1120,1120,1120,1120,1120,1120,1120,1120,1120, +1120,1120,1120,1120,1120,1120,1120,1121,1121,1122,1122,1122,1122,1122,1122,1122, /* block 158 */ -1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039, -1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,1039,262, -262,262,262,262,262,262,262,1040,1040,1040,1040,1040,1040,1040,1040,1040, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -1041,1041,1041,1041,1041,1041,1041,1041,1041,1041,1041,1041,1041,1041,1041,1041, -1041,1041,1041,262,1041,1041,262,262,262,262,262,1042,1042,1042,1042,1042, +1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123, +1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,297, +297,297,297,297,297,297,297,1124,1124,1124,1124,1124,1124,1124,1124,1124, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +1125,1125,1125,1125,1125,1125,1125,1125,1125,1125,1125,1125,1125,1125,1125,1125, +1125,1125,1125,297,1125,1125,297,297,297,297,297,1126,1126,1126,1126,1126, /* block 159 */ -1043,1043,1043,1043,1043,1043,1043,1043,1043,1043,1043,1043,1043,1043,1043,1043, -1043,1043,1043,1043,1043,1043,1044,1044,1044,1044,1044,1044,262,262,262,1045, -1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046, -1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,262,262,262,262,262,1047, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, +1127,1127,1127,1127,1127,1127,1127,1127,1127,1127,1127,1127,1127,1127,1127,1127, +1127,1127,1127,1127,1127,1127,1128,1128,1128,1128,1128,1128,297,297,297,1129, +1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130, +1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,297,297,297,297,297,1131, +1132,1132,1132,1132,1132,1132,1132,1132,1132,1132,1132,1132,1132,1132,1132,1132, +1132,1132,1132,1132,1132,1132,1132,1132,1132,1132,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, /* block 160 */ -1048,1048,1048,1048,1048,1048,1048,1048,1048,1048,1048,1048,1048,1048,1048,1048, -1048,1048,1048,1048,1048,1048,1048,1048,1048,1048,1048,1048,1048,1048,1048,1048, -1049,1049,1049,1049,1049,1049,1049,1049,1049,1049,1049,1049,1049,1049,1049,1049, -1049,1049,1049,1049,1049,1049,1049,1049,262,262,262,262,1050,1050,1049,1049, -1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050, -262,262,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050, -1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050, -1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050, +1133,1133,1133,1133,1133,1133,1133,1133,1133,1133,1133,1133,1133,1133,1133,1133, +1133,1133,1133,1133,1133,1133,1133,1133,1133,1133,1133,1133,1133,1133,1133,1133, +1134,1134,1134,1134,1134,1134,1134,1134,1134,1134,1134,1134,1134,1134,1134,1134, +1134,1134,1134,1134,1134,1134,1134,1134,297,297,297,297,1135,1135,1134,1134, +1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135, +297,297,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135, +1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135, +1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135, /* block 161 */ -1051,1052,1052,1052,262,1052,1052,262,262,262,262,262,1052,1052,1052,1052, -1051,1051,1051,1051,262,1051,1051,1051,262,1051,1051,1051,1051,1051,1051,1051, -1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051, -1051,1051,1051,1051,1051,1051,262,262,1053,1053,1053,262,262,262,262,1054, -1055,1055,1055,1055,1055,1055,1055,1055,1055,262,262,262,262,262,262,262, -1056,1056,1056,1056,1056,1056,1057,1057,1056,262,262,262,262,262,262,262, -1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058, -1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1059,1059,1060, +1136,1137,1137,1137,297,1137,1137,297,297,297,297,297,1137,1137,1137,1137, +1136,1136,1136,1136,297,1136,1136,1136,297,1136,1136,1136,1136,1136,1136,1136, +1136,1136,1136,1136,1136,1136,1136,1136,1136,1136,1136,1136,1136,1136,1136,1136, +1136,1136,1136,1136,1136,1136,297,297,1138,1138,1138,297,297,297,297,1139, +1140,1140,1140,1140,1140,1140,1140,1140,1140,297,297,297,297,297,297,297, +1141,1141,1141,1141,1141,1141,1142,1142,1141,297,297,297,297,297,297,297, +1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143, +1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1144,1144,1145, /* block 162 */ -1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061, -1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1062,1062,1062, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -1063,1063,1063,1063,1063,1063,1063,1063,1064,1063,1063,1063,1063,1063,1063,1063, -1063,1063,1063,1063,1063,1063,1063,1063,1063,1063,1063,1063,1063,1063,1063,1063, -1063,1063,1063,1063,1063,1065,1065,262,262,262,262,1066,1066,1066,1066,1066, -1067,1067,1068,1067,1067,1067,1069,262,262,262,262,262,262,262,262,262, +1146,1146,1146,1146,1146,1146,1146,1146,1146,1146,1146,1146,1146,1146,1146,1146, +1146,1146,1146,1146,1146,1146,1146,1146,1146,1146,1146,1146,1146,1147,1147,1147, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +1148,1148,1148,1148,1148,1148,1148,1148,1149,1148,1148,1148,1148,1148,1148,1148, +1148,1148,1148,1148,1148,1148,1148,1148,1148,1148,1148,1148,1148,1148,1148,1148, +1148,1148,1148,1148,1148,1150,1150,297,297,297,297,1151,1151,1151,1151,1151, +1152,1152,1153,1152,1152,1152,1154,297,297,297,297,297,297,297,297,297, /* block 163 */ -1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070, -1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070, -1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070, -1070,1070,1070,1070,1070,1070,262,262,262,1071,1072,1072,1072,1072,1072,1072, -1073,1073,1073,1073,1073,1073,1073,1073,1073,1073,1073,1073,1073,1073,1073,1073, -1073,1073,1073,1073,1073,1073,262,262,1074,1074,1074,1074,1074,1074,1074,1074, -1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075, -1075,1075,1075,262,262,262,262,262,1076,1076,1076,1076,1076,1076,1076,1076, +1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155, +1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155, +1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155,1155, +1155,1155,1155,1155,1155,1155,297,297,297,1156,1157,1157,1157,1157,1157,1157, +1158,1158,1158,1158,1158,1158,1158,1158,1158,1158,1158,1158,1158,1158,1158,1158, +1158,1158,1158,1158,1158,1158,297,297,1159,1159,1159,1159,1159,1159,1159,1159, +1160,1160,1160,1160,1160,1160,1160,1160,1160,1160,1160,1160,1160,1160,1160,1160, +1160,1160,1160,297,297,297,297,297,1161,1161,1161,1161,1161,1161,1161,1161, /* block 164 */ -1077,1077,1077,1077,1077,1077,1077,1077,1077,1077,1077,1077,1077,1077,1077,1077, -1077,1077,262,262,262,262,262,262,262,1078,1078,1078,1078,262,262,262, -262,262,262,262,262,262,262,262,262,1079,1079,1079,1079,1079,1079,1079, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, +1162,1162,1162,1162,1162,1162,1162,1162,1162,1162,1162,1162,1162,1162,1162,1162, +1162,1162,297,297,297,297,297,297,297,1163,1163,1163,1163,297,297,297, +297,297,297,297,297,297,297,297,297,1164,1164,1164,1164,1164,1164,1164, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, /* block 165 */ -1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080, -1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080, -1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080, -1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080, -1080,1080,1080,1080,1080,1080,1080,1080,1080,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, +1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165, +1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165, +1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165, +1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165,1165, +1165,1165,1165,1165,1165,1165,1165,1165,1165,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, /* block 166 */ -1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081, -1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081, -1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081,1081, -1081,1081,1081,262,262,262,262,262,262,262,262,262,262,262,262,262, -1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082, -1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082, -1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082, -1082,1082,1082,262,262,262,262,262,262,262,1083,1083,1083,1083,1083,1083, +1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166, +1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166, +1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166, +1166,1166,1166,297,297,297,297,297,297,297,297,297,297,297,297,297, +1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167, +1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167, +1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167,1167, +1167,1167,1167,297,297,297,297,297,297,297,1168,1168,1168,1168,1168,1168, /* block 167 */ -1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084, -1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084, -1084,1084,1085,1085,1086,1086,1086,1086,302,302,302,302,302,302,302,302, -1087,1087,1087,1087,1087,1087,1087,1087,1087,1087,302,302,302,302,302,302, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, +1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169, +1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169, +1169,1169,1170,1170,1171,1171,1171,1171,338,338,338,338,338,338,338,338, +1172,1172,1172,1172,1172,1172,1172,1172,1172,1172,338,338,338,338,338,338, +1173,1173,1173,1173,1173,1173,1173,1173,1173,1173,1174,1174,1174,1174,1175,1174, +1176,1176,1176,1176,1176,1176,1176,1176,1176,1176,1176,1176,1176,1176,1176,1176, +1176,1176,1176,1176,1176,1176,297,297,297,1177,1178,1179,1179,1179,1180,1181, +1182,1182,1182,1182,1182,1182,1182,1182,1182,1182,1182,1182,1182,1182,1182,1182, /* block 168 */ -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, +1182,1182,1182,1182,1182,1182,297,297,297,297,297,297,297,297,1183,1183, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, /* block 169 */ -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088, -1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,262, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184, +1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,297, /* block 170 */ -1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089, -1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089, -1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,262,1090,1090,1091,262,262, -1089,1089,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,302, -302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,302, -302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,302, -302,302,302,302,302,302,302,302,302,302,302,302,302,291,291,291, +1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,1185, +1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,1185, +1185,1185,1185,1185,1185,1185,1185,1185,1185,1185,297,1186,1186,1187,297,297, +1185,1185,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +338,338,319,319,319,1188,319,319,338,338,338,338,338,338,338,338, +1189,313,313,313,313,313,313,313,313,338,338,338,338,338,338,338, +338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, +338,338,338,338,338,338,338,338,338,338,324,314,314,331,331,331, /* block 171 */ -1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092, -1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1093,1093,1093, -1093,1093,1093,1093,1093,1093,1093,1092,262,262,262,262,262,262,262,262, -1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094,1094, -1094,1094,1094,1094,1094,1094,1095,1095,1095,1095,1095,1095,1095,1095,1095,1095, -1095,1096,1096,1096,1096,1097,1097,1097,1097,1097,302,302,302,302,302,302, -302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,302, -1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098,1098, +1190,1190,1190,1190,1190,1190,1190,1190,1190,1190,1190,1190,1190,1190,1190,1190, +1190,1190,1190,1190,1190,1190,1190,1190,1190,1190,1190,1190,1190,1191,1191,1191, +1191,1191,1191,1191,1191,1191,1191,1190,297,297,297,297,297,297,297,297, +1192,1192,1192,1192,1192,1192,1192,1192,1192,1192,1192,1192,1192,1192,1192,1192, +1192,1192,1192,1192,1192,1192,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193, +1193,1194,1194,1194,1194,1195,1195,1195,1195,1195,338,338,338,338,338,338, +338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, +1196,1196,1196,1196,1196,1196,1196,1196,1196,1196,1196,1196,1196,1196,1196,1196, /* block 172 */ -1098,1098,1099,1099,1099,1099,1100,1100,1100,1100,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101, -1101,1101,1101,1101,1101,1102,1102,1102,1102,1102,1102,1102,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103, -1103,1103,1103,1103,1103,1103,1103,262,262,262,262,262,262,262,262,262, +1196,1196,1197,1197,1197,1197,1198,1198,1198,1198,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199, +1199,1199,1199,1199,1199,1200,1200,1200,1200,1200,1200,1200,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201, +1201,1201,1201,1201,1201,1201,1201,297,297,297,297,297,297,297,297,297, /* block 173 */ -1104,1105,1104,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106, -1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106, -1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106,1106, -1106,1106,1106,1106,1106,1106,1106,1106,1105,1105,1105,1105,1105,1105,1105,1105, -1105,1105,1105,1105,1105,1105,1107,1108,1108,1109,1109,1109,1109,1109,163,163, -163,163,1110,1110,1110,1110,1110,1110,1110,1110,1110,1110,1110,1110,1110,1110, -1110,1110,1110,1110,1110,1110,1111,1111,1111,1111,1111,1111,1111,1111,1111,1111, -1107,1106,1106,1105,1105,1106,163,163,163,163,163,163,163,163,163,1112, +1202,1203,1202,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204, +1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204, +1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204, +1204,1204,1204,1204,1204,1204,1204,1204,1203,1203,1203,1203,1203,1203,1203,1203, +1203,1203,1203,1203,1203,1203,1205,1206,1206,1207,1207,1207,1207,1207,196,196, +196,196,1208,1208,1208,1208,1208,1208,1208,1208,1208,1208,1208,1208,1208,1208, +1208,1208,1208,1208,1208,1208,1209,1209,1209,1209,1209,1209,1209,1209,1209,1209, +1205,1204,1204,1203,1203,1204,196,196,196,196,196,196,196,196,196,1210, /* block 174 */ -1113,1113,1114,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115, -1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115, -1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115, -1114,1114,1114,1113,1113,1113,1113,1114,1114,1116,1117,1118,1118,1119,1120,1120, -1120,1120,1113,163,163,163,163,163,163,163,163,163,163,1119,163,163, -1121,1121,1121,1121,1121,1121,1121,1121,1121,1121,1121,1121,1121,1121,1121,1121, -1121,1121,1121,1121,1121,1121,1121,1121,1121,163,163,163,163,163,163,163, -1122,1122,1122,1122,1122,1122,1122,1122,1122,1122,163,163,163,163,163,163, +1211,1211,1212,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213, +1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213, +1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213, +1212,1212,1212,1211,1211,1211,1211,1212,1212,1214,1215,1216,1216,1217,1218,1218, +1218,1218,1211,196,196,196,196,196,196,196,196,196,196,1217,196,196, +1219,1219,1219,1219,1219,1219,1219,1219,1219,1219,1219,1219,1219,1219,1219,1219, +1219,1219,1219,1219,1219,1219,1219,1219,1219,196,196,196,196,196,196,196, +1220,1220,1220,1220,1220,1220,1220,1220,1220,1220,196,196,196,196,196,196, /* block 175 */ -1123,1123,1123,1124,1124,1124,1124,1124,1124,1124,1124,1124,1124,1124,1124,1124, -1124,1124,1124,1124,1124,1124,1124,1124,1124,1124,1124,1124,1124,1124,1124,1124, -1124,1124,1124,1124,1124,1124,1124,1123,1123,1123,1123,1123,1125,1123,1123,1123, -1123,1123,1123,1126,1126,163,1127,1127,1127,1127,1127,1127,1127,1127,1127,1127, -1128,1129,1129,1129,1124,1125,1125,1124,163,163,163,163,163,163,163,163, -1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130, -1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130, -1130,1130,1130,1131,1132,1132,1130,163,163,163,163,163,163,163,163,163, +1221,1221,1221,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222, +1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222, +1222,1222,1222,1222,1222,1222,1222,1221,1221,1221,1221,1221,1223,1221,1221,1221, +1221,1221,1221,1224,1224,196,1225,1225,1225,1225,1225,1225,1225,1225,1225,1225, +1226,1227,1227,1227,1222,1223,1223,1222,196,196,196,196,196,196,196,196, +1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228, +1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228, +1228,1228,1228,1229,1230,1230,1228,196,196,196,196,196,196,196,196,196, /* block 176 */ -1133,1133,1134,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135, -1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135, -1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135, -1135,1135,1135,1134,1134,1134,1133,1133,1133,1133,1133,1133,1133,1133,1133,1134, -1136,1135,1137,1137,1135,1138,1138,1139,1139,1140,1141,1141,1141,1138,1134,1133, -1142,1142,1142,1142,1142,1142,1142,1142,1142,1142,1135,1139,1135,1139,1138,1138, -163,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143,1143, -1143,1143,1143,1143,1143,163,163,163,163,163,163,163,163,163,163,163, +1231,1231,1232,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233, +1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233, +1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233, +1233,1233,1233,1232,1232,1232,1231,1231,1231,1231,1231,1231,1231,1231,1231,1232, +1234,1233,1235,1235,1233,1236,1236,1237,1237,1238,1239,1239,1239,1236,1232,1231, +1240,1240,1240,1240,1240,1240,1240,1240,1240,1240,1233,1237,1233,1237,1236,1236, +196,1241,1241,1241,1241,1241,1241,1241,1241,1241,1241,1241,1241,1241,1241,1241, +1241,1241,1241,1241,1241,196,196,196,196,196,196,196,196,196,196,196, /* block 177 */ -1144,1144,1144,1144,1144,1144,1144,1144,1144,1144,1144,1144,1144,1144,1144,1144, -1144,1144,163,1144,1144,1144,1144,1144,1144,1144,1144,1144,1144,1144,1144,1144, -1144,1144,1144,1144,1144,1144,1144,1144,1144,1144,1144,1144,1145,1145,1145,1146, -1146,1146,1145,1145,1146,1147,1148,1146,1149,1149,1150,1149,1149,1151,1146,1144, -1144,1146,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1242,1242,1242,1242,1242,1242,1242,1242,1242,1242,1242,1242,1242,1242,1242,1242, +1242,1242,196,1242,1242,1242,1242,1242,1242,1242,1242,1242,1242,1242,1242,1242, +1242,1242,1242,1242,1242,1242,1242,1242,1242,1242,1242,1242,1243,1243,1243,1244, +1244,1244,1243,1243,1244,1245,1246,1247,1248,1248,1249,1248,1248,1250,1244,1242, +1242,1244,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 178 */ -1152,1152,1152,1152,1152,1152,1152,163,1152,163,1152,1152,1152,1152,163,1152, -1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,163,1152, -1152,1152,1152,1152,1152,1152,1152,1152,1152,1153,163,163,163,163,163,163, -1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154, -1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154, -1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1154,1155, -1156,1156,1156,1155,1155,1155,1155,1155,1155,1157,1158,163,163,163,163,163, -1159,1159,1159,1159,1159,1159,1159,1159,1159,1159,163,163,163,163,163,163, +1251,1251,1251,1251,1251,1251,1251,196,1251,196,1251,1251,1251,1251,196,1251, +1251,1251,1251,1251,1251,1251,1251,1251,1251,1251,1251,1251,1251,1251,196,1251, +1251,1251,1251,1251,1251,1251,1251,1251,1251,1252,196,196,196,196,196,196, +1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253, +1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253, +1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1254, +1255,1255,1255,1254,1254,1254,1254,1254,1254,1256,1257,196,196,196,196,196, +1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,196,196,196,196,196,196, /* block 179 */ -1160,1161,1162,1163,163,1164,1164,1164,1164,1164,1164,1164,1164,163,163,1164, -1164,163,163,1164,1164,1164,1164,1164,1164,1164,1164,1164,1164,1164,1164,1164, -1164,1164,1164,1164,1164,1164,1164,1164,1164,163,1164,1164,1164,1164,1164,1164, -1164,163,1164,1164,163,1164,1164,1164,1164,1164,163,1165,1166,1164,1167,1162, -1160,1162,1162,1162,1162,163,163,1162,1162,163,163,1162,1162,1168,163,163, -1164,163,163,163,163,163,163,1167,163,163,163,163,163,1169,1164,1164, -1164,1164,1162,1162,163,163,1170,1170,1170,1170,1170,1170,1170,163,163,163, -1170,1170,1170,1170,1170,163,163,163,163,163,163,163,163,163,163,163, +1259,1260,1261,1262,196,1263,1263,1263,1263,1263,1263,1263,1263,196,196,1263, +1263,196,196,1263,1263,1263,1263,1263,1263,1263,1263,1263,1263,1263,1263,1263, +1263,1263,1263,1263,1263,1263,1263,1263,1263,196,1263,1263,1263,1263,1263,1263, +1263,196,1263,1263,196,1263,1263,1263,1263,1263,196,1264,1265,1263,1266,1261, +1259,1261,1261,1261,1261,196,196,1261,1261,196,196,1261,1261,1267,196,196, +1263,196,196,196,196,196,196,1266,196,196,196,196,196,1268,1263,1263, +1263,1263,1261,1261,196,196,1269,1269,1269,1269,1269,1269,1269,196,196,196, +1269,1269,1269,1269,1269,196,196,196,196,196,196,196,196,196,196,196, /* block 180 */ -1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171, -1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171, -1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171,1171, -1171,1171,1171,1171,1171,1172,1172,1172,1173,1173,1173,1173,1173,1173,1173,1173, -1172,1172,1174,1173,1173,1172,1175,1171,1171,1171,1171,1176,1176,1177,1178,1178, -1179,1179,1179,1179,1179,1179,1179,1179,1179,1179,1177,1177,163,1178,1180,1171, -1171,1171,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,196,1270,196,196,1270,196, +1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,1270, +1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,1270,1270, +1270,1270,1270,1270,1270,1270,196,1271,1272,1273,1273,1274,1274,1274,1274,1274, +1274,196,1272,196,196,1272,196,1272,1272,1272,1273,196,1273,1273,1275,1276, +1275,1277,1278,1279,1280,1280,196,1281,1281,196,196,196,196,196,196,196, +196,1282,1282,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 181 */ -1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181, -1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181, -1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181, -1182,1183,1183,1184,1184,1184,1184,1184,1184,1183,1184,1183,1183,1182,1183,1184, -1184,1183,1185,1186,1181,1181,1187,1181,163,163,163,163,163,163,163,163, -1188,1188,1188,1188,1188,1188,1188,1188,1188,1188,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283, +1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283, +1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283,1283, +1283,1283,1283,1283,1283,1284,1284,1284,1285,1285,1285,1285,1285,1285,1285,1285, +1284,1284,1286,1285,1285,1284,1287,1283,1283,1283,1283,1288,1288,1289,1290,1290, +1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1289,1289,196,1290,1292,1283, +1283,1283,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 182 */ -1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189, -1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189, -1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1189,1190, -1191,1191,1192,1192,1192,1192,163,163,1191,1191,1191,1191,1192,1192,1191,1193, -1194,1195,1196,1196,1197,1197,1198,1198,1198,1196,1196,1196,1196,1196,1196,1196, -1196,1196,1196,1196,1196,1196,1196,1196,1189,1189,1189,1189,1192,1192,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293, +1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293, +1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293, +1294,1295,1295,1296,1296,1296,1296,1296,1296,1295,1296,1295,1295,1294,1295,1296, +1296,1295,1297,1298,1293,1293,1299,1293,196,196,196,196,196,196,196,196, +1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 183 */ -1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199, -1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199, -1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199,1199, -1200,1200,1200,1201,1201,1201,1201,1201,1201,1201,1201,1200,1200,1201,1200,1202, -1201,1203,1203,1204,1199,163,163,163,163,163,163,163,163,163,163,163, -1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,163,163,163,163,163,163, -531,531,531,531,531,531,531,531,531,531,531,531,531,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301, +1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301, +1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1302, +1303,1303,1304,1304,1304,1304,196,196,1303,1303,1303,1303,1304,1304,1303,1305, +1306,1307,1308,1308,1309,1309,1310,1310,1310,1308,1308,1308,1308,1308,1308,1308, +1308,1308,1308,1308,1308,1308,1308,1308,1301,1301,1301,1301,1304,1304,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 184 */ -1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206, -1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206, -1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1207,1208,1207,1208,1208, -1207,1207,1207,1207,1207,1207,1209,1210,1206,1211,163,163,163,163,163,163, -1212,1212,1212,1212,1212,1212,1212,1212,1212,1212,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311, +1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311, +1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311, +1312,1312,1312,1313,1313,1313,1313,1313,1313,1313,1313,1312,1312,1313,1312,1314, +1313,1315,1315,1316,1311,196,196,196,196,196,196,196,196,196,196,196, +1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,196,196,196,196,196,196, +580,580,580,580,580,580,580,580,580,580,580,580,580,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 185 */ -1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213, -1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,163,163,1214,1214,1214, -1215,1215,1214,1214,1214,1214,1216,1214,1214,1214,1214,1217,163,163,163,163, -1218,1218,1218,1218,1218,1218,1218,1218,1218,1218,1219,1219,1220,1220,1220,1221, -1213,1213,1213,1213,1213,1213,1213,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318, +1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318, +1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1319,1320,1319,1320,1320, +1319,1319,1319,1319,1319,1319,1321,1322,1318,1323,196,196,196,196,196,196, +1324,1324,1324,1324,1324,1324,1324,1324,1324,1324,196,196,196,196,196,196, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 186 */ -1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222, -1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222, -1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1223,1223,1223,1224, -1224,1224,1224,1224,1224,1224,1224,1224,1223,1225,1226,1227,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1325,1325,1325,1325,1325,1325,1325,1325,1325,1325,1325,1325,1325,1325,1325,1325, +1325,1325,1325,1325,1325,1325,1325,1325,1325,1325,1325,196,196,1326,1327,1326, +1328,1328,1326,1326,1326,1326,1327,1326,1326,1326,1326,1329,196,196,196,196, +1330,1330,1330,1330,1330,1330,1330,1330,1330,1330,1331,1331,1332,1332,1332,1333, +1325,1325,1325,1325,1325,1325,1325,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 187 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228, -1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228, -1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229, -1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229,1229, -1230,1230,1230,1230,1230,1230,1230,1230,1230,1230,1231,1231,1231,1231,1231,1231, -1231,1231,1231,163,163,163,163,163,163,163,163,163,163,163,163,1232, +1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334, +1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334, +1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1335,1335,1335,1336, +1336,1336,1336,1336,1336,1336,1336,1336,1335,1337,1338,1339,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 188 */ -1233,1233,1233,1233,1233,1233,1233,163,163,1233,163,163,1233,1233,1233,1233, -1233,1233,1233,1233,163,1233,1233,163,1233,1233,1233,1233,1233,1233,1233,1233, -1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233,1233, -1234,1235,1235,1235,1235,1235,163,1235,1235,163,163,1236,1236,1237,1238,1239, -1235,1239,1235,1240,1241,1242,1241,163,163,163,163,163,163,163,163,163, -1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340, +1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340, +1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341, +1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341, +1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1343,1343,1343,1343,1343,1343, +1343,1343,1343,196,196,196,196,196,196,196,196,196,196,196,196,1344, /* block 189 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1244,1244,1244,1244,1244,1244,1244,1244,163,163,1244,1244,1244,1244,1244,1244, -1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244, -1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244, -1244,1245,1245,1245,1246,1246,1246,1246,163,163,1246,1246,1245,1245,1245,1245, -1247,1244,1248,1244,1245,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1345,1345,1345,1345,1345,1345,1345,196,196,1345,196,196,1345,1345,1345,1345, +1345,1345,1345,1345,196,1345,1345,196,1345,1345,1345,1345,1345,1345,1345,1345, +1345,1345,1345,1345,1345,1345,1345,1345,1345,1345,1345,1345,1345,1345,1345,1345, +1346,1347,1347,1347,1347,1347,196,1347,1347,196,196,1348,1348,1349,1350,1351, +1347,1351,1347,1352,1353,1354,1353,196,196,196,196,196,196,196,196,196, +1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 190 */ -1249,1250,1250,1250,1250,1250,1250,1251,1251,1250,1250,1249,1249,1249,1249,1249, -1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249, -1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249, -1249,1249,1249,1252,1253,1250,1250,1250,1250,1254,1255,1250,1250,1250,1250,1256, -1256,1256,1257,1257,1256,1256,1256,1253,163,163,163,163,163,163,163,163, -1258,1259,1259,1259,1259,1259,1259,1260,1260,1259,1259,1259,1258,1258,1258,1258, -1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258, -1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1356,1356,1356,1356,1356,1356,1356,1356,196,196,1356,1356,1356,1356,1356,1356, +1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356, +1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356, +1356,1357,1357,1357,1358,1358,1358,1358,196,196,1358,1358,1357,1357,1357,1357, +1359,1356,1360,1356,1357,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 191 */ -1258,1258,1258,1258,1261,1261,1261,1261,1261,1261,1259,1259,1259,1259,1259,1259, -1259,1259,1259,1259,1259,1259,1259,1260,1262,1263,1264,1265,1265,1258,1264,1264, -1264,1266,1266,163,163,163,163,163,163,163,163,163,163,163,163,163, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267, -1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267, -1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267,1267, -1267,1267,1267,1267,1267,1267,1267,1267,1267,163,163,163,163,163,163,163, +1361,1362,1362,1362,1362,1362,1362,1363,1363,1362,1362,1361,1361,1361,1361,1361, +1361,1361,1361,1361,1361,1361,1361,1361,1361,1361,1361,1361,1361,1361,1361,1361, +1361,1361,1361,1361,1361,1361,1361,1361,1361,1361,1361,1361,1361,1361,1361,1361, +1361,1361,1361,1364,1365,1362,1362,1362,1362,1366,1367,1362,1362,1362,1362,1368, +1368,1368,1369,1369,1368,1368,1368,1365,196,196,196,196,196,196,196,196, +1370,1371,1371,1371,1371,1371,1371,1372,1372,1371,1371,1371,1370,1370,1370,1370, +1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370, +1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370, /* block 192 */ -343,343,343,343,343,343,343,343,343,343,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1370,1370,1370,1370,1373,1373,1373,1373,1373,1373,1371,1371,1371,1371,1371,1371, +1371,1371,1371,1371,1371,1371,1371,1372,1374,1375,1376,1377,1377,1378,1376,1376, +1376,1379,1379,196,196,196,196,196,196,196,196,196,196,196,196,196, +543,543,543,543,543,543,543,543,543,543,543,543,543,543,543,543, +1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380, +1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380, +1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,1380, +1380,1380,1380,1380,1380,1380,1380,1380,1380,196,196,196,196,196,196,196, /* block 193 */ -1268,1268,1268,1268,1268,1268,1268,1268,1268,163,1268,1268,1268,1268,1268,1268, -1268,1268,1268,1268,1268,1268,1268,1268,1268,1268,1268,1268,1268,1268,1268,1268, -1268,1268,1268,1268,1268,1268,1268,1268,1268,1268,1268,1268,1268,1268,1268,1269, -1270,1270,1270,1270,1270,1270,1270,163,1270,1270,1270,1270,1270,1270,1269,1271, -1268,1272,1272,1273,1274,1274,163,163,163,163,163,163,163,163,163,163, -1275,1275,1275,1275,1275,1275,1275,1275,1275,1275,1276,1276,1276,1276,1276,1276, -1276,1276,1276,1276,1276,1276,1276,1276,1276,1276,1276,1276,1276,163,163,163, -1277,1278,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279, +383,383,383,383,383,383,383,383,383,383,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1231,1232,1231,1231,1231,1232,1231,1232,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 194 */ -1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279, -163,163,1280,1280,1280,1280,1280,1280,1280,1280,1280,1280,1280,1280,1280,1280, -1280,1280,1280,1280,1280,1280,1280,1280,163,1281,1280,1280,1280,1280,1280,1280, -1280,1281,1280,1280,1281,1280,1280,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381, +1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381, +1381,1382,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1383,1383,1383,1383,1383,1383,1383,1383,1383,1383,196,196,196,196,196,196, /* block 195 */ -1282,1282,1282,1282,1282,1282,1282,163,1282,1282,163,1282,1282,1282,1282,1282, -1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282, -1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282, -1282,1283,1283,1283,1283,1283,1283,163,163,163,1283,163,1283,1283,163,1283, -1283,1283,1284,1283,1285,1285,1286,1283,163,163,163,163,163,163,163,163, -1287,1287,1287,1287,1287,1287,1287,1287,1287,1287,163,163,163,163,163,163, -1288,1288,1288,1288,1288,1288,163,1288,1288,163,1288,1288,1288,1288,1288,1288, -1288,1288,1288,1288,1288,1288,1288,1288,1288,1288,1288,1288,1288,1288,1288,1288, +1384,1384,1384,1384,1384,1384,1384,1384,1384,196,1384,1384,1384,1384,1384,1384, +1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384, +1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1385, +1386,1386,1386,1386,1386,1386,1386,196,1386,1386,1386,1386,1386,1386,1385,1387, +1384,1388,1388,1389,1390,1390,196,196,196,196,196,196,196,196,196,196, +1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1392,1392,1392,1392,1392,1392, +1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,196,196,196, +1393,1394,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395, /* block 196 */ -1288,1288,1288,1288,1288,1288,1288,1288,1288,1288,1289,1289,1289,1289,1289,163, -1290,1290,163,1289,1289,1290,1289,1291,1288,163,163,163,163,163,163,163, -1292,1292,1292,1292,1292,1292,1292,1292,1292,1292,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395, +196,196,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396, +1396,1396,1396,1396,1396,1396,1396,1396,196,1397,1396,1396,1396,1396,1396,1396, +1396,1397,1396,1396,1397,1396,1396,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 197 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293,1293, -1293,1293,1293,1294,1294,1295,1295,1296,1296,163,163,163,163,163,163,163, +1398,1398,1398,1398,1398,1398,1398,196,1398,1398,196,1398,1398,1398,1398,1398, +1398,1398,1398,1398,1398,1398,1398,1398,1398,1398,1398,1398,1398,1398,1398,1398, +1398,1398,1398,1398,1398,1398,1398,1398,1398,1398,1398,1398,1398,1398,1398,1398, +1398,1399,1399,1399,1399,1399,1399,196,196,196,1399,196,1399,1399,196,1399, +1399,1399,1400,1399,1401,1401,1402,1399,196,196,196,196,196,196,196,196, +1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,196,196,196,196,196,196, +1404,1404,1404,1404,1404,1404,196,1404,1404,196,1404,1404,1404,1404,1404,1404, +1404,1404,1404,1404,1404,1404,1404,1404,1404,1404,1404,1404,1404,1404,1404,1404, /* block 198 */ -1297,1297,1298,1299,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300, -1300,163,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300, -1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300, -1300,1300,1300,1300,1299,1299,1297,1297,1297,1297,1297,163,163,163,1299,1299, -1297,1301,1302,1303,1303,1304,1304,1304,1304,1304,1304,1304,1304,1304,1304,1304, -1305,1305,1305,1305,1305,1305,1305,1305,1305,1305,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1404,1404,1404,1404,1404,1404,1404,1404,1404,1404,1405,1405,1405,1405,1405,196, +1406,1406,196,1405,1405,1406,1405,1407,1404,196,196,196,196,196,196,196, +1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,196,196,196,196,196,196, +1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, +1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, +1409,1409,1409,1409,1409,1409,1409,1409,1409,1410,1409,1409,196,196,196,196, +1411,1411,1411,1411,1411,1411,1411,1411,1411,1411,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 199 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -843,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1306,1306,1306,1306,1306,1306,1306,1306,1306,1306,1306,1306,1306,1306,1306,1306, -388,388,1306,388,1306,390,390,390,390,390,390,390,390,391,391,391, -391,390,390,390,390,390,390,390,390,390,390,390,390,390,390,390, -390,390,163,163,163,163,163,163,163,163,163,163,163,163,163,1307, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1412,1412,1412,1412,1412,1412,1412,1412,1412,1412,1412,1412,1412,1412,1412,1412, +1412,1412,1412,1413,1413,1414,1414,1415,1415,196,196,196,196,196,196,196, /* block 200 */ -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, +1416,1416,1417,1418,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419, +1419,196,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419, +1419,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419,1419, +1419,1419,1419,1419,1418,1418,1416,1416,1416,1416,1416,196,196,196,1418,1418, +1416,1420,1421,1422,1422,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423, +1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1425,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 201 */ -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +918,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426, +433,433,1426,433,1426,435,435,435,435,435,435,435,435,436,436,436, +436,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435, +435,435,196,196,196,196,196,196,196,196,196,196,196,196,196,1427, /* block 202 */ -1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309, -1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309, -1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309, -1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309, -1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309, -1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309, -1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,1309,163, -1310,1310,1310,1310,1310,163,163,163,163,163,163,163,163,163,163,163, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, /* block 203 */ -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, -1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308, -1308,1308,1308,1308,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 204 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311, -1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311, -1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311, -1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311, -1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311, -1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311,1311, -1311,1312,1312,163,163,163,163,163,163,163,163,163,163,163,163,163, +1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429, +1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429, +1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429, +1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429, +1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429, +1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429, +1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,196, +1430,1430,1430,1430,1430,196,196,196,196,196,196,196,196,196,196,196, /* block 205 */ -1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313, -1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313, -1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313, -1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313, -1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313, -1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313, -1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313, -1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, +1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428, +1428,1428,1428,1428,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 206 */ -1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313, -1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313, -1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313, -1314,1314,1314,1314,1314,1314,1314,1314,1314,1314,1314,1314,1314,1314,1314,1314, -1315,1313,1313,1313,1313,1313,1313,1316,1316,1316,1316,1316,1316,1316,1316,1316, -1316,1316,1316,1316,1316,1316,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431, +1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431, +1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431, +1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431, +1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431, +1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431, +1431,1432,1432,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 207 */ -1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317, -1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317, -1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317, -1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317, -1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317, -1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317, -1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317, -1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, /* block 208 */ -1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317, -1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317, -1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317, -1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317,1317, -1317,1317,1317,1317,1317,1317,1317,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1434,1434,1434,1434,1434,1434,1434,1434,1434,1434,1434,1434,1434,1434,1434,1434, +1435,1433,1433,1433,1433,1433,1433,1436,1436,1436,1436,1436,1436,1436,1436,1436, +1436,1436,1436,1436,1436,1436,196,196,196,196,196,196,196,196,196,196, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, /* block 209 */ -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433, +1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,196,196,196,196,196, /* block 210 */ -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859, -859,859,859,859,859,859,859,859,859,163,163,163,163,163,163,163, -1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318, -1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,163, -1319,1319,1319,1319,1319,1319,1319,1319,1319,1319,163,163,163,163,1320,1320, -1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321, +1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437, +1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437, +1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437, +1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437, +1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437, +1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437, +1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437, +1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437, /* block 211 */ -1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321, -1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321, -1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321, -1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,163, -1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,163,163,163,163,163,163, -1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323, -1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,163,163, -1324,1324,1324,1324,1324,1325,163,163,163,163,163,163,163,163,163,163, +1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437, +1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437, +1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437, +1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437,1437, +1437,1437,1437,1437,1437,1437,1437,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 212 */ -1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326, -1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326, -1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326, -1327,1327,1327,1327,1327,1327,1327,1328,1328,1329,1330,1330,1331,1331,1331,1331, -1332,1332,1333,1333,1328,1331,163,163,163,163,163,163,163,163,163,163, -1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,163,1335,1335,1335,1335,1335, -1335,1335,163,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326, -1326,1326,1326,1326,1326,1326,1326,1326,163,163,163,163,163,1326,1326,1326, +1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438, +1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1439,1439, +1439,1439,1439,1439,1439,1439,1439,1439,1439,1439,1440,1440,1440,1439,1439,1441, +1442,1442,1442,1442,1442,1442,1442,1442,1442,1442,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 213 */ -1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, /* block 214 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1336,1336,1336,1336,1336,1336,1336,1336,1336,1336,1336,1336,1336,1336,1336,1336, -1336,1336,1336,1336,1336,1336,1336,1336,1336,1336,1336,1336,1336,1336,1336,1336, -1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337, -1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934, +934,934,934,934,934,934,934,934,934,196,196,196,196,196,196,196, +1443,1443,1443,1443,1443,1443,1443,1443,1443,1443,1443,1443,1443,1443,1443,1443, +1443,1443,1443,1443,1443,1443,1443,1443,1443,1443,1443,1443,1443,1443,1443,196, +1444,1444,1444,1444,1444,1444,1444,1444,1444,1444,196,196,196,196,1445,1445, +1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446, /* block 215 */ -1338,1338,1338,1338,1338,1338,1338,1338,1338,1338,1338,1338,1338,1338,1338,1338, -1338,1338,1338,1338,1338,1338,1338,1339,1340,1341,1341,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446, +1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446, +1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446, +1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,1446,196, +1447,1447,1447,1447,1447,1447,1447,1447,1447,1447,196,196,196,196,196,196, +1448,1448,1448,1448,1448,1448,1448,1448,1448,1448,1448,1448,1448,1448,1448,1448, +1448,1448,1448,1448,1448,1448,1448,1448,1448,1448,1448,1448,1448,1448,196,196, +1449,1449,1449,1449,1449,1450,196,196,196,196,196,196,196,196,196,196, /* block 216 */ -1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342, -1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342, -1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342, -1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342, -1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,163,163,163,163,1343, -1342,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344, -1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344, -1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344,1344, +1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451, +1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451, +1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451, +1452,1452,1452,1452,1452,1452,1452,1453,1453,1454,1455,1455,1456,1456,1456,1456, +1457,1457,1458,1458,1453,1456,196,196,196,196,196,196,196,196,196,196, +1459,1459,1459,1459,1459,1459,1459,1459,1459,1459,196,1460,1460,1460,1460,1460, +1460,1460,196,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451, +1451,1451,1451,1451,1451,1451,1451,1451,196,196,196,196,196,1451,1451,1451, /* block 217 */ -1344,1344,1344,1344,1344,1344,1344,1344,163,163,163,163,163,163,163,1345, -1345,1345,1345,1346,1346,1346,1346,1346,1346,1346,1346,1346,1346,1346,1346,1346, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1347,1348,1349,800,1350,163,163,163,163,163,163,163,163,163,163,163, -1351,1351,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451,1451, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 218 */ -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1461,1461,1461,1462,1462,1462,1462,1462,1462,1462,1462,1462,1462,1462,1462,1462, +1462,1462,1462,1462,1462,1462,1462,1462,1462,1462,1462,1462,1462,1462,1462,1462, +1462,1462,1462,1463,1462,1462,1462,1463,1463,1463,1463,1464,1464,1465,1466,1466, +1467,1467,1467,1467,1467,1467,1467,1467,1467,1467,196,196,196,196,196,196, /* block 219 */ -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352, -1352,1352,1352,1352,1352,1352,1352,1352,163,163,163,163,163,163,163,163, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1468,1468,1468,1468,1468,1468,1468,1468,1468,1468,1468,1468,1468,1468,1468,1468, +1468,1468,1468,1468,1468,1468,1468,1468,1468,1468,1468,1468,1468,1468,1468,1468, +1469,1469,1469,1469,1469,1469,1469,1469,1469,1469,1469,1469,1469,1469,1469,1469, +1469,1469,1469,1469,1469,1469,1469,1469,1469,1469,1469,1469,1469,1469,1469,1469, /* block 220 */ -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, +1470,1470,1470,1470,1470,1470,1470,1470,1470,1470,1470,1470,1470,1470,1470,1470, +1470,1470,1470,1470,1470,1470,1470,1471,1472,1473,1473,196,196,196,196,196, +1474,1474,1474,1474,1474,1474,1474,1474,1474,1474,1474,1474,1474,1474,1474,1474, +1474,1474,1474,1474,1474,1474,1474,1474,1474,196,196,1475,1475,1475,1475,1475, +1475,1475,1475,1475,1475,1475,1475,1475,1475,1475,1475,1475,1475,1475,1475,1475, +1475,1475,1475,1475,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 221 */ -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, -1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353, -1353,1353,1353,1353,1353,1353,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476, +1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476, +1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476, +1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476, +1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,196,196,196,196,1477, +1476,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478, +1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478, +1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478, /* block 222 */ -1352,1352,1352,1352,1352,1352,1352,1352,1352,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1478,1478,1478,1478,1478,1478,1478,1478,196,196,196,196,196,196,196,1479, +1479,1479,1479,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1481,1482,1483,871,1484,196,196,196,196,196,196,196,196,196,196,196, +1485,1485,1486,1486,873,873,873,196,196,196,196,196,196,196,196,196, /* block 223 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1354,1354,1354,1354,163,1354,1354,1354,1354,1354,1354,1354,163,1354,1354,163, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, /* block 224 */ -825,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, /* block 225 */ -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, +1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488,1488, +1488,1488,1488,1488,1488,1488,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,1488, /* block 226 */ -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -825,825,825,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,820,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -820,820,820,163,163,825,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,825,825,825,825,163,163,163,163,163,163,163,163, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 227 */ -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487, +1487,1487,1487,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 228 */ -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355, -1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,163,163,163,163, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1489,1489,1489,1489,196,1489,1489,1489,1489,1489,1489,1489,196,1489,1489,196, /* block 229 */ -1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356, -1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356, -1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356, -1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356, -1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356, -1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356, -1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,163,163,163,163,163, -1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,163,163,163, +900,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, /* block 230 */ -1356,1356,1356,1356,1356,1356,1356,1356,1356,163,163,163,163,163,163,163, -1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,163,163,1357,1358,1359,1360, -1361,1361,1361,1361,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, /* block 231 */ -154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154, -154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154, -154,154,154,154,154,154,154,154,154,154,154,154,154,154,163,163, -154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154, -154,154,154,154,154,154,154,163,163,163,163,163,163,163,163,163, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895, +900,900,900,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,895,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +895,895,895,196,196,900,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,900,900,900,900,196,196,196,196,196,196,196,196, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, /* block 232 */ -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, /* block 233 */ -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490, +1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,1490,196,196,196,196, /* block 234 */ -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,163,163,163,163,163,163,163,163,163,163, +1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491, +1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491, +1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491, +1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491, +1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491, +1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491, +1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,196,196,196,196,196, +1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,196,196,196, /* block 235 */ -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,163,163,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,1362,1363,154,154,154,461,461,461,1364,1365,1365, -1365,1365,1365, 51, 51, 51, 51, 51, 51, 51, 51,154,154,154,154,154, +1491,1491,1491,1491,1491,1491,1491,1491,1491,196,196,196,196,196,196,196, +1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,196,196,1492,1493,1494,1495, +1496,1496,1496,1496,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 236 */ -154,154,154,461,461,154,154,154,154,154,154,154,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,154,154,154,154,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,724,724,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, /* block 237 */ -1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001, -1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001, -1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001, -1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001, -1001,1001,1366,1366,1366,1001,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +1497,1497,1497,1497,1497,1497,1497,1497,1497,1497,789,789,789,196,196,196, /* block 238 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -836,836,836,836,836,836,836,836,836,836,836,836,836,836,836,836, -836,836,836,836,163,163,163,163,163,163,163,163,163,163,163,163, -836,836,836,836,836,836,836,836,836,836,836,836,836,836,836,836, -836,836,836,836,163,163,163,163,163,163,163,163,163,163,163,163, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,196,196,196,196,196,196,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +802,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 239 */ -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,163,163,163,163,163,163,163,163,163, -833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833, -833,833,836,836,836,836,836,836,836,163,163,163,163,163,163,163, +176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, +176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, +176,176,176,176,176,176,176,176,176,176,176,176,176,176,196,196, +176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, +176,176,176,176,176,176,176,196,196,196,196,196,196,196,196,196, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, /* block 240 */ -725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,726,726,726,726,726,726, -726,726,737,737,726,726,726,726,726,726,726,726,726,726,726,726, -726,726,726,726,725,725,725,725,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,726,726, -726,726,726,726,726,163,737,737,726,726,726,726,726,726,726,726, -726,726,726,726,726,726,726,726,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 241 */ -725,725,726,726,726,726,726,726,726,726,737,737,726,726,726,726, -726,726,726,726,726,726,726,726,726,726,726,726,725,163,725,725, -163,163,725,163,163,725,725,163,163,725,725,725,725,163,725,725, -725,725,725,725,725,725,726,726,726,726,163,726,163,726,737,737, -726,726,726,726,163,726,726,726,726,726,726,726,726,726,726,726, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,726,726,726,726,726,726, -726,726,737,737,726,726,726,726,726,726,726,726,726,726,726,726, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, /* block 242 */ -726,726,726,726,725,725,163,725,725,725,725,163,163,725,725,725, -725,725,725,725,725,163,725,725,725,725,725,725,725,163,726,726, -726,726,726,726,726,726,737,737,726,726,726,726,726,726,726,726, -726,726,726,726,726,726,726,726,725,725,163,725,725,725,725,163, -725,725,725,725,725,163,725,163,163,163,725,725,725,725,725,725, -725,163,726,726,726,726,726,726,726,726,737,737,726,726,726,726, -726,726,726,726,726,726,726,726,726,726,726,726,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,196,196,196,196,196,196,196,196,196,196, /* block 243 */ -725,725,725,725,725,725,726,726,726,726,726,726,726,726,737,737, -726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,726,726,726,726,726,726, -726,726,737,737,726,726,726,726,726,726,726,726,726,726,726,726, -726,726,726,726,725,725,725,725,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,726,726, -726,726,726,726,726,726,737,737,726,726,726,726,726,726,726,726, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,196,196,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,1498,1498,176,176,176,508,508,508,1499,1499,1499, +1499,1499,1499, 51, 51, 51, 51, 51, 51, 51, 51,176,176,176,176,176, /* block 244 */ -726,726,726,726,726,726,726,726,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725, -725,725,726,726,726,726,726,726,726,726,737,737,726,726,726,726, -726,726,726,726,726,726,726,726,726,726,726,726,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,726,726,726,726,726,726,726,726,737,737, -726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725, +176,176,176,508,508,176,176,176,176,176,176,176,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,176,176,176,176,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,789,789,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 245 */ -725,725,725,725,725,725,725,725,725,725,726,726,726,726,726,726, -726,726,737,737,726,726,726,726,726,726,726,726,726,726,726,726, -726,726,726,726,726,726,163,163,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725, -725,1367,726,726,726,726,726,726,726,726,726,726,726,726,726,726, -726,726,726,726,726,726,726,726,726,726,726,716,726,726,726,726, -726,726,725,725,725,725,725,725,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,725,1367,726,726,726,726, +1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084, +1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084, +1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084, +1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084, +1084,1084,1500,1500,1500,1084,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 246 */ -726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726, -726,726,726,726,726,716,726,726,726,726,726,726,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725, -725,725,725,725,725,1367,726,726,726,726,726,726,726,726,726,726, -726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,716, -726,726,726,726,726,726,725,725,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,1367, -726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +911,911,911,911,911,911,911,911,911,911,911,911,911,911,911,911, +911,911,911,911,196,196,196,196,196,196,196,196,196,196,196,196, +911,911,911,911,911,911,911,911,911,911,911,911,911,911,911,911, +911,911,911,911,196,196,196,196,196,196,196,196,196,196,196,196, /* block 247 */ -726,726,726,726,726,726,726,726,726,716,726,726,726,726,726,726, -725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,725,1367,726,726,726,726,726,726, -726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726, -726,726,726,716,726,726,726,726,726,726,725,726,163,163,1368,1368, -1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368, -1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368, -1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368,1368, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,196,196,196,196,196,196,196,196,196, +908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908, +908,908,911,911,911,911,911,911,911,196,196,196,196,196,196,196, /* block 248 */ -1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369, -1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369, -1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369, -1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369, -1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369, -1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369, -1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369, -1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,791,791,791,791,791,791, +791,791,803,803,791,791,791,791,791,791,791,791,791,791,791,791, +791,791,791,791,790,790,790,790,790,790,790,790,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,791,791, +791,791,791,791,791,196,803,803,791,791,791,791,791,791,791,791, +791,791,791,791,791,791,791,791,790,790,790,790,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, /* block 249 */ -1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370, -1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370, -1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370, -1370,1370,1370,1370,1370,1370,1370,1369,1369,1369,1369,1370,1370,1370,1370,1370, -1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370, -1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370, -1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1369,1369,1369, -1369,1369,1369,1369,1369,1370,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369, +790,790,791,791,791,791,791,791,791,791,803,803,791,791,791,791, +791,791,791,791,791,791,791,791,791,791,791,791,790,196,790,790, +196,196,790,196,196,790,790,196,196,790,790,790,790,196,790,790, +790,790,790,790,790,790,791,791,791,791,196,791,196,791,803,803, +791,791,791,791,196,791,791,791,791,791,791,791,791,791,791,791, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,791,791,791,791,791,791, +791,791,803,803,791,791,791,791,791,791,791,791,791,791,791,791, /* block 250 */ -1369,1369,1369,1369,1370,1369,1369,1371,1372,1371,1371,1373,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,1370,1370,1370,1370,1370, -163,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370,1370, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +791,791,791,791,790,790,196,790,790,790,790,196,196,790,790,790, +790,790,790,790,790,196,790,790,790,790,790,790,790,196,791,791, +791,791,791,791,791,791,803,803,791,791,791,791,791,791,791,791, +791,791,791,791,791,791,791,791,790,790,196,790,790,790,790,196, +790,790,790,790,790,196,790,196,196,196,790,790,790,790,790,790, +790,196,791,791,791,791,791,791,791,791,803,803,791,791,791,791, +791,791,791,791,791,791,791,791,791,791,791,791,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, /* block 251 */ - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 92, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,644, 70, 70, 70, 70,163, -163,163,163,163,163, 70, 70, 70, 70, 70, 70,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +790,790,790,790,790,790,791,791,791,791,791,791,791,791,803,803, +791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,791,791,791,791,791,791, +791,791,803,803,791,791,791,791,791,791,791,791,791,791,791,791, +791,791,791,791,790,790,790,790,790,790,790,790,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,791,791, +791,791,791,791,791,791,803,803,791,791,791,791,791,791,791,791, /* block 252 */ -1374,1374,1374,1374,1374,1374,1374,163,1374,1374,1374,1374,1374,1374,1374,1374, -1374,1374,1374,1374,1374,1374,1374,1374,1374,163,163,1374,1374,1374,1374,1374, -1374,1374,163,1374,1374,163,1374,1374,1374,1374,1374,163,163,163,163,163, -858,858,858,858,858,858,858,858,858,858,858,858,858,858,858,858, -858,858,858,858,858,858,858,858,858,858,858,858,1375,1375,858,858, -858,858,858,858,858,858,858,858,858,858,858,858,858,858,858,858, -858,858,858,858,858,858,858,858,1375,858,858,858,858,858,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +791,791,791,791,791,791,791,791,790,790,790,790,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, +790,790,791,791,791,791,791,791,791,791,803,803,791,791,791,791, +791,791,791,791,791,791,791,791,791,791,791,791,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, +790,790,790,790,790,790,791,791,791,791,791,791,791,791,803,803, +791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, /* block 253 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,788, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +790,790,790,790,790,790,790,790,790,790,791,791,791,791,791,791, +791,791,803,803,791,791,791,791,791,791,791,791,791,791,791,791, +791,791,791,791,791,791,196,196,790,790,790,790,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, +790,1501,791,791,791,791,791,791,791,791,791,791,791,791,791,791, +791,791,791,791,791,791,791,791,791,791,791,1501,791,791,791,791, +791,791,790,790,790,790,790,790,790,790,790,790,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,790,1501,791,791,791,791, /* block 254 */ -1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376, -1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376, -1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,163,163,163, -1377,1377,1377,1377,1377,1377,1377,1378,1378,1378,1378,1378,1379,1379,163,163, -1380,1380,1380,1380,1380,1380,1380,1380,1380,1380,163,163,163,163,1376,1381, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791, +791,791,791,791,791,1501,791,791,791,791,791,791,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, +790,790,790,790,790,1501,791,791,791,791,791,791,791,791,791,791, +791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,1501, +791,791,791,791,791,791,790,790,790,790,790,790,790,790,790,790, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,1501, +791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791, /* block 255 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1382,1382,1382,1382,1382,1382,1382,1382,1382,1382,1382,1382,1382,1382,1382,1382, -1382,1382,1382,1382,1382,1382,1382,1382,1382,1382,1382,1382,1382,1382,1383,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384, -1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384, -1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1384,1385,1385,1385,1385, -1386,1386,1386,1386,1386,1386,1386,1386,1386,1386,163,163,163,163,163,1387, +791,791,791,791,791,791,791,791,791,1501,791,791,791,791,791,791, +790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, +790,790,790,790,790,790,790,790,790,1501,791,791,791,791,791,791, +791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791, +791,791,791,1501,791,791,791,791,791,791,790,791,196,196,1502,1502, +1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502, +1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502, +1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502, /* block 256 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388, -1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1389,1390,1390,1390,1390, -1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,163,163,163,163,163,163, +1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503, +1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503, +1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503, +1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503, +1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503, +1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503, +1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503, +1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503, /* block 257 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -484,484,484,484,484,484,484,163,484,484,484,484,163,484,484,163, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,163, +1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504, +1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504, +1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504, +1504,1504,1504,1504,1504,1504,1504,1503,1503,1503,1503,1504,1504,1504,1504,1504, +1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504, +1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504, +1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1503,1503,1503, +1503,1503,1503,1503,1503,1504,1503,1503,1503,1503,1503,1503,1503,1503,1503,1503, /* block 258 */ -1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392, -1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392, -1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392, -1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392, -1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392, -1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392, -1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392, -1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392, +1503,1503,1503,1503,1504,1503,1503,1505,1506,1505,1505,1507,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,1504,1504,1504,1504,1504, +196,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504,1504, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 259 */ -1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392, -1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392, -1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392, -1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392,1392, -1392,1392,1392,1392,1392,262,262,1393,1393,1393,1393,1393,1393,1393,1393,1393, -1394,1394,1394,1394,1394,1394,1394,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 93, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,702, 70, 70, 70, 70,196, +196,196,196,196,196, 70, 70, 70, 70, 70, 70,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 260 */ -1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395, -1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395, -1395,1395,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396, -1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396,1396, -1396,1396,1396,1396,1397,1397,1397,1398,1399,1399,1399,1400,262,262,262,262, -1401,1401,1401,1401,1401,1401,1401,1401,1401,1401,262,262,262,262,1402,1402, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, +1508,1508,1508,1508,1508,1508,1508,196,1508,1508,1508,1508,1508,1508,1508,1508, +1508,1508,1508,1508,1508,1508,1508,1508,1508,196,196,1508,1508,1508,1508,1508, +1508,1508,196,1508,1508,196,1508,1508,1508,1508,1508,196,196,196,196,196, +933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,933, +933,933,933,933,933,933,933,933,933,933,933,933,1509,1509,933,933, +933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,933, +933,933,933,933,933,933,933,933,1509,933,933,933,933,933,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 261 */ -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -302,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,853, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 262 */ -1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403, -1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403, -1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1404,1403,1403,1403, -1405,1403,1403,1403,1403,302,302,302,302,302,302,302,302,302,302,302, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, +1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510, +1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510, +1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,196,196,196, +1511,1511,1511,1511,1511,1511,1511,1512,1512,1512,1512,1512,1513,1513,196,196, +1514,1514,1514,1514,1514,1514,1514,1514,1514,1514,196,196,196,196,1510,1515, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 263 */ -302,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403, -1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403, -1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1404,1403, -1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,302,302, -302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,302, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, -262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1516,1516,1516,1516,1516,1516,1516,1516,1516,1516,1516,1516,1516,1516,1516,1516, +1516,1516,1516,1516,1516,1516,1516,1516,1516,1516,1516,1516,1516,1516,1517,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518, +1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518, +1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1518,1519,1519,1519,1519, +1520,1520,1520,1520,1520,1520,1520,1520,1520,1520,196,196,196,196,196,1521, /* block 264 */ -1406,1406,1406,1406,302,1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,1406, -1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,1406, -302,1406,1406,302,1406,302,302,1406,302,1406,1406,1406,1406,1406,1406,1406, -1406,1406,1406,302,1406,1406,1406,1406,302,1406,302,1406,302,302,302,302, -302,302,1406,302,302,302,302,1406,302,1406,302,1406,302,1406,1406,1406, -302,1406,1406,302,1406,302,302,1406,302,1406,302,1406,302,1406,302,1406, -302,1406,1406,302,1406,302,302,1406,1406,1406,1406,302,1406,1406,1406,1406, -1406,1406,1406,302,1406,1406,1406,1406,302,1406,1406,1406,1406,302,1406,302, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1522,1522,1522,1522,1522,1522,1522,1522,1522,1522,1522,1522,1522,1522,1522,1522, +1522,1522,1522,1522,1522,1522,1522,1522,1522,1522,1522,1523,1524,1524,1524,1524, +1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,196,196,196,196,196,196, /* block 265 */ -1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,302,1406,1406,1406,1406,1406, -1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,302,302,302,302, -302,1406,1406,1406,302,1406,1406,1406,1406,1406,302,1406,1406,1406,1406,1406, -1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,1406,302,302,302,302, -302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,302, -302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,302, -302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,302, -274,274,302,302,302,302,302,302,302,302,302,302,302,302,302,302, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1526,1526,1526,1526,1526,1526,1526,1526,1526,1526,1526,1526,1526,1526,1526,1526, +1526,1526,1526,1526,1526,1526,1526,1526,1526,1526,1526,1526,1526,1526,1527,1528, +1526,1529,1529,1529,1529,1529,1529,1529,1529,1529,1529,196,196,196,196,1530, /* block 266 */ -1407,1407,1407,1407,1408,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1409,1409,1409,1409, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,1531, +1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,196, +1531,1531,1531,1532,1531,1531,1532,1531,1531,1531,1531,1531,1531,1531,1532,1532, +1531,1531,1531,1531,1531,1532,196,196,196,196,196,196,196,196,1531,1533, /* block 267 */ -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1409, -1409,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1409,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1408, -1409,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1407,1407,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +531,531,531,531,531,531,531,196,531,531,531,531,196,531,531,196, +531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,196, /* block 268 */ - 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 58, 58,1407,1407,1407, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,1407, -1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410, -1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,461,461,461,461,461,461, -1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410, -1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,724,724,1407,1407,1407,1407, -1411,1411,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1411,1411, +1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534, +1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534, +1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534, +1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534, +1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534, +1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534, +1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534, +1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534, /* block 269 */ -1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,461,461,461,461,1412,461, -461,1412,1412,1412,1412,1412,1412,1412,1412,1412,1412,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,1407,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1413,1413,1413,1413,1413,1413,1413,1413,1413,1413, -1413,1413,1413,1413,1413,1413,1413,1413,1413,1413,1413,1413,1413,1413,1413,1413, +1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534, +1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534, +1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534, +1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534, +1534,1534,1534,1534,1534,297,297,1535,1535,1535,1535,1535,1535,1535,1535,1535, +1536,1536,1536,1536,1536,1536,1536,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, /* block 270 */ -1414,1412,1415,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -461,461,461,461,461,461,461,461,461,461,1412,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,1412, -461,461,1412,1412,1412,1412,1412,1415,1412,1412,1412,461,1409,1409,1409,1409, -461,461,461,461,461,461,461,461,461,1409,1409,1409,1409,1409,1409,1409, -1416,1416,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1407,1407,1407,1407,1407,1407,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, +1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537, +1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537, +1537,1537,1538,1538,1538,1538,1538,1538,1538,1538,1538,1538,1538,1538,1538,1538, +1538,1538,1538,1538,1538,1538,1538,1538,1538,1538,1538,1538,1538,1538,1538,1538, +1538,1538,1538,1538,1539,1539,1539,1540,1541,1541,1541,1542,297,297,297,297, +1543,1543,1543,1543,1543,1543,1543,1543,1543,1543,297,297,297,297,1544,1544, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, /* block 271 */ -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, /* block 272 */ -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,728,1407,1407,728,728,728,728,728,728,728,728,728,1408,1408,1408, -1408,1408,1408,1408,1408,1408,728,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,728,1408,1408, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +338,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545, /* block 273 */ -1408,1408,1408,1408,1408,1417,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1407,1407,728,728,1407,728,728,728,1407,1407,728,728, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1417,1417,1417,1408,1408,1417,1408,1408,1417,1418,1418,728,728,1408, -1408,1408,1408,1408,728,728,728,728,728,728,728,728,728,728,728,728, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1407,1407,728,1408,728,1407,728,1408,1408,1408,1419,1419,1419,1419,1419, +1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545, +1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545, +1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1546,1545,1545,1545, +1547,1545,1545,1545,1545,338,338,338,338,338,338,338,338,338,338,338, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, /* block 274 */ -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,728, -1408,728,1417,1417,1408,1408,1417,1417,1417,1417,1417,1417,1417,1417,1417,1417, -1417,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1417,1417,1417,1417,1417,1417,1417,1417,1417,1417, -1417,1417,1417,1417,1417,1417,1417,1417,1417,1408,1408,1408,1417,1408,1408,1408, +338,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545, +1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545, +1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1546,1545, +1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,338,338, +338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, +297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, /* block 275 */ -1408,1417,1417,1417,1408,1417,1417,1417,1408,1408,1408,1408,1408,1408,1408,1417, -1408,1417,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1417,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,728,1407,1408, +1548,1548,1548,1548,338,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548, +1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548, +338,1548,1548,338,1548,338,338,1548,338,1548,1548,1548,1548,1548,1548,1548, +1548,1548,1548,338,1548,1548,1548,1548,338,1548,338,1548,338,338,338,338, +338,338,1548,338,338,338,338,1548,338,1548,338,1548,338,1548,1548,1548, +338,1548,1548,338,1548,338,338,1548,338,1548,338,1548,338,1548,338,1548, +338,1548,1548,338,1548,338,338,1548,1548,1548,1548,338,1548,1548,1548,1548, +1548,1548,1548,338,1548,1548,1548,1548,338,1548,1548,1548,1548,338,1548,338, /* block 276 */ -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,724,724, -724,724,724,724,724,724,1407,1407,1407,728,728,1408,1408,1408,1408,1407, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1407,1407,1407,1407,1407,1407,1407,728, -728,1407,1407,728,1418,1418,728,728,728,728,1417,1407,1407,1407,1407,1407, +1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,338,1548,1548,1548,1548,1548, +1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,338,338,338,338, +338,1548,1548,1548,338,1548,1548,1548,1548,1548,338,1548,1548,1548,1548,1548, +1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,338,338,338,338, +338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, +338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, +338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, +307,307,338,338,338,338,338,338,338,338,338,338,338,338,338,338, /* block 277 */ -1407,1407,1407,1407,1407,1407,1407,728,1407,1407,728,728,728,728,1407,1407, -1418,1407,1407,1407,1407,1417,1417,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1408,728,1407,1407,728,1407,1407,1407,1407,1407,1407,1407, -1407,728,728,1407,1407,1407,1407,1407,1407,1407,1407,1407,728,1407,1407,1407, -1407,1407,728,728,728,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,728,728,728,1407,1407,1407,1407,1407,1407,1407,1407,728,728,728,1407, -1407,728,1407,728,1407,1407,1407,1407,728,1407,1407,1407,1407,1407,1407,728, -1407,1407,1407,728,1407,1407,1407,1407,1407,1407,728,1408,1408,1408,1408,1408, +789,789,789,789,1549,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,1550,1550,1550,1550, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, /* block 278 */ -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1417,1417,1417,1408,1408,1408,1417,1417,1417,1417,1417, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,1550, +1550,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +1550,789,789,789,789,789,789,789,789,789,789,789,789,789,789,1549, +1550,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, /* block 279 */ -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1417,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1417,1417,1417,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1417,1408,1408,1408,1408,1408,1407,1407,1407,1407,1407,728,1417,728,728,728, -1408,1408,1408,1407,1407,1408,1408,1408,1409,1409,1409,1409,1408,1408,1408,1408, -728,728,728,728,728,728,1407,1407,1407,728,1407,1408,1408,1409,1409,1409, -728,1407,1407,728,1408,1408,1408,1408,1408,1408,1408,1408,1408,1409,1409,1409, +821,821,821,821,821,821,821,821,821,821,821, 58, 58,789,789,789, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,789, +1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551, +1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,508,508,508,508,508,508, +1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551, +1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,789,789,789,789,789,789, +1552,1552,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,1552,1552, /* block 280 */ -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,1407,1407,1407,1409,1409,1409,1409,1407,1407,1407,1407,1407, +1551,1551,1551,1551,1551,1551,1551,1551,1551,1551,508,508,508,508,1553,508, +508,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,789,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1554,1554,1554,1554,1554,1554,1554,1554,1554,1554, +1554,1554,1554,1554,1554,1554,1554,1554,1554,1554,1554,1554,1554,1554,1554,1554, /* block 281 */ -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,1407,1407,1407,1407,1407,1409,1409,1409,1409,1409,1409, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1409,1409,1409,1409, -1408,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, +1555,1553,1556,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +508,508,508,508,508,508,508,508,508,508,1553,508,508,508,508,508, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,1553, +508,508,1553,1553,1553,1553,1553,1556,1553,1553,1553,508,1550,1550,1550,1550, +508,508,508,508,508,508,508,508,508,1550,1550,1550,1550,1550,1550,1550, +1557,1557,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +789,789,789,789,789,789,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, /* block 282 */ -724,724,724,724,724,724,724,724,724,724,724,724,1409,1409,1409,1409, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,1409,1409,1409,1409,1409,1409,1409,1409, -724,724,724,724,724,724,724,724,724,724,1409,1409,1409,1409,1409,1409, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, /* block 283 */ -724,724,724,724,724,724,724,724,1409,1409,1409,1409,1409,1409,1409,1409, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,1409,1409, -1407,1407,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,793,789,789,793,793,793,793,793,793,793,793,793,1549,1549,1549, +1549,1549,1549,1549,1549,1549,793,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,793,1549,1549, /* block 284 */ -724,724,724,724,724,724,724,724,724,724,724,724,1417,1408,1408,1417, -1408,1408,1408,1408,1408,1408,1408,1408,1417,1417,1417,1417,1417,1417,1417,1417, -1408,1408,1408,1408,1408,1408,1417,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1417,1417,1417,1417,1417,1417,1417,1417,1417,1417,1408,724,1417,1417,1417,1408, -1408,1408,1408,1408,1408,1408,724,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1417,1408,1408,1408,1408,1408,1408,1408,1408, +1549,1549,1549,1549,1549,1558,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,789,789,793,793,789,793,793,793,789,789,793,793, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1558,1558,1558,1549,1549,1558,1549,1549,1558,1559,1559,793,793,1549, +1549,1549,1549,1549,793,793,793,793,793,793,793,793,793,793,793,793, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,789,789,793,1549,793,789,793,1549,1549,1549,1560,1560,1560,1560,1560, /* block 285 */ -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1420,1420,1420,1420,1408,1417,1417,1408,1417,1417,1408,1417,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1417,1417,1417, -1408,1417,1417,1417,1417,1417,1417,1417,1417,1417,1417,1417,1417,1417,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,793, +1549,793,1558,1558,1549,1549,1558,1558,1558,1558,1558,1558,1558,1558,1558,1558, +1558,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1558,1558,1558,1558,1558,1558,1558,1558,1558,1558, +1558,1558,1558,1558,1558,1558,1558,1558,1558,1549,1549,1549,1558,1549,1549,1549, /* block 286 */ -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407, -1407,1407,1407,1407,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1409,1409, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1409,1409,1409, +1549,1558,1558,1558,1549,1558,1558,1558,1549,1549,1549,1549,1549,1549,1549,1558, +1549,1558,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1558,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,793,789,1549, /* block 287 */ -1408,1408,1408,1408,1408,1408,1408,1408,1408,1409,1409,1409,1409,1409,1409,1409, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1409,1408, -1408,1408,1408,1417,1417,1417,1409,1409,1409,1409,1409,1409,1409,1409,1408,1408, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1408,1409,1409,1409,1409, -1408,1408,1408,1408,1408,1408,1408,1408,1408,1409,1409,1409,1409,1409,1409,1409, -1417,1417,1417,1417,1417,1417,1417,1417,1417,1409,1409,1409,1409,1409,1409,1409, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,789,789, +789,789,789,789,789,789,789,789,789,793,793,1549,1549,1549,1549,789, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,789,789,789,789,789,789,789,793, +793,789,789,793,1559,1559,793,793,793,793,1558,789,789,789,789,789, /* block 288 */ -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, +789,789,789,789,789,789,789,793,789,789,793,793,793,793,789,789, +1559,789,789,789,789,1558,1558,789,789,789,789,789,789,789,789,789, +789,789,789,789,1549,793,789,789,793,789,789,789,789,789,789,789, +789,793,793,789,789,789,789,789,789,789,789,789,793,789,789,789, +789,789,793,793,793,789,789,789,789,789,789,789,789,789,789,789, +789,793,793,793,789,789,789,789,789,789,789,789,793,793,793,789, +789,793,789,793,789,789,789,789,793,789,789,789,789,789,789,793, +789,789,789,793,789,789,789,789,789,789,793,1549,1549,1549,1549,1549, /* block 289 */ -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,163,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,724,724,724,724,724, -724,724,724,724,724,724,724,724,724,724,724,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -1421,1421,1421,1421,1421,1421,1421,1421,1421,1421,163,163,163,163,163,163, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1558,1558,1558,1549,1549,1549,1558,1558,1558,1558,1558, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, /* block 290 */ -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409, -1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,1409,957,957, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1558,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1558,1558,1558,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1558,1549,1549,1549,1549,1549,789,789,789,789,789,793,1558,793,793,793, +1549,1549,1549,789,789,1549,1549,1549,1549,1550,1550,1550,1549,1549,1549,1549, +793,793,793,793,793,793,789,789,789,793,789,1549,1549,1550,1550,1550, +793,789,789,793,1549,1549,1549,1549,1549,1549,1549,1549,1549,1550,1550,1550, /* block 291 */ -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,1550,1550,1550,1550,1550,1550, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1550,1550,1550,1550, +1549,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, /* block 292 */ -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,163,163,163,163,163,163, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, +789,789,789,789,789,789,789,789,789,789,789,789,1550,1550,1550,1550, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,1550,1550,1550,1550,1550,1550,1550,1550, +789,789,789,789,789,789,789,789,789,789,1550,1550,1550,1550,1550,1550, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, /* block 293 */ -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,163,163, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, +789,789,789,789,789,789,789,789,1550,1550,1550,1550,1550,1550,1550,1550, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,1550,1550, +789,789,789,789,789,789,789,789,789,789,789,789,1550,1550,1550,1550, +789,789,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +802,802,802,802,802,802,802,802,802,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, /* block 294 */ -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, +789,789,789,789,789,789,789,789,789,789,789,789,1558,1549,1549,1558, +1549,1549,1549,1549,1549,1549,1549,1549,1558,1558,1558,1558,1558,1558,1558,1558, +1549,1549,1549,1549,1549,1549,1558,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1558,1558,1558,1558,1558,1558,1558,1558,1558,1558,1549,789,1558,1558,1558,1549, +1549,1549,1549,1549,1549,1549,789,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1558,1549,1549,1549,1549,1549,1549,1549,1549, /* block 295 */ -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1561,1561,1561,1561,1549,1558,1558,1549,1558,1558,1549,1558,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1558,1558,1558, +1549,1558,1558,1558,1558,1558,1558,1558,1558,1558,1558,1558,1558,1558,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, /* block 296 */ -952,952,952,952,952,952,952,952,952,952,952,952,952,952,952,952, -952,952,952,952,952,952,952,952,952,952,952,952,952,952,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,1550,1550,1550,1550,1550,1550,1550,1550, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,1550,1550, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1550,1550,1550, /* block 297 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,957,957, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1550,1550,1550,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549, +1549,1549,1549,1558,1558,1558,1549,1550,1549,1550,1550,1550,1550,1549,1549,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1550,1550,1549, +1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1550,1550,1550,1550,1549, +1558,1558,1558,1558,1558,1558,1558,1558,1558,1550,1550,1550,1550,1550,1550,1550, /* block 298 */ -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,163,163,163,163,163, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,196,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +1497,1497,1497,1497,1497,1497,1497,1497,1497,1497,789,196,196,196,196,196, /* block 299 */ -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -839,839,839,839,839,839,839,839,839,839,839,839,839,839,839,839, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550, +1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1039,1039, /* block 300 */ -708,713,708,708,708,708,708,708,708,708,708,708,708,708,708,708, -708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, -1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422, -1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422, -1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422, -1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422, -1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422, -1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422,1422, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, /* block 301 */ -708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, -708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, -708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, -708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, -708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, -708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, -708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, -708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,196,196, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, /* block 302 */ -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,196,196, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, /* block 303 */ -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960, -708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, /* block 304 */ -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,951,951, -951,951,951,951,951,951,951,951,951,951,951,951,951,951,957,957, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, + +/* block 305 */ +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032, +1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, + +/* block 306 */ +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, +196,196,196,196,196,196,196,196,196,196,196,196,196,196,1039,1039, + +/* block 307 */ +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,196,196,196,196,196, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, + +/* block 308 */ +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914, +914,914,914,914,914,914,914,914,914,914,196,196,196,196,196,196, + +/* block 309 */ +771,776,771,771,771,771,771,771,771,771,771,771,771,771,771,771, +771,771,771,771,771,771,771,771,771,771,771,771,771,771,771,771, +1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562, +1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562, +1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562, +1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562, +1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562, +1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562,1562, + +/* block 310 */ +771,771,771,771,771,771,771,771,771,771,771,771,771,771,771,771, +771,771,771,771,771,771,771,771,771,771,771,771,771,771,771,771, +771,771,771,771,771,771,771,771,771,771,771,771,771,771,771,771, +771,771,771,771,771,771,771,771,771,771,771,771,771,771,771,771, +771,771,771,771,771,771,771,771,771,771,771,771,771,771,771,771, +771,771,771,771,771,771,771,771,771,771,771,771,771,771,771,771, +771,771,771,771,771,771,771,771,771,771,771,771,771,771,771,771, +771,771,771,771,771,771,771,771,771,771,771,771,771,771,771,771, + +/* block 311 */ +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, + +/* block 312 */ +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042, +771,771,771,771,771,771,771,771,771,771,771,771,771,771,771,771, + +/* block 313 */ +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031, +1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1039,1039, }; #if UCD_BLOCK_SIZE != 128 diff --git a/std/regex/pcre2/pcre2_ucp.h b/std/regex/pcre2/pcre2_ucp.h index 9ccc82975..74c1cc539 100644 --- a/std/regex/pcre2/pcre2_ucp.h +++ b/std/regex/pcre2/pcre2_ucp.h @@ -42,6 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ + #ifndef PCRE2_UCP_H_IDEMPOTENT_GUARD #define PCRE2_UCP_H_IDEMPOTENT_GUARD @@ -132,13 +133,18 @@ enum { ucp_Hex_Digit, ucp_IDS_Binary_Operator, ucp_IDS_Trinary_Operator, + ucp_IDS_Unary_Operator, + ucp_ID_Compat_Math_Continue, + ucp_ID_Compat_Math_Start, ucp_ID_Continue, ucp_ID_Start, ucp_Ideographic, + ucp_InCB, ucp_Join_Control, ucp_Logical_Order_Exception, ucp_Lowercase, ucp_Math, + ucp_Modifier_Combining_Mark, ucp_Noncharacter_Code_Point, ucp_Pattern_Syntax, ucp_Pattern_White_Space, @@ -219,6 +225,8 @@ enum { ucp_Latin, ucp_Greek, ucp_Cyrillic, + ucp_Armenian, + ucp_Hebrew, ucp_Arabic, ucp_Syriac, ucp_Thaana, @@ -232,15 +240,21 @@ enum { ucp_Kannada, ucp_Malayalam, ucp_Sinhala, + ucp_Thai, + ucp_Tibetan, ucp_Myanmar, ucp_Georgian, ucp_Hangul, + ucp_Ethiopic, + ucp_Cherokee, + ucp_Runic, ucp_Mongolian, ucp_Hiragana, ucp_Katakana, ucp_Bopomofo, ucp_Han, ucp_Yi, + ucp_Gothic, ucp_Tagalog, ucp_Hanunoo, ucp_Buhid, @@ -248,21 +262,33 @@ enum { ucp_Limbu, ucp_Tai_Le, ucp_Linear_B, + ucp_Shavian, ucp_Cypriot, ucp_Buginese, ucp_Coptic, ucp_Glagolitic, + ucp_Tifinagh, ucp_Syloti_Nagri, ucp_Phags_Pa, ucp_Nko, ucp_Kayah_Li, + ucp_Lycian, + ucp_Carian, + ucp_Lydian, + ucp_Avestan, + ucp_Samaritan, + ucp_Lisu, ucp_Javanese, + ucp_Old_Turkic, ucp_Kaithi, ucp_Mandaic, ucp_Chakma, + ucp_Meroitic_Hieroglyphs, ucp_Sharada, ucp_Takri, + ucp_Caucasian_Albanian, ucp_Duployan, + ucp_Elbasan, ucp_Grantha, ucp_Khojki, ucp_Linear_A, @@ -274,7 +300,11 @@ enum { ucp_Khudawadi, ucp_Tirhuta, ucp_Multani, + ucp_Old_Hungarian, ucp_Adlam, + ucp_Newa, + ucp_Osage, + ucp_Tangut, ucp_Masaram_Gondi, ucp_Dogra, ucp_Gunjala_Gondi, @@ -284,31 +314,28 @@ enum { ucp_Yezidi, ucp_Cypro_Minoan, ucp_Old_Uyghur, + ucp_Toto, + ucp_Garay, + ucp_Gurung_Khema, + ucp_Ol_Onal, + ucp_Sunuwar, + ucp_Todhri, + ucp_Tulu_Tigalari, /* Scripts which has no characters in other scripts. */ ucp_Unknown, ucp_Common, - ucp_Armenian, - ucp_Hebrew, - ucp_Thai, ucp_Lao, - ucp_Tibetan, - ucp_Ethiopic, - ucp_Cherokee, ucp_Canadian_Aboriginal, ucp_Ogham, - ucp_Runic, ucp_Khmer, ucp_Old_Italic, - ucp_Gothic, ucp_Deseret, ucp_Inherited, ucp_Ugaritic, - ucp_Shavian, ucp_Osmanya, ucp_Braille, ucp_New_Tai_Lue, - ucp_Tifinagh, ucp_Old_Persian, ucp_Kharoshthi, ucp_Balinese, @@ -320,32 +347,22 @@ enum { ucp_Vai, ucp_Saurashtra, ucp_Rejang, - ucp_Lycian, - ucp_Carian, - ucp_Lydian, ucp_Cham, ucp_Tai_Tham, ucp_Tai_Viet, - ucp_Avestan, ucp_Egyptian_Hieroglyphs, - ucp_Samaritan, - ucp_Lisu, ucp_Bamum, ucp_Meetei_Mayek, ucp_Imperial_Aramaic, ucp_Old_South_Arabian, ucp_Inscriptional_Parthian, ucp_Inscriptional_Pahlavi, - ucp_Old_Turkic, ucp_Batak, ucp_Brahmi, ucp_Meroitic_Cursive, - ucp_Meroitic_Hieroglyphs, ucp_Miao, ucp_Sora_Sompeng, - ucp_Caucasian_Albanian, ucp_Bassa_Vah, - ucp_Elbasan, ucp_Pahawh_Hmong, ucp_Mende_Kikakui, ucp_Mro, @@ -358,13 +375,9 @@ enum { ucp_Ahom, ucp_Anatolian_Hieroglyphs, ucp_Hatran, - ucp_Old_Hungarian, ucp_SignWriting, ucp_Bhaiksuki, ucp_Marchen, - ucp_Newa, - ucp_Osage, - ucp_Tangut, ucp_Nushu, ucp_Soyombo, ucp_Zanabazar_Square, @@ -378,10 +391,14 @@ enum { ucp_Dives_Akuru, ucp_Khitan_Small_Script, ucp_Tangsa, - ucp_Toto, ucp_Vithkuqi, ucp_Kawi, ucp_Nag_Mundari, + ucp_Kirat_Rai, + ucp_Sidetic, + ucp_Tai_Yo, + ucp_Tolong_Siki, + ucp_Beria_Erfe, /* This must be last */ ucp_Script_Count @@ -389,7 +406,7 @@ enum { /* Size of entries in ucd_script_sets[] */ -#define ucd_script_sets_item_size 3 +#define ucd_script_sets_item_size 4 #endif /* PCRE2_UCP_H_IDEMPOTENT_GUARD */ diff --git a/std/regex/pcre2/pcre2_ucptables.c b/std/regex/pcre2/pcre2_ucptables_inc.h similarity index 69% rename from std/regex/pcre2/pcre2_ucptables.c rename to std/regex/pcre2/pcre2_ucptables_inc.h index 2110014c2..06a5c0e56 100644 --- a/std/regex/pcre2/pcre2_ucptables.c +++ b/std/regex/pcre2/pcre2_ucptables_inc.h @@ -42,6 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ + #ifdef SUPPORT_UNICODE /* The PRIV(utt)[] table below translates Unicode property names into type and @@ -81,6 +82,8 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_batk0 STR_b STR_a STR_t STR_k "\0" #define STRING_beng0 STR_b STR_e STR_n STR_g "\0" #define STRING_bengali0 STR_b STR_e STR_n STR_g STR_a STR_l STR_i "\0" +#define STRING_berf0 STR_b STR_e STR_r STR_f "\0" +#define STRING_beriaerfe0 STR_b STR_e STR_r STR_i STR_a STR_e STR_r STR_f STR_e "\0" #define STRING_bhaiksuki0 STR_b STR_h STR_a STR_i STR_k STR_s STR_u STR_k STR_i "\0" #define STRING_bhks0 STR_b STR_h STR_k STR_s "\0" #define STRING_bidial0 STR_b STR_i STR_d STR_i STR_a STR_l "\0" @@ -199,6 +202,8 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_extendedpictographic0 STR_e STR_x STR_t STR_e STR_n STR_d STR_e STR_d STR_p STR_i STR_c STR_t STR_o STR_g STR_r STR_a STR_p STR_h STR_i STR_c "\0" #define STRING_extender0 STR_e STR_x STR_t STR_e STR_n STR_d STR_e STR_r "\0" #define STRING_extpict0 STR_e STR_x STR_t STR_p STR_i STR_c STR_t "\0" +#define STRING_gara0 STR_g STR_a STR_r STR_a "\0" +#define STRING_garay0 STR_g STR_a STR_r STR_a STR_y "\0" #define STRING_geor0 STR_g STR_e STR_o STR_r "\0" #define STRING_georgian0 STR_g STR_e STR_o STR_r STR_g STR_i STR_a STR_n "\0" #define STRING_glag0 STR_g STR_l STR_a STR_g "\0" @@ -219,9 +224,11 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_grlink0 STR_g STR_r STR_l STR_i STR_n STR_k "\0" #define STRING_gujarati0 STR_g STR_u STR_j STR_a STR_r STR_a STR_t STR_i "\0" #define STRING_gujr0 STR_g STR_u STR_j STR_r "\0" +#define STRING_gukh0 STR_g STR_u STR_k STR_h "\0" #define STRING_gunjalagondi0 STR_g STR_u STR_n STR_j STR_a STR_l STR_a STR_g STR_o STR_n STR_d STR_i "\0" #define STRING_gurmukhi0 STR_g STR_u STR_r STR_m STR_u STR_k STR_h STR_i "\0" #define STRING_guru0 STR_g STR_u STR_r STR_u "\0" +#define STRING_gurungkhema0 STR_g STR_u STR_r STR_u STR_n STR_g STR_k STR_h STR_e STR_m STR_a "\0" #define STRING_han0 STR_h STR_a STR_n "\0" #define STRING_hang0 STR_h STR_a STR_n STR_g "\0" #define STRING_hangul0 STR_h STR_a STR_n STR_g STR_u STR_l "\0" @@ -242,6 +249,8 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_hmnp0 STR_h STR_m STR_n STR_p "\0" #define STRING_hung0 STR_h STR_u STR_n STR_g "\0" #define STRING_idc0 STR_i STR_d STR_c "\0" +#define STRING_idcompatmathcontinue0 STR_i STR_d STR_c STR_o STR_m STR_p STR_a STR_t STR_m STR_a STR_t STR_h STR_c STR_o STR_n STR_t STR_i STR_n STR_u STR_e "\0" +#define STRING_idcompatmathstart0 STR_i STR_d STR_c STR_o STR_m STR_p STR_a STR_t STR_m STR_a STR_t STR_h STR_s STR_t STR_a STR_r STR_t "\0" #define STRING_idcontinue0 STR_i STR_d STR_c STR_o STR_n STR_t STR_i STR_n STR_u STR_e "\0" #define STRING_ideo0 STR_i STR_d STR_e STR_o "\0" #define STRING_ideographic0 STR_i STR_d STR_e STR_o STR_g STR_r STR_a STR_p STR_h STR_i STR_c "\0" @@ -251,7 +260,10 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_idst0 STR_i STR_d STR_s STR_t "\0" #define STRING_idstart0 STR_i STR_d STR_s STR_t STR_a STR_r STR_t "\0" #define STRING_idstrinaryoperator0 STR_i STR_d STR_s STR_t STR_r STR_i STR_n STR_a STR_r STR_y STR_o STR_p STR_e STR_r STR_a STR_t STR_o STR_r "\0" +#define STRING_idsu0 STR_i STR_d STR_s STR_u "\0" +#define STRING_idsunaryoperator0 STR_i STR_d STR_s STR_u STR_n STR_a STR_r STR_y STR_o STR_p STR_e STR_r STR_a STR_t STR_o STR_r "\0" #define STRING_imperialaramaic0 STR_i STR_m STR_p STR_e STR_r STR_i STR_a STR_l STR_a STR_r STR_a STR_m STR_a STR_i STR_c "\0" +#define STRING_incb0 STR_i STR_n STR_c STR_b "\0" #define STRING_inherited0 STR_i STR_n STR_h STR_e STR_r STR_i STR_t STR_e STR_d "\0" #define STRING_inscriptionalpahlavi0 STR_i STR_n STR_s STR_c STR_r STR_i STR_p STR_t STR_i STR_o STR_n STR_a STR_l STR_p STR_a STR_h STR_l STR_a STR_v STR_i "\0" #define STRING_inscriptionalparthian0 STR_i STR_n STR_s STR_c STR_r STR_i STR_p STR_t STR_i STR_o STR_n STR_a STR_l STR_p STR_a STR_r STR_t STR_h STR_i STR_a STR_n "\0" @@ -275,8 +287,10 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_khoj0 STR_k STR_h STR_o STR_j "\0" #define STRING_khojki0 STR_k STR_h STR_o STR_j STR_k STR_i "\0" #define STRING_khudawadi0 STR_k STR_h STR_u STR_d STR_a STR_w STR_a STR_d STR_i "\0" +#define STRING_kiratrai0 STR_k STR_i STR_r STR_a STR_t STR_r STR_a STR_i "\0" #define STRING_kits0 STR_k STR_i STR_t STR_s "\0" #define STRING_knda0 STR_k STR_n STR_d STR_a "\0" +#define STRING_krai0 STR_k STR_r STR_a STR_i "\0" #define STRING_kthi0 STR_k STR_t STR_h STR_i "\0" #define STRING_l0 STR_l "\0" #define STRING_l_AMPERSAND0 STR_l STR_AMPERSAND "\0" @@ -323,6 +337,7 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_masaramgondi0 STR_m STR_a STR_s STR_a STR_r STR_a STR_m STR_g STR_o STR_n STR_d STR_i "\0" #define STRING_math0 STR_m STR_a STR_t STR_h "\0" #define STRING_mc0 STR_m STR_c "\0" +#define STRING_mcm0 STR_m STR_c STR_m "\0" #define STRING_me0 STR_m STR_e "\0" #define STRING_medefaidrin0 STR_m STR_e STR_d STR_e STR_f STR_a STR_i STR_d STR_r STR_i STR_n "\0" #define STRING_medf0 STR_m STR_e STR_d STR_f "\0" @@ -337,6 +352,7 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_mlym0 STR_m STR_l STR_y STR_m "\0" #define STRING_mn0 STR_m STR_n "\0" #define STRING_modi0 STR_m STR_o STR_d STR_i "\0" +#define STRING_modifiercombiningmark0 STR_m STR_o STR_d STR_i STR_f STR_i STR_e STR_r STR_c STR_o STR_m STR_b STR_i STR_n STR_i STR_n STR_g STR_m STR_a STR_r STR_k "\0" #define STRING_mong0 STR_m STR_o STR_n STR_g "\0" #define STRING_mongolian0 STR_m STR_o STR_n STR_g STR_o STR_l STR_i STR_a STR_n "\0" #define STRING_mro0 STR_m STR_r STR_o "\0" @@ -379,6 +395,8 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_oldsoutharabian0 STR_o STR_l STR_d STR_s STR_o STR_u STR_t STR_h STR_a STR_r STR_a STR_b STR_i STR_a STR_n "\0" #define STRING_oldturkic0 STR_o STR_l STR_d STR_t STR_u STR_r STR_k STR_i STR_c "\0" #define STRING_olduyghur0 STR_o STR_l STR_d STR_u STR_y STR_g STR_h STR_u STR_r "\0" +#define STRING_olonal0 STR_o STR_l STR_o STR_n STR_a STR_l "\0" +#define STRING_onao0 STR_o STR_n STR_a STR_o "\0" #define STRING_oriya0 STR_o STR_r STR_i STR_y STR_a "\0" #define STRING_orkh0 STR_o STR_r STR_k STR_h "\0" #define STRING_orya0 STR_o STR_r STR_y STR_a "\0" @@ -444,6 +462,8 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_shrd0 STR_s STR_h STR_r STR_d "\0" #define STRING_sidd0 STR_s STR_i STR_d STR_d "\0" #define STRING_siddham0 STR_s STR_i STR_d STR_d STR_h STR_a STR_m "\0" +#define STRING_sidetic0 STR_s STR_i STR_d STR_e STR_t STR_i STR_c "\0" +#define STRING_sidt0 STR_s STR_i STR_d STR_t "\0" #define STRING_signwriting0 STR_s STR_i STR_g STR_n STR_w STR_r STR_i STR_t STR_i STR_n STR_g "\0" #define STRING_sind0 STR_s STR_i STR_n STR_d "\0" #define STRING_sinh0 STR_s STR_i STR_n STR_h "\0" @@ -463,6 +483,8 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_sterm0 STR_s STR_t STR_e STR_r STR_m "\0" #define STRING_sund0 STR_s STR_u STR_n STR_d "\0" #define STRING_sundanese0 STR_s STR_u STR_n STR_d STR_a STR_n STR_e STR_s STR_e "\0" +#define STRING_sunu0 STR_s STR_u STR_n STR_u "\0" +#define STRING_sunuwar0 STR_s STR_u STR_n STR_u STR_w STR_a STR_r "\0" #define STRING_sylo0 STR_s STR_y STR_l STR_o "\0" #define STRING_sylotinagri0 STR_s STR_y STR_l STR_o STR_t STR_i STR_n STR_a STR_g STR_r STR_i "\0" #define STRING_syrc0 STR_s STR_y STR_r STR_c "\0" @@ -473,6 +495,7 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_taile0 STR_t STR_a STR_i STR_l STR_e "\0" #define STRING_taitham0 STR_t STR_a STR_i STR_t STR_h STR_a STR_m "\0" #define STRING_taiviet0 STR_t STR_a STR_i STR_v STR_i STR_e STR_t "\0" +#define STRING_taiyo0 STR_t STR_a STR_i STR_y STR_o "\0" #define STRING_takr0 STR_t STR_a STR_k STR_r "\0" #define STRING_takri0 STR_t STR_a STR_k STR_r STR_i "\0" #define STRING_tale0 STR_t STR_a STR_l STR_e "\0" @@ -483,6 +506,7 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_tangsa0 STR_t STR_a STR_n STR_g STR_s STR_a "\0" #define STRING_tangut0 STR_t STR_a STR_n STR_g STR_u STR_t "\0" #define STRING_tavt0 STR_t STR_a STR_v STR_t "\0" +#define STRING_tayo0 STR_t STR_a STR_y STR_o "\0" #define STRING_telu0 STR_t STR_e STR_l STR_u "\0" #define STRING_telugu0 STR_t STR_e STR_l STR_u STR_g STR_u "\0" #define STRING_term0 STR_t STR_e STR_r STR_m "\0" @@ -498,7 +522,13 @@ the "loose matching" rules that Unicode advises and Perl uses. */ #define STRING_tirh0 STR_t STR_i STR_r STR_h "\0" #define STRING_tirhuta0 STR_t STR_i STR_r STR_h STR_u STR_t STR_a "\0" #define STRING_tnsa0 STR_t STR_n STR_s STR_a "\0" +#define STRING_todhri0 STR_t STR_o STR_d STR_h STR_r STR_i "\0" +#define STRING_todr0 STR_t STR_o STR_d STR_r "\0" +#define STRING_tolongsiki0 STR_t STR_o STR_l STR_o STR_n STR_g STR_s STR_i STR_k STR_i "\0" +#define STRING_tols0 STR_t STR_o STR_l STR_s "\0" #define STRING_toto0 STR_t STR_o STR_t STR_o "\0" +#define STRING_tulutigalari0 STR_t STR_u STR_l STR_u STR_t STR_i STR_g STR_a STR_l STR_a STR_r STR_i "\0" +#define STRING_tutg0 STR_t STR_u STR_t STR_g "\0" #define STRING_ugar0 STR_u STR_g STR_a STR_r "\0" #define STRING_ugaritic0 STR_u STR_g STR_a STR_r STR_i STR_t STR_i STR_c "\0" #define STRING_uideo0 STR_u STR_i STR_d STR_e STR_o "\0" @@ -572,6 +602,8 @@ const char PRIV(utt_names)[] = STRING_batk0 STRING_beng0 STRING_bengali0 + STRING_berf0 + STRING_beriaerfe0 STRING_bhaiksuki0 STRING_bhks0 STRING_bidial0 @@ -690,6 +722,8 @@ const char PRIV(utt_names)[] = STRING_extendedpictographic0 STRING_extender0 STRING_extpict0 + STRING_gara0 + STRING_garay0 STRING_geor0 STRING_georgian0 STRING_glag0 @@ -710,9 +744,11 @@ const char PRIV(utt_names)[] = STRING_grlink0 STRING_gujarati0 STRING_gujr0 + STRING_gukh0 STRING_gunjalagondi0 STRING_gurmukhi0 STRING_guru0 + STRING_gurungkhema0 STRING_han0 STRING_hang0 STRING_hangul0 @@ -733,6 +769,8 @@ const char PRIV(utt_names)[] = STRING_hmnp0 STRING_hung0 STRING_idc0 + STRING_idcompatmathcontinue0 + STRING_idcompatmathstart0 STRING_idcontinue0 STRING_ideo0 STRING_ideographic0 @@ -742,7 +780,10 @@ const char PRIV(utt_names)[] = STRING_idst0 STRING_idstart0 STRING_idstrinaryoperator0 + STRING_idsu0 + STRING_idsunaryoperator0 STRING_imperialaramaic0 + STRING_incb0 STRING_inherited0 STRING_inscriptionalpahlavi0 STRING_inscriptionalparthian0 @@ -766,8 +807,10 @@ const char PRIV(utt_names)[] = STRING_khoj0 STRING_khojki0 STRING_khudawadi0 + STRING_kiratrai0 STRING_kits0 STRING_knda0 + STRING_krai0 STRING_kthi0 STRING_l0 STRING_l_AMPERSAND0 @@ -814,6 +857,7 @@ const char PRIV(utt_names)[] = STRING_masaramgondi0 STRING_math0 STRING_mc0 + STRING_mcm0 STRING_me0 STRING_medefaidrin0 STRING_medf0 @@ -828,6 +872,7 @@ const char PRIV(utt_names)[] = STRING_mlym0 STRING_mn0 STRING_modi0 + STRING_modifiercombiningmark0 STRING_mong0 STRING_mongolian0 STRING_mro0 @@ -870,6 +915,8 @@ const char PRIV(utt_names)[] = STRING_oldsoutharabian0 STRING_oldturkic0 STRING_olduyghur0 + STRING_olonal0 + STRING_onao0 STRING_oriya0 STRING_orkh0 STRING_orya0 @@ -935,6 +982,8 @@ const char PRIV(utt_names)[] = STRING_shrd0 STRING_sidd0 STRING_siddham0 + STRING_sidetic0 + STRING_sidt0 STRING_signwriting0 STRING_sind0 STRING_sinh0 @@ -954,6 +1003,8 @@ const char PRIV(utt_names)[] = STRING_sterm0 STRING_sund0 STRING_sundanese0 + STRING_sunu0 + STRING_sunuwar0 STRING_sylo0 STRING_sylotinagri0 STRING_syrc0 @@ -964,6 +1015,7 @@ const char PRIV(utt_names)[] = STRING_taile0 STRING_taitham0 STRING_taiviet0 + STRING_taiyo0 STRING_takr0 STRING_takri0 STRING_tale0 @@ -974,6 +1026,7 @@ const char PRIV(utt_names)[] = STRING_tangsa0 STRING_tangut0 STRING_tavt0 + STRING_tayo0 STRING_telu0 STRING_telugu0 STRING_term0 @@ -989,7 +1042,13 @@ const char PRIV(utt_names)[] = STRING_tirh0 STRING_tirhuta0 STRING_tnsa0 + STRING_todhri0 + STRING_todr0 + STRING_tolongsiki0 + STRING_tols0 STRING_toto0 + STRING_tulutigalari0 + STRING_tutg0 STRING_ugar0 STRING_ugaritic0 STRING_uideo0 @@ -1037,7 +1096,7 @@ const char PRIV(utt_names)[] = const ucp_type_table PRIV(utt)[] = { { 0, PT_SCX, ucp_Adlam }, { 6, PT_SCX, ucp_Adlam }, - { 11, PT_SC, ucp_Caucasian_Albanian }, + { 11, PT_SCX, ucp_Caucasian_Albanian }, { 16, PT_BOOL, ucp_ASCII_Hex_Digit }, { 21, PT_SC, ucp_Ahom }, { 26, PT_BOOL, ucp_Alphabetic }, @@ -1046,13 +1105,13 @@ const ucp_type_table PRIV(utt)[] = { { 64, PT_ANY, 0 }, { 68, PT_SCX, ucp_Arabic }, { 73, PT_SCX, ucp_Arabic }, - { 80, PT_SC, ucp_Armenian }, + { 80, PT_SCX, ucp_Armenian }, { 89, PT_SC, ucp_Imperial_Aramaic }, - { 94, PT_SC, ucp_Armenian }, + { 94, PT_SCX, ucp_Armenian }, { 99, PT_BOOL, ucp_ASCII }, { 105, PT_BOOL, ucp_ASCII_Hex_Digit }, - { 119, PT_SC, ucp_Avestan }, - { 127, PT_SC, ucp_Avestan }, + { 119, PT_SCX, ucp_Avestan }, + { 127, PT_SCX, ucp_Avestan }, { 132, PT_SC, ucp_Balinese }, { 137, PT_SC, ucp_Balinese }, { 146, PT_SC, ucp_Bamum }, @@ -1063,471 +1122,500 @@ const ucp_type_table PRIV(utt)[] = { { 177, PT_SC, ucp_Batak }, { 182, PT_SCX, ucp_Bengali }, { 187, PT_SCX, ucp_Bengali }, - { 195, PT_SC, ucp_Bhaiksuki }, - { 205, PT_SC, ucp_Bhaiksuki }, - { 210, PT_BIDICL, ucp_bidiAL }, - { 217, PT_BIDICL, ucp_bidiAN }, - { 224, PT_BIDICL, ucp_bidiB }, - { 230, PT_BIDICL, ucp_bidiBN }, - { 237, PT_BOOL, ucp_Bidi_Control }, - { 243, PT_BOOL, ucp_Bidi_Control }, - { 255, PT_BIDICL, ucp_bidiCS }, - { 262, PT_BIDICL, ucp_bidiEN }, - { 269, PT_BIDICL, ucp_bidiES }, - { 276, PT_BIDICL, ucp_bidiET }, - { 283, PT_BIDICL, ucp_bidiFSI }, - { 291, PT_BIDICL, ucp_bidiL }, - { 297, PT_BIDICL, ucp_bidiLRE }, - { 305, PT_BIDICL, ucp_bidiLRI }, - { 313, PT_BIDICL, ucp_bidiLRO }, - { 321, PT_BOOL, ucp_Bidi_Mirrored }, - { 327, PT_BOOL, ucp_Bidi_Mirrored }, - { 340, PT_BIDICL, ucp_bidiNSM }, - { 348, PT_BIDICL, ucp_bidiON }, - { 355, PT_BIDICL, ucp_bidiPDF }, - { 363, PT_BIDICL, ucp_bidiPDI }, - { 371, PT_BIDICL, ucp_bidiR }, - { 377, PT_BIDICL, ucp_bidiRLE }, - { 385, PT_BIDICL, ucp_bidiRLI }, - { 393, PT_BIDICL, ucp_bidiRLO }, - { 401, PT_BIDICL, ucp_bidiS }, - { 407, PT_BIDICL, ucp_bidiWS }, - { 414, PT_SCX, ucp_Bopomofo }, - { 419, PT_SCX, ucp_Bopomofo }, - { 428, PT_SC, ucp_Brahmi }, - { 433, PT_SC, ucp_Brahmi }, - { 440, PT_SC, ucp_Braille }, - { 445, PT_SC, ucp_Braille }, - { 453, PT_SCX, ucp_Buginese }, - { 458, PT_SCX, ucp_Buginese }, - { 467, PT_SCX, ucp_Buhid }, - { 472, PT_SCX, ucp_Buhid }, - { 478, PT_GC, ucp_C }, - { 480, PT_SCX, ucp_Chakma }, - { 485, PT_SC, ucp_Canadian_Aboriginal }, - { 504, PT_SC, ucp_Canadian_Aboriginal }, - { 509, PT_SC, ucp_Carian }, - { 514, PT_SC, ucp_Carian }, - { 521, PT_BOOL, ucp_Cased }, - { 527, PT_BOOL, ucp_Case_Ignorable }, - { 541, PT_SC, ucp_Caucasian_Albanian }, - { 559, PT_PC, ucp_Cc }, - { 562, PT_PC, ucp_Cf }, - { 565, PT_SCX, ucp_Chakma }, - { 572, PT_SC, ucp_Cham }, - { 577, PT_BOOL, ucp_Changes_When_Casefolded }, - { 599, PT_BOOL, ucp_Changes_When_Casemapped }, - { 621, PT_BOOL, ucp_Changes_When_Lowercased }, - { 643, PT_BOOL, ucp_Changes_When_Titlecased }, - { 665, PT_BOOL, ucp_Changes_When_Uppercased }, - { 687, PT_SC, ucp_Cherokee }, - { 692, PT_SC, ucp_Cherokee }, - { 701, PT_SC, ucp_Chorasmian }, - { 712, PT_SC, ucp_Chorasmian }, - { 717, PT_BOOL, ucp_Case_Ignorable }, - { 720, PT_PC, ucp_Cn }, - { 723, PT_PC, ucp_Co }, - { 726, PT_SC, ucp_Common }, - { 733, PT_SCX, ucp_Coptic }, - { 738, PT_SCX, ucp_Coptic }, - { 745, PT_SCX, ucp_Cypro_Minoan }, - { 750, PT_SCX, ucp_Cypriot }, - { 755, PT_PC, ucp_Cs }, - { 758, PT_SC, ucp_Cuneiform }, - { 768, PT_BOOL, ucp_Changes_When_Casefolded }, - { 773, PT_BOOL, ucp_Changes_When_Casemapped }, - { 778, PT_BOOL, ucp_Changes_When_Lowercased }, - { 782, PT_BOOL, ucp_Changes_When_Titlecased }, - { 786, PT_BOOL, ucp_Changes_When_Uppercased }, - { 790, PT_SCX, ucp_Cypriot }, - { 798, PT_SCX, ucp_Cypro_Minoan }, - { 810, PT_SCX, ucp_Cyrillic }, - { 819, PT_SCX, ucp_Cyrillic }, - { 824, PT_BOOL, ucp_Dash }, - { 829, PT_BOOL, ucp_Default_Ignorable_Code_Point }, - { 855, PT_BOOL, ucp_Deprecated }, - { 859, PT_BOOL, ucp_Deprecated }, - { 870, PT_SC, ucp_Deseret }, - { 878, PT_SCX, ucp_Devanagari }, - { 883, PT_SCX, ucp_Devanagari }, - { 894, PT_BOOL, ucp_Default_Ignorable_Code_Point }, - { 897, PT_BOOL, ucp_Diacritic }, - { 901, PT_BOOL, ucp_Diacritic }, - { 911, PT_SC, ucp_Dives_Akuru }, - { 916, PT_SC, ucp_Dives_Akuru }, - { 927, PT_SCX, ucp_Dogra }, - { 932, PT_SCX, ucp_Dogra }, - { 938, PT_SC, ucp_Deseret }, - { 943, PT_SCX, ucp_Duployan }, - { 948, PT_SCX, ucp_Duployan }, - { 957, PT_BOOL, ucp_Emoji_Modifier_Base }, - { 963, PT_BOOL, ucp_Emoji_Component }, - { 969, PT_SC, ucp_Egyptian_Hieroglyphs }, - { 974, PT_SC, ucp_Egyptian_Hieroglyphs }, - { 994, PT_SC, ucp_Elbasan }, - { 999, PT_SC, ucp_Elbasan }, - { 1007, PT_SC, ucp_Elymaic }, - { 1012, PT_SC, ucp_Elymaic }, - { 1020, PT_BOOL, ucp_Emoji_Modifier }, - { 1025, PT_BOOL, ucp_Emoji }, - { 1031, PT_BOOL, ucp_Emoji_Component }, - { 1046, PT_BOOL, ucp_Emoji_Modifier }, - { 1060, PT_BOOL, ucp_Emoji_Modifier_Base }, - { 1078, PT_BOOL, ucp_Emoji_Presentation }, - { 1096, PT_BOOL, ucp_Emoji_Presentation }, - { 1102, PT_SC, ucp_Ethiopic }, - { 1107, PT_SC, ucp_Ethiopic }, - { 1116, PT_BOOL, ucp_Extender }, - { 1120, PT_BOOL, ucp_Extended_Pictographic }, - { 1141, PT_BOOL, ucp_Extender }, - { 1150, PT_BOOL, ucp_Extended_Pictographic }, - { 1158, PT_SCX, ucp_Georgian }, - { 1163, PT_SCX, ucp_Georgian }, - { 1172, PT_SCX, ucp_Glagolitic }, - { 1177, PT_SCX, ucp_Glagolitic }, - { 1188, PT_SCX, ucp_Gunjala_Gondi }, - { 1193, PT_SCX, ucp_Masaram_Gondi }, - { 1198, PT_SC, ucp_Gothic }, - { 1203, PT_SC, ucp_Gothic }, - { 1210, PT_SCX, ucp_Grantha }, - { 1215, PT_SCX, ucp_Grantha }, - { 1223, PT_BOOL, ucp_Grapheme_Base }, - { 1236, PT_BOOL, ucp_Grapheme_Extend }, - { 1251, PT_BOOL, ucp_Grapheme_Link }, - { 1264, PT_BOOL, ucp_Grapheme_Base }, - { 1271, PT_SCX, ucp_Greek }, - { 1277, PT_SCX, ucp_Greek }, - { 1282, PT_BOOL, ucp_Grapheme_Extend }, - { 1288, PT_BOOL, ucp_Grapheme_Link }, - { 1295, PT_SCX, ucp_Gujarati }, - { 1304, PT_SCX, ucp_Gujarati }, - { 1309, PT_SCX, ucp_Gunjala_Gondi }, - { 1322, PT_SCX, ucp_Gurmukhi }, - { 1331, PT_SCX, ucp_Gurmukhi }, - { 1336, PT_SCX, ucp_Han }, - { 1340, PT_SCX, ucp_Hangul }, - { 1345, PT_SCX, ucp_Hangul }, - { 1352, PT_SCX, ucp_Han }, - { 1357, PT_SCX, ucp_Hanifi_Rohingya }, - { 1372, PT_SCX, ucp_Hanunoo }, - { 1377, PT_SCX, ucp_Hanunoo }, - { 1385, PT_SC, ucp_Hatran }, - { 1390, PT_SC, ucp_Hatran }, - { 1397, PT_SC, ucp_Hebrew }, - { 1402, PT_SC, ucp_Hebrew }, - { 1409, PT_BOOL, ucp_Hex_Digit }, - { 1413, PT_BOOL, ucp_Hex_Digit }, - { 1422, PT_SCX, ucp_Hiragana }, - { 1427, PT_SCX, ucp_Hiragana }, - { 1436, PT_SC, ucp_Anatolian_Hieroglyphs }, - { 1441, PT_SC, ucp_Pahawh_Hmong }, - { 1446, PT_SC, ucp_Nyiakeng_Puachue_Hmong }, - { 1451, PT_SC, ucp_Old_Hungarian }, - { 1456, PT_BOOL, ucp_ID_Continue }, - { 1460, PT_BOOL, ucp_ID_Continue }, - { 1471, PT_BOOL, ucp_Ideographic }, - { 1476, PT_BOOL, ucp_Ideographic }, - { 1488, PT_BOOL, ucp_ID_Start }, - { 1492, PT_BOOL, ucp_IDS_Binary_Operator }, - { 1497, PT_BOOL, ucp_IDS_Binary_Operator }, - { 1515, PT_BOOL, ucp_IDS_Trinary_Operator }, - { 1520, PT_BOOL, ucp_ID_Start }, - { 1528, PT_BOOL, ucp_IDS_Trinary_Operator }, - { 1547, PT_SC, ucp_Imperial_Aramaic }, - { 1563, PT_SC, ucp_Inherited }, - { 1573, PT_SC, ucp_Inscriptional_Pahlavi }, - { 1594, PT_SC, ucp_Inscriptional_Parthian }, - { 1616, PT_SC, ucp_Old_Italic }, - { 1621, PT_SCX, ucp_Javanese }, - { 1626, PT_SCX, ucp_Javanese }, - { 1635, PT_BOOL, ucp_Join_Control }, - { 1641, PT_BOOL, ucp_Join_Control }, - { 1653, PT_SCX, ucp_Kaithi }, - { 1660, PT_SCX, ucp_Kayah_Li }, - { 1665, PT_SCX, ucp_Katakana }, - { 1670, PT_SCX, ucp_Kannada }, - { 1678, PT_SCX, ucp_Katakana }, - { 1687, PT_SC, ucp_Kawi }, - { 1692, PT_SCX, ucp_Kayah_Li }, - { 1700, PT_SC, ucp_Kharoshthi }, - { 1705, PT_SC, ucp_Kharoshthi }, - { 1716, PT_SC, ucp_Khitan_Small_Script }, - { 1734, PT_SC, ucp_Khmer }, - { 1740, PT_SC, ucp_Khmer }, - { 1745, PT_SCX, ucp_Khojki }, - { 1750, PT_SCX, ucp_Khojki }, - { 1757, PT_SCX, ucp_Khudawadi }, - { 1767, PT_SC, ucp_Khitan_Small_Script }, - { 1772, PT_SCX, ucp_Kannada }, - { 1777, PT_SCX, ucp_Kaithi }, - { 1782, PT_GC, ucp_L }, - { 1784, PT_LAMP, 0 }, - { 1787, PT_SC, ucp_Tai_Tham }, - { 1792, PT_SC, ucp_Lao }, - { 1796, PT_SC, ucp_Lao }, - { 1801, PT_SCX, ucp_Latin }, - { 1807, PT_SCX, ucp_Latin }, - { 1812, PT_LAMP, 0 }, - { 1815, PT_SC, ucp_Lepcha }, - { 1820, PT_SC, ucp_Lepcha }, - { 1827, PT_SCX, ucp_Limbu }, - { 1832, PT_SCX, ucp_Limbu }, - { 1838, PT_SCX, ucp_Linear_A }, - { 1843, PT_SCX, ucp_Linear_B }, - { 1848, PT_SCX, ucp_Linear_A }, - { 1856, PT_SCX, ucp_Linear_B }, - { 1864, PT_SC, ucp_Lisu }, - { 1869, PT_PC, ucp_Ll }, - { 1872, PT_PC, ucp_Lm }, - { 1875, PT_PC, ucp_Lo }, - { 1878, PT_BOOL, ucp_Logical_Order_Exception }, - { 1882, PT_BOOL, ucp_Logical_Order_Exception }, - { 1904, PT_BOOL, ucp_Lowercase }, - { 1910, PT_BOOL, ucp_Lowercase }, - { 1920, PT_PC, ucp_Lt }, - { 1923, PT_PC, ucp_Lu }, - { 1926, PT_SC, ucp_Lycian }, - { 1931, PT_SC, ucp_Lycian }, - { 1938, PT_SC, ucp_Lydian }, - { 1943, PT_SC, ucp_Lydian }, - { 1950, PT_GC, ucp_M }, - { 1952, PT_SCX, ucp_Mahajani }, - { 1961, PT_SCX, ucp_Mahajani }, - { 1966, PT_SC, ucp_Makasar }, - { 1971, PT_SC, ucp_Makasar }, - { 1979, PT_SCX, ucp_Malayalam }, - { 1989, PT_SCX, ucp_Mandaic }, - { 1994, PT_SCX, ucp_Mandaic }, - { 2002, PT_SCX, ucp_Manichaean }, - { 2007, PT_SCX, ucp_Manichaean }, - { 2018, PT_SC, ucp_Marchen }, - { 2023, PT_SC, ucp_Marchen }, - { 2031, PT_SCX, ucp_Masaram_Gondi }, - { 2044, PT_BOOL, ucp_Math }, - { 2049, PT_PC, ucp_Mc }, - { 2052, PT_PC, ucp_Me }, - { 2055, PT_SC, ucp_Medefaidrin }, - { 2067, PT_SC, ucp_Medefaidrin }, - { 2072, PT_SC, ucp_Meetei_Mayek }, - { 2084, PT_SC, ucp_Mende_Kikakui }, - { 2089, PT_SC, ucp_Mende_Kikakui }, - { 2102, PT_SC, ucp_Meroitic_Cursive }, - { 2107, PT_SC, ucp_Meroitic_Hieroglyphs }, - { 2112, PT_SC, ucp_Meroitic_Cursive }, - { 2128, PT_SC, ucp_Meroitic_Hieroglyphs }, - { 2148, PT_SC, ucp_Miao }, - { 2153, PT_SCX, ucp_Malayalam }, - { 2158, PT_PC, ucp_Mn }, - { 2161, PT_SCX, ucp_Modi }, - { 2166, PT_SCX, ucp_Mongolian }, - { 2171, PT_SCX, ucp_Mongolian }, - { 2181, PT_SC, ucp_Mro }, - { 2185, PT_SC, ucp_Mro }, - { 2190, PT_SC, ucp_Meetei_Mayek }, - { 2195, PT_SCX, ucp_Multani }, - { 2200, PT_SCX, ucp_Multani }, - { 2208, PT_SCX, ucp_Myanmar }, - { 2216, PT_SCX, ucp_Myanmar }, - { 2221, PT_GC, ucp_N }, - { 2223, PT_SC, ucp_Nabataean }, - { 2233, PT_SC, ucp_Nag_Mundari }, - { 2238, PT_SC, ucp_Nag_Mundari }, - { 2249, PT_SCX, ucp_Nandinagari }, - { 2254, PT_SCX, ucp_Nandinagari }, - { 2266, PT_SC, ucp_Old_North_Arabian }, - { 2271, PT_SC, ucp_Nabataean }, - { 2276, PT_BOOL, ucp_Noncharacter_Code_Point }, - { 2282, PT_PC, ucp_Nd }, - { 2285, PT_SC, ucp_Newa }, - { 2290, PT_SC, ucp_New_Tai_Lue }, - { 2300, PT_SCX, ucp_Nko }, - { 2304, PT_SCX, ucp_Nko }, - { 2309, PT_PC, ucp_Nl }, - { 2312, PT_PC, ucp_No }, - { 2315, PT_BOOL, ucp_Noncharacter_Code_Point }, - { 2337, PT_SC, ucp_Nushu }, - { 2342, PT_SC, ucp_Nushu }, - { 2348, PT_SC, ucp_Nyiakeng_Puachue_Hmong }, - { 2369, PT_SC, ucp_Ogham }, - { 2374, PT_SC, ucp_Ogham }, - { 2380, PT_SC, ucp_Ol_Chiki }, - { 2388, PT_SC, ucp_Ol_Chiki }, - { 2393, PT_SC, ucp_Old_Hungarian }, - { 2406, PT_SC, ucp_Old_Italic }, - { 2416, PT_SC, ucp_Old_North_Arabian }, - { 2432, PT_SCX, ucp_Old_Permic }, - { 2442, PT_SC, ucp_Old_Persian }, - { 2453, PT_SC, ucp_Old_Sogdian }, - { 2464, PT_SC, ucp_Old_South_Arabian }, - { 2480, PT_SC, ucp_Old_Turkic }, - { 2490, PT_SCX, ucp_Old_Uyghur }, - { 2500, PT_SCX, ucp_Oriya }, - { 2506, PT_SC, ucp_Old_Turkic }, - { 2511, PT_SCX, ucp_Oriya }, - { 2516, PT_SC, ucp_Osage }, - { 2522, PT_SC, ucp_Osage }, - { 2527, PT_SC, ucp_Osmanya }, - { 2532, PT_SC, ucp_Osmanya }, - { 2540, PT_SCX, ucp_Old_Uyghur }, - { 2545, PT_GC, ucp_P }, - { 2547, PT_SC, ucp_Pahawh_Hmong }, - { 2559, PT_SC, ucp_Palmyrene }, - { 2564, PT_SC, ucp_Palmyrene }, - { 2574, PT_BOOL, ucp_Pattern_Syntax }, - { 2581, PT_BOOL, ucp_Pattern_Syntax }, - { 2595, PT_BOOL, ucp_Pattern_White_Space }, - { 2613, PT_BOOL, ucp_Pattern_White_Space }, - { 2619, PT_SC, ucp_Pau_Cin_Hau }, - { 2624, PT_SC, ucp_Pau_Cin_Hau }, - { 2634, PT_PC, ucp_Pc }, - { 2637, PT_BOOL, ucp_Prepended_Concatenation_Mark }, - { 2641, PT_PC, ucp_Pd }, - { 2644, PT_PC, ucp_Pe }, - { 2647, PT_SCX, ucp_Old_Permic }, - { 2652, PT_PC, ucp_Pf }, - { 2655, PT_SCX, ucp_Phags_Pa }, - { 2660, PT_SCX, ucp_Phags_Pa }, - { 2668, PT_SC, ucp_Inscriptional_Pahlavi }, - { 2673, PT_SCX, ucp_Psalter_Pahlavi }, - { 2678, PT_SC, ucp_Phoenician }, - { 2683, PT_SC, ucp_Phoenician }, - { 2694, PT_PC, ucp_Pi }, - { 2697, PT_SC, ucp_Miao }, - { 2702, PT_PC, ucp_Po }, - { 2705, PT_BOOL, ucp_Prepended_Concatenation_Mark }, - { 2732, PT_SC, ucp_Inscriptional_Parthian }, - { 2737, PT_PC, ucp_Ps }, - { 2740, PT_SCX, ucp_Psalter_Pahlavi }, - { 2755, PT_SCX, ucp_Coptic }, - { 2760, PT_SC, ucp_Inherited }, - { 2765, PT_BOOL, ucp_Quotation_Mark }, - { 2771, PT_BOOL, ucp_Quotation_Mark }, - { 2785, PT_BOOL, ucp_Radical }, - { 2793, PT_BOOL, ucp_Regional_Indicator }, - { 2811, PT_SC, ucp_Rejang }, - { 2818, PT_BOOL, ucp_Regional_Indicator }, - { 2821, PT_SC, ucp_Rejang }, - { 2826, PT_SCX, ucp_Hanifi_Rohingya }, - { 2831, PT_SC, ucp_Runic }, - { 2837, PT_SC, ucp_Runic }, - { 2842, PT_GC, ucp_S }, - { 2844, PT_SC, ucp_Samaritan }, - { 2854, PT_SC, ucp_Samaritan }, - { 2859, PT_SC, ucp_Old_South_Arabian }, - { 2864, PT_SC, ucp_Saurashtra }, - { 2869, PT_SC, ucp_Saurashtra }, - { 2880, PT_PC, ucp_Sc }, - { 2883, PT_BOOL, ucp_Soft_Dotted }, - { 2886, PT_BOOL, ucp_Sentence_Terminal }, - { 2903, PT_SC, ucp_SignWriting }, - { 2908, PT_SCX, ucp_Sharada }, - { 2916, PT_SC, ucp_Shavian }, - { 2924, PT_SC, ucp_Shavian }, - { 2929, PT_SCX, ucp_Sharada }, - { 2934, PT_SC, ucp_Siddham }, - { 2939, PT_SC, ucp_Siddham }, - { 2947, PT_SC, ucp_SignWriting }, - { 2959, PT_SCX, ucp_Khudawadi }, - { 2964, PT_SCX, ucp_Sinhala }, - { 2969, PT_SCX, ucp_Sinhala }, - { 2977, PT_PC, ucp_Sk }, - { 2980, PT_PC, ucp_Sm }, - { 2983, PT_PC, ucp_So }, - { 2986, PT_BOOL, ucp_Soft_Dotted }, - { 2997, PT_SCX, ucp_Sogdian }, - { 3002, PT_SCX, ucp_Sogdian }, - { 3010, PT_SC, ucp_Old_Sogdian }, - { 3015, PT_SC, ucp_Sora_Sompeng }, - { 3020, PT_SC, ucp_Sora_Sompeng }, - { 3032, PT_SC, ucp_Soyombo }, - { 3037, PT_SC, ucp_Soyombo }, - { 3045, PT_BOOL, ucp_White_Space }, - { 3051, PT_BOOL, ucp_Sentence_Terminal }, - { 3057, PT_SC, ucp_Sundanese }, - { 3062, PT_SC, ucp_Sundanese }, - { 3072, PT_SCX, ucp_Syloti_Nagri }, - { 3077, PT_SCX, ucp_Syloti_Nagri }, - { 3089, PT_SCX, ucp_Syriac }, - { 3094, PT_SCX, ucp_Syriac }, - { 3101, PT_SCX, ucp_Tagalog }, - { 3109, PT_SCX, ucp_Tagbanwa }, - { 3114, PT_SCX, ucp_Tagbanwa }, - { 3123, PT_SCX, ucp_Tai_Le }, - { 3129, PT_SC, ucp_Tai_Tham }, - { 3137, PT_SC, ucp_Tai_Viet }, - { 3145, PT_SCX, ucp_Takri }, - { 3150, PT_SCX, ucp_Takri }, - { 3156, PT_SCX, ucp_Tai_Le }, - { 3161, PT_SC, ucp_New_Tai_Lue }, - { 3166, PT_SCX, ucp_Tamil }, - { 3172, PT_SCX, ucp_Tamil }, - { 3177, PT_SC, ucp_Tangut }, - { 3182, PT_SC, ucp_Tangsa }, - { 3189, PT_SC, ucp_Tangut }, - { 3196, PT_SC, ucp_Tai_Viet }, - { 3201, PT_SCX, ucp_Telugu }, - { 3206, PT_SCX, ucp_Telugu }, - { 3213, PT_BOOL, ucp_Terminal_Punctuation }, - { 3218, PT_BOOL, ucp_Terminal_Punctuation }, - { 3238, PT_SC, ucp_Tifinagh }, - { 3243, PT_SCX, ucp_Tagalog }, - { 3248, PT_SCX, ucp_Thaana }, - { 3253, PT_SCX, ucp_Thaana }, - { 3260, PT_SC, ucp_Thai }, - { 3265, PT_SC, ucp_Tibetan }, - { 3273, PT_SC, ucp_Tibetan }, - { 3278, PT_SC, ucp_Tifinagh }, - { 3287, PT_SCX, ucp_Tirhuta }, - { 3292, PT_SCX, ucp_Tirhuta }, - { 3300, PT_SC, ucp_Tangsa }, - { 3305, PT_SC, ucp_Toto }, - { 3310, PT_SC, ucp_Ugaritic }, - { 3315, PT_SC, ucp_Ugaritic }, - { 3324, PT_BOOL, ucp_Unified_Ideograph }, - { 3330, PT_BOOL, ucp_Unified_Ideograph }, - { 3347, PT_SC, ucp_Unknown }, - { 3355, PT_BOOL, ucp_Uppercase }, - { 3361, PT_BOOL, ucp_Uppercase }, - { 3371, PT_SC, ucp_Vai }, - { 3375, PT_SC, ucp_Vai }, - { 3380, PT_BOOL, ucp_Variation_Selector }, - { 3398, PT_SC, ucp_Vithkuqi }, - { 3403, PT_SC, ucp_Vithkuqi }, - { 3412, PT_BOOL, ucp_Variation_Selector }, - { 3415, PT_SC, ucp_Wancho }, - { 3422, PT_SC, ucp_Warang_Citi }, - { 3427, PT_SC, ucp_Warang_Citi }, - { 3438, PT_SC, ucp_Wancho }, - { 3443, PT_BOOL, ucp_White_Space }, - { 3454, PT_BOOL, ucp_White_Space }, - { 3461, PT_ALNUM, 0 }, - { 3465, PT_BOOL, ucp_XID_Continue }, - { 3470, PT_BOOL, ucp_XID_Continue }, - { 3482, PT_BOOL, ucp_XID_Start }, - { 3487, PT_BOOL, ucp_XID_Start }, - { 3496, PT_SC, ucp_Old_Persian }, - { 3501, PT_PXSPACE, 0 }, - { 3505, PT_SPACE, 0 }, - { 3509, PT_SC, ucp_Cuneiform }, - { 3514, PT_UCNC, 0 }, - { 3518, PT_WORD, 0 }, - { 3522, PT_SCX, ucp_Yezidi }, - { 3527, PT_SCX, ucp_Yezidi }, - { 3534, PT_SCX, ucp_Yi }, - { 3537, PT_SCX, ucp_Yi }, - { 3542, PT_GC, ucp_Z }, - { 3544, PT_SC, ucp_Zanabazar_Square }, - { 3560, PT_SC, ucp_Zanabazar_Square }, - { 3565, PT_SC, ucp_Inherited }, - { 3570, PT_PC, ucp_Zl }, - { 3573, PT_PC, ucp_Zp }, - { 3576, PT_PC, ucp_Zs }, - { 3579, PT_SC, ucp_Common }, - { 3584, PT_SC, ucp_Unknown } + { 195, PT_SC, ucp_Beria_Erfe }, + { 200, PT_SC, ucp_Beria_Erfe }, + { 210, PT_SC, ucp_Bhaiksuki }, + { 220, PT_SC, ucp_Bhaiksuki }, + { 225, PT_BIDICL, ucp_bidiAL }, + { 232, PT_BIDICL, ucp_bidiAN }, + { 239, PT_BIDICL, ucp_bidiB }, + { 245, PT_BIDICL, ucp_bidiBN }, + { 252, PT_BOOL, ucp_Bidi_Control }, + { 258, PT_BOOL, ucp_Bidi_Control }, + { 270, PT_BIDICL, ucp_bidiCS }, + { 277, PT_BIDICL, ucp_bidiEN }, + { 284, PT_BIDICL, ucp_bidiES }, + { 291, PT_BIDICL, ucp_bidiET }, + { 298, PT_BIDICL, ucp_bidiFSI }, + { 306, PT_BIDICL, ucp_bidiL }, + { 312, PT_BIDICL, ucp_bidiLRE }, + { 320, PT_BIDICL, ucp_bidiLRI }, + { 328, PT_BIDICL, ucp_bidiLRO }, + { 336, PT_BOOL, ucp_Bidi_Mirrored }, + { 342, PT_BOOL, ucp_Bidi_Mirrored }, + { 355, PT_BIDICL, ucp_bidiNSM }, + { 363, PT_BIDICL, ucp_bidiON }, + { 370, PT_BIDICL, ucp_bidiPDF }, + { 378, PT_BIDICL, ucp_bidiPDI }, + { 386, PT_BIDICL, ucp_bidiR }, + { 392, PT_BIDICL, ucp_bidiRLE }, + { 400, PT_BIDICL, ucp_bidiRLI }, + { 408, PT_BIDICL, ucp_bidiRLO }, + { 416, PT_BIDICL, ucp_bidiS }, + { 422, PT_BIDICL, ucp_bidiWS }, + { 429, PT_SCX, ucp_Bopomofo }, + { 434, PT_SCX, ucp_Bopomofo }, + { 443, PT_SC, ucp_Brahmi }, + { 448, PT_SC, ucp_Brahmi }, + { 455, PT_SC, ucp_Braille }, + { 460, PT_SC, ucp_Braille }, + { 468, PT_SCX, ucp_Buginese }, + { 473, PT_SCX, ucp_Buginese }, + { 482, PT_SCX, ucp_Buhid }, + { 487, PT_SCX, ucp_Buhid }, + { 493, PT_GC, ucp_C }, + { 495, PT_SCX, ucp_Chakma }, + { 500, PT_SC, ucp_Canadian_Aboriginal }, + { 519, PT_SC, ucp_Canadian_Aboriginal }, + { 524, PT_SCX, ucp_Carian }, + { 529, PT_SCX, ucp_Carian }, + { 536, PT_BOOL, ucp_Cased }, + { 542, PT_BOOL, ucp_Case_Ignorable }, + { 556, PT_SCX, ucp_Caucasian_Albanian }, + { 574, PT_PC, ucp_Cc }, + { 577, PT_PC, ucp_Cf }, + { 580, PT_SCX, ucp_Chakma }, + { 587, PT_SC, ucp_Cham }, + { 592, PT_BOOL, ucp_Changes_When_Casefolded }, + { 614, PT_BOOL, ucp_Changes_When_Casemapped }, + { 636, PT_BOOL, ucp_Changes_When_Lowercased }, + { 658, PT_BOOL, ucp_Changes_When_Titlecased }, + { 680, PT_BOOL, ucp_Changes_When_Uppercased }, + { 702, PT_SCX, ucp_Cherokee }, + { 707, PT_SCX, ucp_Cherokee }, + { 716, PT_SC, ucp_Chorasmian }, + { 727, PT_SC, ucp_Chorasmian }, + { 732, PT_BOOL, ucp_Case_Ignorable }, + { 735, PT_PC, ucp_Cn }, + { 738, PT_PC, ucp_Co }, + { 741, PT_SC, ucp_Common }, + { 748, PT_SCX, ucp_Coptic }, + { 753, PT_SCX, ucp_Coptic }, + { 760, PT_SCX, ucp_Cypro_Minoan }, + { 765, PT_SCX, ucp_Cypriot }, + { 770, PT_PC, ucp_Cs }, + { 773, PT_SC, ucp_Cuneiform }, + { 783, PT_BOOL, ucp_Changes_When_Casefolded }, + { 788, PT_BOOL, ucp_Changes_When_Casemapped }, + { 793, PT_BOOL, ucp_Changes_When_Lowercased }, + { 797, PT_BOOL, ucp_Changes_When_Titlecased }, + { 801, PT_BOOL, ucp_Changes_When_Uppercased }, + { 805, PT_SCX, ucp_Cypriot }, + { 813, PT_SCX, ucp_Cypro_Minoan }, + { 825, PT_SCX, ucp_Cyrillic }, + { 834, PT_SCX, ucp_Cyrillic }, + { 839, PT_BOOL, ucp_Dash }, + { 844, PT_BOOL, ucp_Default_Ignorable_Code_Point }, + { 870, PT_BOOL, ucp_Deprecated }, + { 874, PT_BOOL, ucp_Deprecated }, + { 885, PT_SC, ucp_Deseret }, + { 893, PT_SCX, ucp_Devanagari }, + { 898, PT_SCX, ucp_Devanagari }, + { 909, PT_BOOL, ucp_Default_Ignorable_Code_Point }, + { 912, PT_BOOL, ucp_Diacritic }, + { 916, PT_BOOL, ucp_Diacritic }, + { 926, PT_SC, ucp_Dives_Akuru }, + { 931, PT_SC, ucp_Dives_Akuru }, + { 942, PT_SCX, ucp_Dogra }, + { 947, PT_SCX, ucp_Dogra }, + { 953, PT_SC, ucp_Deseret }, + { 958, PT_SCX, ucp_Duployan }, + { 963, PT_SCX, ucp_Duployan }, + { 972, PT_BOOL, ucp_Emoji_Modifier_Base }, + { 978, PT_BOOL, ucp_Emoji_Component }, + { 984, PT_SC, ucp_Egyptian_Hieroglyphs }, + { 989, PT_SC, ucp_Egyptian_Hieroglyphs }, + { 1009, PT_SCX, ucp_Elbasan }, + { 1014, PT_SCX, ucp_Elbasan }, + { 1022, PT_SC, ucp_Elymaic }, + { 1027, PT_SC, ucp_Elymaic }, + { 1035, PT_BOOL, ucp_Emoji_Modifier }, + { 1040, PT_BOOL, ucp_Emoji }, + { 1046, PT_BOOL, ucp_Emoji_Component }, + { 1061, PT_BOOL, ucp_Emoji_Modifier }, + { 1075, PT_BOOL, ucp_Emoji_Modifier_Base }, + { 1093, PT_BOOL, ucp_Emoji_Presentation }, + { 1111, PT_BOOL, ucp_Emoji_Presentation }, + { 1117, PT_SCX, ucp_Ethiopic }, + { 1122, PT_SCX, ucp_Ethiopic }, + { 1131, PT_BOOL, ucp_Extender }, + { 1135, PT_BOOL, ucp_Extended_Pictographic }, + { 1156, PT_BOOL, ucp_Extender }, + { 1165, PT_BOOL, ucp_Extended_Pictographic }, + { 1173, PT_SCX, ucp_Garay }, + { 1178, PT_SCX, ucp_Garay }, + { 1184, PT_SCX, ucp_Georgian }, + { 1189, PT_SCX, ucp_Georgian }, + { 1198, PT_SCX, ucp_Glagolitic }, + { 1203, PT_SCX, ucp_Glagolitic }, + { 1214, PT_SCX, ucp_Gunjala_Gondi }, + { 1219, PT_SCX, ucp_Masaram_Gondi }, + { 1224, PT_SCX, ucp_Gothic }, + { 1229, PT_SCX, ucp_Gothic }, + { 1236, PT_SCX, ucp_Grantha }, + { 1241, PT_SCX, ucp_Grantha }, + { 1249, PT_BOOL, ucp_Grapheme_Base }, + { 1262, PT_BOOL, ucp_Grapheme_Extend }, + { 1277, PT_BOOL, ucp_Grapheme_Link }, + { 1290, PT_BOOL, ucp_Grapheme_Base }, + { 1297, PT_SCX, ucp_Greek }, + { 1303, PT_SCX, ucp_Greek }, + { 1308, PT_BOOL, ucp_Grapheme_Extend }, + { 1314, PT_BOOL, ucp_Grapheme_Link }, + { 1321, PT_SCX, ucp_Gujarati }, + { 1330, PT_SCX, ucp_Gujarati }, + { 1335, PT_SCX, ucp_Gurung_Khema }, + { 1340, PT_SCX, ucp_Gunjala_Gondi }, + { 1353, PT_SCX, ucp_Gurmukhi }, + { 1362, PT_SCX, ucp_Gurmukhi }, + { 1367, PT_SCX, ucp_Gurung_Khema }, + { 1379, PT_SCX, ucp_Han }, + { 1383, PT_SCX, ucp_Hangul }, + { 1388, PT_SCX, ucp_Hangul }, + { 1395, PT_SCX, ucp_Han }, + { 1400, PT_SCX, ucp_Hanifi_Rohingya }, + { 1415, PT_SCX, ucp_Hanunoo }, + { 1420, PT_SCX, ucp_Hanunoo }, + { 1428, PT_SC, ucp_Hatran }, + { 1433, PT_SC, ucp_Hatran }, + { 1440, PT_SCX, ucp_Hebrew }, + { 1445, PT_SCX, ucp_Hebrew }, + { 1452, PT_BOOL, ucp_Hex_Digit }, + { 1456, PT_BOOL, ucp_Hex_Digit }, + { 1465, PT_SCX, ucp_Hiragana }, + { 1470, PT_SCX, ucp_Hiragana }, + { 1479, PT_SC, ucp_Anatolian_Hieroglyphs }, + { 1484, PT_SC, ucp_Pahawh_Hmong }, + { 1489, PT_SC, ucp_Nyiakeng_Puachue_Hmong }, + { 1494, PT_SCX, ucp_Old_Hungarian }, + { 1499, PT_BOOL, ucp_ID_Continue }, + { 1503, PT_BOOL, ucp_ID_Compat_Math_Continue }, + { 1524, PT_BOOL, ucp_ID_Compat_Math_Start }, + { 1542, PT_BOOL, ucp_ID_Continue }, + { 1553, PT_BOOL, ucp_Ideographic }, + { 1558, PT_BOOL, ucp_Ideographic }, + { 1570, PT_BOOL, ucp_ID_Start }, + { 1574, PT_BOOL, ucp_IDS_Binary_Operator }, + { 1579, PT_BOOL, ucp_IDS_Binary_Operator }, + { 1597, PT_BOOL, ucp_IDS_Trinary_Operator }, + { 1602, PT_BOOL, ucp_ID_Start }, + { 1610, PT_BOOL, ucp_IDS_Trinary_Operator }, + { 1629, PT_BOOL, ucp_IDS_Unary_Operator }, + { 1634, PT_BOOL, ucp_IDS_Unary_Operator }, + { 1651, PT_SC, ucp_Imperial_Aramaic }, + { 1667, PT_BOOL, ucp_InCB }, + { 1672, PT_SC, ucp_Inherited }, + { 1682, PT_SC, ucp_Inscriptional_Pahlavi }, + { 1703, PT_SC, ucp_Inscriptional_Parthian }, + { 1725, PT_SC, ucp_Old_Italic }, + { 1730, PT_SCX, ucp_Javanese }, + { 1735, PT_SCX, ucp_Javanese }, + { 1744, PT_BOOL, ucp_Join_Control }, + { 1750, PT_BOOL, ucp_Join_Control }, + { 1762, PT_SCX, ucp_Kaithi }, + { 1769, PT_SCX, ucp_Kayah_Li }, + { 1774, PT_SCX, ucp_Katakana }, + { 1779, PT_SCX, ucp_Kannada }, + { 1787, PT_SCX, ucp_Katakana }, + { 1796, PT_SC, ucp_Kawi }, + { 1801, PT_SCX, ucp_Kayah_Li }, + { 1809, PT_SC, ucp_Kharoshthi }, + { 1814, PT_SC, ucp_Kharoshthi }, + { 1825, PT_SC, ucp_Khitan_Small_Script }, + { 1843, PT_SC, ucp_Khmer }, + { 1849, PT_SC, ucp_Khmer }, + { 1854, PT_SCX, ucp_Khojki }, + { 1859, PT_SCX, ucp_Khojki }, + { 1866, PT_SCX, ucp_Khudawadi }, + { 1876, PT_SC, ucp_Kirat_Rai }, + { 1885, PT_SC, ucp_Khitan_Small_Script }, + { 1890, PT_SCX, ucp_Kannada }, + { 1895, PT_SC, ucp_Kirat_Rai }, + { 1900, PT_SCX, ucp_Kaithi }, + { 1905, PT_GC, ucp_L }, + { 1907, PT_LAMP, 0 }, + { 1910, PT_SC, ucp_Tai_Tham }, + { 1915, PT_SC, ucp_Lao }, + { 1919, PT_SC, ucp_Lao }, + { 1924, PT_SCX, ucp_Latin }, + { 1930, PT_SCX, ucp_Latin }, + { 1935, PT_LAMP, 0 }, + { 1938, PT_SC, ucp_Lepcha }, + { 1943, PT_SC, ucp_Lepcha }, + { 1950, PT_SCX, ucp_Limbu }, + { 1955, PT_SCX, ucp_Limbu }, + { 1961, PT_SCX, ucp_Linear_A }, + { 1966, PT_SCX, ucp_Linear_B }, + { 1971, PT_SCX, ucp_Linear_A }, + { 1979, PT_SCX, ucp_Linear_B }, + { 1987, PT_SCX, ucp_Lisu }, + { 1992, PT_PC, ucp_Ll }, + { 1995, PT_PC, ucp_Lm }, + { 1998, PT_PC, ucp_Lo }, + { 2001, PT_BOOL, ucp_Logical_Order_Exception }, + { 2005, PT_BOOL, ucp_Logical_Order_Exception }, + { 2027, PT_BOOL, ucp_Lowercase }, + { 2033, PT_BOOL, ucp_Lowercase }, + { 2043, PT_PC, ucp_Lt }, + { 2046, PT_PC, ucp_Lu }, + { 2049, PT_SCX, ucp_Lycian }, + { 2054, PT_SCX, ucp_Lycian }, + { 2061, PT_SCX, ucp_Lydian }, + { 2066, PT_SCX, ucp_Lydian }, + { 2073, PT_GC, ucp_M }, + { 2075, PT_SCX, ucp_Mahajani }, + { 2084, PT_SCX, ucp_Mahajani }, + { 2089, PT_SC, ucp_Makasar }, + { 2094, PT_SC, ucp_Makasar }, + { 2102, PT_SCX, ucp_Malayalam }, + { 2112, PT_SCX, ucp_Mandaic }, + { 2117, PT_SCX, ucp_Mandaic }, + { 2125, PT_SCX, ucp_Manichaean }, + { 2130, PT_SCX, ucp_Manichaean }, + { 2141, PT_SC, ucp_Marchen }, + { 2146, PT_SC, ucp_Marchen }, + { 2154, PT_SCX, ucp_Masaram_Gondi }, + { 2167, PT_BOOL, ucp_Math }, + { 2172, PT_PC, ucp_Mc }, + { 2175, PT_BOOL, ucp_Modifier_Combining_Mark }, + { 2179, PT_PC, ucp_Me }, + { 2182, PT_SC, ucp_Medefaidrin }, + { 2194, PT_SC, ucp_Medefaidrin }, + { 2199, PT_SC, ucp_Meetei_Mayek }, + { 2211, PT_SC, ucp_Mende_Kikakui }, + { 2216, PT_SC, ucp_Mende_Kikakui }, + { 2229, PT_SC, ucp_Meroitic_Cursive }, + { 2234, PT_SCX, ucp_Meroitic_Hieroglyphs }, + { 2239, PT_SC, ucp_Meroitic_Cursive }, + { 2255, PT_SCX, ucp_Meroitic_Hieroglyphs }, + { 2275, PT_SC, ucp_Miao }, + { 2280, PT_SCX, ucp_Malayalam }, + { 2285, PT_PC, ucp_Mn }, + { 2288, PT_SCX, ucp_Modi }, + { 2293, PT_BOOL, ucp_Modifier_Combining_Mark }, + { 2315, PT_SCX, ucp_Mongolian }, + { 2320, PT_SCX, ucp_Mongolian }, + { 2330, PT_SC, ucp_Mro }, + { 2334, PT_SC, ucp_Mro }, + { 2339, PT_SC, ucp_Meetei_Mayek }, + { 2344, PT_SCX, ucp_Multani }, + { 2349, PT_SCX, ucp_Multani }, + { 2357, PT_SCX, ucp_Myanmar }, + { 2365, PT_SCX, ucp_Myanmar }, + { 2370, PT_GC, ucp_N }, + { 2372, PT_SC, ucp_Nabataean }, + { 2382, PT_SC, ucp_Nag_Mundari }, + { 2387, PT_SC, ucp_Nag_Mundari }, + { 2398, PT_SCX, ucp_Nandinagari }, + { 2403, PT_SCX, ucp_Nandinagari }, + { 2415, PT_SC, ucp_Old_North_Arabian }, + { 2420, PT_SC, ucp_Nabataean }, + { 2425, PT_BOOL, ucp_Noncharacter_Code_Point }, + { 2431, PT_PC, ucp_Nd }, + { 2434, PT_SCX, ucp_Newa }, + { 2439, PT_SC, ucp_New_Tai_Lue }, + { 2449, PT_SCX, ucp_Nko }, + { 2453, PT_SCX, ucp_Nko }, + { 2458, PT_PC, ucp_Nl }, + { 2461, PT_PC, ucp_No }, + { 2464, PT_BOOL, ucp_Noncharacter_Code_Point }, + { 2486, PT_SC, ucp_Nushu }, + { 2491, PT_SC, ucp_Nushu }, + { 2497, PT_SC, ucp_Nyiakeng_Puachue_Hmong }, + { 2518, PT_SC, ucp_Ogham }, + { 2523, PT_SC, ucp_Ogham }, + { 2529, PT_SC, ucp_Ol_Chiki }, + { 2537, PT_SC, ucp_Ol_Chiki }, + { 2542, PT_SCX, ucp_Old_Hungarian }, + { 2555, PT_SC, ucp_Old_Italic }, + { 2565, PT_SC, ucp_Old_North_Arabian }, + { 2581, PT_SCX, ucp_Old_Permic }, + { 2591, PT_SC, ucp_Old_Persian }, + { 2602, PT_SC, ucp_Old_Sogdian }, + { 2613, PT_SC, ucp_Old_South_Arabian }, + { 2629, PT_SCX, ucp_Old_Turkic }, + { 2639, PT_SCX, ucp_Old_Uyghur }, + { 2649, PT_SCX, ucp_Ol_Onal }, + { 2656, PT_SCX, ucp_Ol_Onal }, + { 2661, PT_SCX, ucp_Oriya }, + { 2667, PT_SCX, ucp_Old_Turkic }, + { 2672, PT_SCX, ucp_Oriya }, + { 2677, PT_SCX, ucp_Osage }, + { 2683, PT_SCX, ucp_Osage }, + { 2688, PT_SC, ucp_Osmanya }, + { 2693, PT_SC, ucp_Osmanya }, + { 2701, PT_SCX, ucp_Old_Uyghur }, + { 2706, PT_GC, ucp_P }, + { 2708, PT_SC, ucp_Pahawh_Hmong }, + { 2720, PT_SC, ucp_Palmyrene }, + { 2725, PT_SC, ucp_Palmyrene }, + { 2735, PT_BOOL, ucp_Pattern_Syntax }, + { 2742, PT_BOOL, ucp_Pattern_Syntax }, + { 2756, PT_BOOL, ucp_Pattern_White_Space }, + { 2774, PT_BOOL, ucp_Pattern_White_Space }, + { 2780, PT_SC, ucp_Pau_Cin_Hau }, + { 2785, PT_SC, ucp_Pau_Cin_Hau }, + { 2795, PT_PC, ucp_Pc }, + { 2798, PT_BOOL, ucp_Prepended_Concatenation_Mark }, + { 2802, PT_PC, ucp_Pd }, + { 2805, PT_PC, ucp_Pe }, + { 2808, PT_SCX, ucp_Old_Permic }, + { 2813, PT_PC, ucp_Pf }, + { 2816, PT_SCX, ucp_Phags_Pa }, + { 2821, PT_SCX, ucp_Phags_Pa }, + { 2829, PT_SC, ucp_Inscriptional_Pahlavi }, + { 2834, PT_SCX, ucp_Psalter_Pahlavi }, + { 2839, PT_SC, ucp_Phoenician }, + { 2844, PT_SC, ucp_Phoenician }, + { 2855, PT_PC, ucp_Pi }, + { 2858, PT_SC, ucp_Miao }, + { 2863, PT_PC, ucp_Po }, + { 2866, PT_BOOL, ucp_Prepended_Concatenation_Mark }, + { 2893, PT_SC, ucp_Inscriptional_Parthian }, + { 2898, PT_PC, ucp_Ps }, + { 2901, PT_SCX, ucp_Psalter_Pahlavi }, + { 2916, PT_SCX, ucp_Coptic }, + { 2921, PT_SC, ucp_Inherited }, + { 2926, PT_BOOL, ucp_Quotation_Mark }, + { 2932, PT_BOOL, ucp_Quotation_Mark }, + { 2946, PT_BOOL, ucp_Radical }, + { 2954, PT_BOOL, ucp_Regional_Indicator }, + { 2972, PT_SC, ucp_Rejang }, + { 2979, PT_BOOL, ucp_Regional_Indicator }, + { 2982, PT_SC, ucp_Rejang }, + { 2987, PT_SCX, ucp_Hanifi_Rohingya }, + { 2992, PT_SCX, ucp_Runic }, + { 2998, PT_SCX, ucp_Runic }, + { 3003, PT_GC, ucp_S }, + { 3005, PT_SCX, ucp_Samaritan }, + { 3015, PT_SCX, ucp_Samaritan }, + { 3020, PT_SC, ucp_Old_South_Arabian }, + { 3025, PT_SC, ucp_Saurashtra }, + { 3030, PT_SC, ucp_Saurashtra }, + { 3041, PT_PC, ucp_Sc }, + { 3044, PT_BOOL, ucp_Soft_Dotted }, + { 3047, PT_BOOL, ucp_Sentence_Terminal }, + { 3064, PT_SC, ucp_SignWriting }, + { 3069, PT_SCX, ucp_Sharada }, + { 3077, PT_SCX, ucp_Shavian }, + { 3085, PT_SCX, ucp_Shavian }, + { 3090, PT_SCX, ucp_Sharada }, + { 3095, PT_SC, ucp_Siddham }, + { 3100, PT_SC, ucp_Siddham }, + { 3108, PT_SC, ucp_Sidetic }, + { 3116, PT_SC, ucp_Sidetic }, + { 3121, PT_SC, ucp_SignWriting }, + { 3133, PT_SCX, ucp_Khudawadi }, + { 3138, PT_SCX, ucp_Sinhala }, + { 3143, PT_SCX, ucp_Sinhala }, + { 3151, PT_PC, ucp_Sk }, + { 3154, PT_PC, ucp_Sm }, + { 3157, PT_PC, ucp_So }, + { 3160, PT_BOOL, ucp_Soft_Dotted }, + { 3171, PT_SCX, ucp_Sogdian }, + { 3176, PT_SCX, ucp_Sogdian }, + { 3184, PT_SC, ucp_Old_Sogdian }, + { 3189, PT_SC, ucp_Sora_Sompeng }, + { 3194, PT_SC, ucp_Sora_Sompeng }, + { 3206, PT_SC, ucp_Soyombo }, + { 3211, PT_SC, ucp_Soyombo }, + { 3219, PT_BOOL, ucp_White_Space }, + { 3225, PT_BOOL, ucp_Sentence_Terminal }, + { 3231, PT_SC, ucp_Sundanese }, + { 3236, PT_SC, ucp_Sundanese }, + { 3246, PT_SCX, ucp_Sunuwar }, + { 3251, PT_SCX, ucp_Sunuwar }, + { 3259, PT_SCX, ucp_Syloti_Nagri }, + { 3264, PT_SCX, ucp_Syloti_Nagri }, + { 3276, PT_SCX, ucp_Syriac }, + { 3281, PT_SCX, ucp_Syriac }, + { 3288, PT_SCX, ucp_Tagalog }, + { 3296, PT_SCX, ucp_Tagbanwa }, + { 3301, PT_SCX, ucp_Tagbanwa }, + { 3310, PT_SCX, ucp_Tai_Le }, + { 3316, PT_SC, ucp_Tai_Tham }, + { 3324, PT_SC, ucp_Tai_Viet }, + { 3332, PT_SC, ucp_Tai_Yo }, + { 3338, PT_SCX, ucp_Takri }, + { 3343, PT_SCX, ucp_Takri }, + { 3349, PT_SCX, ucp_Tai_Le }, + { 3354, PT_SC, ucp_New_Tai_Lue }, + { 3359, PT_SCX, ucp_Tamil }, + { 3365, PT_SCX, ucp_Tamil }, + { 3370, PT_SCX, ucp_Tangut }, + { 3375, PT_SC, ucp_Tangsa }, + { 3382, PT_SCX, ucp_Tangut }, + { 3389, PT_SC, ucp_Tai_Viet }, + { 3394, PT_SC, ucp_Tai_Yo }, + { 3399, PT_SCX, ucp_Telugu }, + { 3404, PT_SCX, ucp_Telugu }, + { 3411, PT_BOOL, ucp_Terminal_Punctuation }, + { 3416, PT_BOOL, ucp_Terminal_Punctuation }, + { 3436, PT_SCX, ucp_Tifinagh }, + { 3441, PT_SCX, ucp_Tagalog }, + { 3446, PT_SCX, ucp_Thaana }, + { 3451, PT_SCX, ucp_Thaana }, + { 3458, PT_SCX, ucp_Thai }, + { 3463, PT_SCX, ucp_Tibetan }, + { 3471, PT_SCX, ucp_Tibetan }, + { 3476, PT_SCX, ucp_Tifinagh }, + { 3485, PT_SCX, ucp_Tirhuta }, + { 3490, PT_SCX, ucp_Tirhuta }, + { 3498, PT_SC, ucp_Tangsa }, + { 3503, PT_SCX, ucp_Todhri }, + { 3510, PT_SCX, ucp_Todhri }, + { 3515, PT_SC, ucp_Tolong_Siki }, + { 3526, PT_SC, ucp_Tolong_Siki }, + { 3531, PT_SCX, ucp_Toto }, + { 3536, PT_SCX, ucp_Tulu_Tigalari }, + { 3549, PT_SCX, ucp_Tulu_Tigalari }, + { 3554, PT_SC, ucp_Ugaritic }, + { 3559, PT_SC, ucp_Ugaritic }, + { 3568, PT_BOOL, ucp_Unified_Ideograph }, + { 3574, PT_BOOL, ucp_Unified_Ideograph }, + { 3591, PT_SC, ucp_Unknown }, + { 3599, PT_BOOL, ucp_Uppercase }, + { 3605, PT_BOOL, ucp_Uppercase }, + { 3615, PT_SC, ucp_Vai }, + { 3619, PT_SC, ucp_Vai }, + { 3624, PT_BOOL, ucp_Variation_Selector }, + { 3642, PT_SC, ucp_Vithkuqi }, + { 3647, PT_SC, ucp_Vithkuqi }, + { 3656, PT_BOOL, ucp_Variation_Selector }, + { 3659, PT_SC, ucp_Wancho }, + { 3666, PT_SC, ucp_Warang_Citi }, + { 3671, PT_SC, ucp_Warang_Citi }, + { 3682, PT_SC, ucp_Wancho }, + { 3687, PT_BOOL, ucp_White_Space }, + { 3698, PT_BOOL, ucp_White_Space }, + { 3705, PT_ALNUM, 0 }, + { 3709, PT_BOOL, ucp_XID_Continue }, + { 3714, PT_BOOL, ucp_XID_Continue }, + { 3726, PT_BOOL, ucp_XID_Start }, + { 3731, PT_BOOL, ucp_XID_Start }, + { 3740, PT_SC, ucp_Old_Persian }, + { 3745, PT_PXSPACE, 0 }, + { 3749, PT_SPACE, 0 }, + { 3753, PT_SC, ucp_Cuneiform }, + { 3758, PT_UCNC, 0 }, + { 3762, PT_WORD, 0 }, + { 3766, PT_SCX, ucp_Yezidi }, + { 3771, PT_SCX, ucp_Yezidi }, + { 3778, PT_SCX, ucp_Yi }, + { 3781, PT_SCX, ucp_Yi }, + { 3786, PT_GC, ucp_Z }, + { 3788, PT_SC, ucp_Zanabazar_Square }, + { 3804, PT_SC, ucp_Zanabazar_Square }, + { 3809, PT_SC, ucp_Inherited }, + { 3814, PT_PC, ucp_Zl }, + { 3817, PT_PC, ucp_Zp }, + { 3820, PT_PC, ucp_Zs }, + { 3823, PT_SC, ucp_Common }, + { 3828, PT_SC, ucp_Unknown } }; const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table); #endif /* SUPPORT_UNICODE */ -/* End of pcre2_ucptables.c */ +/* End of pcre2_ucptables_inc.h */ diff --git a/std/regex/pcre2/pcre2_util.h b/std/regex/pcre2/pcre2_util.h new file mode 100644 index 000000000..7bfbee099 --- /dev/null +++ b/std/regex/pcre2/pcre2_util.h @@ -0,0 +1,179 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* 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. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge + +----------------------------------------------------------------------------- +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 its + 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. +----------------------------------------------------------------------------- +*/ + +#ifndef PCRE2_UTIL_H_IDEMPOTENT_GUARD +#define PCRE2_UTIL_H_IDEMPOTENT_GUARD + +/* Assertion macros */ + +#ifdef PCRE2_DEBUG + +#if defined(HAVE_ASSERT_H) && !defined(NDEBUG) +#include +#endif + +/* PCRE2_ASSERT(x) can be used to inject an assert() for conditions +that the code below doesn't support. It is a NOP for non debug builds +but in debug builds will print information about the location of the +code where it triggered and crash. + +It is meant to work like assert(), and therefore the expression used +should indicate what the expected state is, and shouldn't have any +side-effects. */ + +#if defined(HAVE_ASSERT_H) && !defined(NDEBUG) +#define PCRE2_ASSERT(x) assert(x) +#else +#define PCRE2_ASSERT(x) do \ +{ \ + if (!(x)) \ + { \ + fprintf(stderr, "Assertion failed at " __FILE__ ":%d\n", __LINE__); \ + abort(); \ + } \ +} while(0) +#endif + +/* LCOV_EXCL_START */ + +/* PCRE2_UNREACHABLE() can be used to mark locations on the code that +shouldn't be reached. In non debug builds is defined as a hint for +the compiler to eliminate any code after it, so it is useful also for +performance reasons, but should be used with care because if it is +ever reached will trigger Undefined Behaviour and if you are lucky a +crash. In debug builds it will report the location where it was triggered +and crash. One important point to consider when using this macro, is +that it is only implemented for a few compilers, and therefore can't +be relied on to always be active either, so if it is followed by some +code it is important to make sure that the whole thing is safe to +use even if the macro is not there (ex: make sure there is a `break` +after it if used at the end of a `case`) and to test your code also +with a configuration where the macro will be a NOP. */ + +#if defined(HAVE_ASSERT_H) && !defined(NDEBUG) +#define PCRE2_UNREACHABLE() \ +assert(((void)"Execution reached unexpected point", 0)) +#else +#define PCRE2_UNREACHABLE() do \ +{ \ +fprintf(stderr, "Execution reached unexpected point at " __FILE__ \ + ":%d\n", __LINE__); \ +abort(); \ +} while(0) +#endif + +/* PCRE2_DEBUG_UNREACHABLE() is a debug only version of the previous +macro. It is meant to be used in places where the code is handling +an error situation in code that shouldn't be reached, but that has +some sort of fallback code to normally handle the error. When in +doubt you should use this instead of the previous macro. Like in +the previous case, it is a good idea to document as much as possible +the reason and the actions that should be taken if it ever triggers. */ + +#define PCRE2_DEBUG_UNREACHABLE() PCRE2_UNREACHABLE() + +/* LCOV_EXCL_STOP */ + +#endif /* PCRE2_DEBUG */ + +#ifndef PCRE2_ASSERT +#define PCRE2_ASSERT(x) do {} while(0) +#endif + +/* LCOV_EXCL_START */ + +#ifndef PCRE2_DEBUG_UNREACHABLE +#define PCRE2_DEBUG_UNREACHABLE() do {} while(0) +#endif + +#ifndef PCRE2_UNREACHABLE +#ifdef HAVE_BUILTIN_UNREACHABLE +#define PCRE2_UNREACHABLE() __builtin_unreachable() +#elif defined(HAVE_BUILTIN_ASSUME) +#define PCRE2_UNREACHABLE() __assume(0) +#else +#define PCRE2_UNREACHABLE() do {} while(0) +#endif +#endif /* !PCRE2_UNREACHABLE */ + +/* LCOV_EXCL_STOP */ + +/* We define this fallthrough macro for suppressing -Wimplicit-fallthrough warnings. +Clang only allows this via an attribute, whereas other compilers (eg. GCC) match attributes +and also specially-formatted comments. + +This macro should be used with no following semicolon, and ideally with a comment: */ + +// PCRE2_FALLTHROUGH /* Fall through */ + +#ifndef PCRE2_FALLTHROUGH + +#if defined(__cplusplus) && __cplusplus >= 202002L && \ + defined(__has_cpp_attribute) +/* Standards-compatible C++ variant. */ +#if __has_cpp_attribute(fallthrough) +#define PCRE2_FALLTHROUGH [[fallthrough]]; +#endif +#elif !defined(__cplusplus) && \ + defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L && \ + defined(__has_c_attribute) +/* Standards-compatible C variant. */ +#if __has_c_attribute(fallthrough) +#define PCRE2_FALLTHROUGH [[fallthrough]]; +#endif +#elif ((defined(__clang__) && __clang_major__ >= 10) || \ + (defined(__GNUC__) && __GNUC__ >= 7)) && \ + defined(__has_attribute) +/* Clang and GCC syntax. Rule out old versions because apparently Clang at + least has a broken implementation of __has_attribute. */ +#if __has_attribute(fallthrough) +#define PCRE2_FALLTHROUGH __attribute__((fallthrough)); +#endif +#endif + +#endif /* !PCRE2_FALLTHROUGH */ + +#ifndef PCRE2_FALLTHROUGH +#define PCRE2_FALLTHROUGH +#endif + +#endif /* PCRE2_UTIL_H_IDEMPOTENT_GUARD */ + +/* End of pcre2_util.h */ diff --git a/std/regex/pcre2/pcre2_valid_utf.c b/std/regex/pcre2/pcre2_valid_utf.c index de411b919..3fac931ea 100644 --- a/std/regex/pcre2/pcre2_valid_utf.c +++ b/std/regex/pcre2/pcre2_valid_utf.c @@ -44,14 +44,13 @@ strings. This file is also #included by the pcre2test program, which uses macros to change names from _pcre2_xxx to xxxx, thereby avoiding name clashes with the library. In this case, PCRE2_PCRE2TEST is defined. */ + #ifndef PCRE2_PCRE2TEST /* We're compiling the library */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "pcre2_internal.h" #endif /* PCRE2_PCRE2TEST */ + #ifndef SUPPORT_UNICODE /************************************************* * Dummy function when Unicode is not supported * diff --git a/std/regex/pcre2/pcre2_xclass.c b/std/regex/pcre2/pcre2_xclass.c index 5df25d2c8..7bcae34e0 100644 --- a/std/regex/pcre2/pcre2_xclass.c +++ b/std/regex/pcre2/pcre2_xclass.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2023 University of Cambridge + New API code Copyright (c) 2016-2024 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -38,18 +38,16 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ -/* This module contains an internal function that is used to match an extended -class. It is used by pcre2_auto_possessify() and by both pcre2_match() and -pcre2_def_match(). */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +/* This module contains two internal functions that are used to match +OP_XCLASS and OP_ECLASS. It is used by pcre2_auto_possessify() and by both +pcre2_match() and pcre2_dfa_match(). */ #include "pcre2_internal.h" + + /************************************************* * Match character against an XCLASS * *************************************************/ @@ -66,114 +64,75 @@ Returns: TRUE if character matches, else FALSE */ BOOL -PRIV(xclass)(uint32_t c, PCRE2_SPTR data, BOOL utf) +PRIV(xclass)(uint32_t c, PCRE2_SPTR data, const uint8_t *char_lists_end, BOOL utf) { +/* Update PRIV(update_classbits) when this function is changed. */ PCRE2_UCHAR t; -BOOL negated = (*data & XCL_NOT) != 0; +BOOL not_negated = (*data & XCL_NOT) == 0; +uint32_t type, max_index, min_index, value; +const uint8_t *next_char; #if PCRE2_CODE_UNIT_WIDTH == 8 /* In 8 bit mode, this must always be TRUE. Help the compiler to know that. */ utf = TRUE; #endif -/* Code points < 256 are matched against a bitmap, if one is present. If not, -we still carry on, because there may be ranges that start below 256 in the -additional data. */ +/* Code points < 256 are matched against a bitmap, if one is present. */ -if (c < 256) +if ((*data++ & XCL_MAP) != 0) { - if ((*data & XCL_HASPROP) == 0) - { - if ((*data & XCL_MAP) == 0) return negated; - return (((uint8_t *)(data + 1))[c/8] & (1u << (c&7))) != 0; - } - if ((*data & XCL_MAP) != 0 && - (((uint8_t *)(data + 1))[c/8] & (1u << (c&7))) != 0) - return !negated; /* char found */ + if (c < 256) + return (((const uint8_t *)data)[c/8] & (1u << (c&7))) != 0; + /* Skip bitmap. */ + data += 32 / sizeof(PCRE2_UCHAR); } -/* First skip the bit map if present. Then match against the list of Unicode -properties or large chars or ranges that end with a large char. We won't ever +/* Match against the list of Unicode properties. We won't ever encounter XCL_PROP or XCL_NOTPROP when UTF support is not compiled. */ - -if ((*data++ & XCL_MAP) != 0) data += 32 / sizeof(PCRE2_UCHAR); - -while ((t = *data++) != XCL_END) - { - uint32_t x, y; - if (t == XCL_SINGLE) - { -#ifdef SUPPORT_UNICODE - if (utf) - { - GETCHARINC(x, data); /* macro generates multiple statements */ - } - else -#endif - x = *data++; - if (c == x) return !negated; - } - else if (t == XCL_RANGE) - { #ifdef SUPPORT_UNICODE - if (utf) - { - GETCHARINC(x, data); /* macro generates multiple statements */ - GETCHARINC(y, data); /* macro generates multiple statements */ - } - else -#endif - { - x = *data++; - y = *data++; - } - if (c >= x && c <= y) return !negated; - } +if (*data == XCL_PROP || *data == XCL_NOTPROP) + { + /* The UCD record is the same for all properties. */ + const ucd_record *prop = GET_UCD(c); -#ifdef SUPPORT_UNICODE - else /* XCL_PROP & XCL_NOTPROP */ + do { int chartype; - const ucd_record *prop = GET_UCD(c); - BOOL isprop = t == XCL_PROP; + BOOL isprop = (*data++) == XCL_PROP; BOOL ok; switch(*data) { - case PT_ANY: - if (isprop) return !negated; - break; - case PT_LAMP: chartype = prop->chartype; if ((chartype == ucp_Lu || chartype == ucp_Ll || - chartype == ucp_Lt) == isprop) return !negated; + chartype == ucp_Lt) == isprop) return not_negated; break; case PT_GC: if ((data[1] == PRIV(ucp_gentype)[prop->chartype]) == isprop) - return !negated; + return not_negated; break; case PT_PC: - if ((data[1] == prop->chartype) == isprop) return !negated; + if ((data[1] == prop->chartype) == isprop) return not_negated; break; case PT_SC: - if ((data[1] == prop->script) == isprop) return !negated; + if ((data[1] == prop->script) == isprop) return not_negated; break; case PT_SCX: ok = (data[1] == prop->script || MAPBIT(PRIV(ucd_script_sets) + UCD_SCRIPTX_PROP(prop), data[1]) != 0); - if (ok == isprop) return !negated; + if (ok == isprop) return not_negated; break; case PT_ALNUM: chartype = prop->chartype; if ((PRIV(ucp_gentype)[chartype] == ucp_L || PRIV(ucp_gentype)[chartype] == ucp_N) == isprop) - return !negated; + return not_negated; break; /* Perl space used to exclude VT, but from Perl 5.18 it is included, @@ -186,12 +145,12 @@ while ((t = *data++) != XCL_END) { HSPACE_CASES: VSPACE_CASES: - if (isprop) return !negated; + if (isprop) return not_negated; break; default: if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z) == isprop) - return !negated; + return not_negated; break; } break; @@ -201,7 +160,7 @@ while ((t = *data++) != XCL_END) if ((PRIV(ucp_gentype)[chartype] == ucp_L || PRIV(ucp_gentype)[chartype] == ucp_N || chartype == ucp_Mn || chartype == ucp_Pc) == isprop) - return !negated; + return not_negated; break; case PT_UCNC: @@ -209,24 +168,24 @@ while ((t = *data++) != XCL_END) { if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT || c == CHAR_GRAVE_ACCENT) == isprop) - return !negated; + return not_negated; } else { if ((c < 0xd800 || c > 0xdfff) == isprop) - return !negated; + return not_negated; } break; case PT_BIDICL: if ((UCD_BIDICLASS_PROP(prop) == data[1]) == isprop) - return !negated; + return not_negated; break; case PT_BOOL: ok = MAPBIT(PRIV(ucd_boolprop_sets) + UCD_BPROPS_PROP(prop), data[1]) != 0; - if (ok == isprop) return !negated; + if (ok == isprop) return not_negated; break; /* The following three properties can occur only in an XCLASS, as there @@ -248,7 +207,7 @@ while ((t = *data++) != XCL_END) (chartype == ucp_Cf && c != 0x061c && c != 0x180e && (c < 0x2066 || c > 0x2069)) )) == isprop) - return !negated; + return not_negated; break; /* Printable character: same as graphic, with the addition of Zs, i.e. @@ -262,7 +221,7 @@ while ((t = *data++) != XCL_END) (chartype == ucp_Cf && c != 0x061c && (c < 0x2066 || c > 0x2069)) )) == isprop) - return !negated; + return not_negated; break; /* Punctuation: all Unicode punctuation, plus ASCII characters that @@ -273,7 +232,7 @@ while ((t = *data++) != XCL_END) chartype = prop->chartype; if ((PRIV(ucp_gentype)[chartype] == ucp_P || (c < 128 && PRIV(ucp_gentype)[chartype] == ucp_S)) == isprop) - return !negated; + return not_negated; break; /* Perl has two sets of hex digits */ @@ -285,24 +244,304 @@ while ((t = *data++) != XCL_END) (c >= 0xff10 && c <= 0xff19) || /* Fullwidth digits */ (c >= 0xff21 && c <= 0xff26) || /* Fullwidth letters */ (c >= 0xff41 && c <= 0xff46)) == isprop) - return !negated; + return not_negated; break; /* This should never occur, but compilers may mutter if there is no default. */ + /* LCOV_EXCL_START */ default: + PCRE2_DEBUG_UNREACHABLE(); return FALSE; + /* LCOV_EXCL_STOP */ } data += 2; } + while (*data == XCL_PROP || *data == XCL_NOTPROP); + } #else (void)utf; /* Avoid compiler warning */ #endif /* SUPPORT_UNICODE */ + +/* Match against large chars or ranges that end with a large char. */ +if (*data < XCL_LIST) + { + while ((t = *data++) != XCL_END) + { + uint32_t x, y; + +#ifdef SUPPORT_UNICODE + if (utf) + { + GETCHARINC(x, data); /* macro generates multiple statements */ + } + else +#endif + x = *data++; + + if (t == XCL_SINGLE) + { + /* Since character ranges follow the properties, and they are + sorted, early return is possible for all characters <= x. */ + if (c <= x) return (c == x) ? not_negated : !not_negated; + continue; + } + + PCRE2_ASSERT(t == XCL_RANGE); +#ifdef SUPPORT_UNICODE + if (utf) + { + GETCHARINC(y, data); /* macro generates multiple statements */ + } + else +#endif + y = *data++; + + /* Since character ranges follow the properties, and they are + sorted, early return is possible for all characters <= y. */ + if (c <= y) return (c >= x) ? not_negated : !not_negated; + } + + return !not_negated; /* char did not match */ + } + +#if PCRE2_CODE_UNIT_WIDTH == 8 +type = (uint32_t)(data[0] << 8) | data[1]; +data += 2; +#else +type = data[0]; +data++; +#endif /* CODE_UNIT_WIDTH */ + +/* Align characters. */ +next_char = char_lists_end - (GET(data, 0) << 1); +type &= XCL_TYPE_MASK; + +/* Alignment check. */ +PCRE2_ASSERT(((uintptr_t)next_char & 0x1) == 0); + +if (c >= XCL_CHAR_LIST_HIGH_16_START) + { + max_index = type & XCL_ITEM_COUNT_MASK; + if (max_index == XCL_ITEM_COUNT_MASK) + { + max_index = *(const uint16_t*)next_char; + PCRE2_ASSERT(max_index >= XCL_ITEM_COUNT_MASK); + next_char += 2; + } + + next_char += max_index << 1; + type >>= XCL_TYPE_BIT_LEN; } -return negated; /* char did not match */ +if (c < XCL_CHAR_LIST_LOW_32_START) + { + max_index = type & XCL_ITEM_COUNT_MASK; + + c = (uint16_t)((c << XCL_CHAR_SHIFT) | XCL_CHAR_END); + + if (max_index == XCL_ITEM_COUNT_MASK) + { + max_index = *(const uint16_t*)next_char; + PCRE2_ASSERT(max_index >= XCL_ITEM_COUNT_MASK); + next_char += 2; + } + + if (max_index == 0 || c < *(const uint16_t*)next_char) + return ((type & XCL_BEGIN_WITH_RANGE) != 0) == not_negated; + + min_index = 0; + value = ((const uint16_t*)next_char)[--max_index]; + if (c >= value) + return (value == c || (value & XCL_CHAR_END) == 0) == not_negated; + + max_index--; + + /* Binary search of a range. */ + while (TRUE) + { + uint32_t mid_index = (min_index + max_index) >> 1; + value = ((const uint16_t*)next_char)[mid_index]; + + if (c < value) + max_index = mid_index - 1; + else if (((const uint16_t*)next_char)[mid_index + 1] <= c) + min_index = mid_index + 1; + else + return (value == c || (value & XCL_CHAR_END) == 0) == not_negated; + } + } + +/* Skip the 16 bit ranges. */ +max_index = type & XCL_ITEM_COUNT_MASK; +if (max_index == XCL_ITEM_COUNT_MASK) + { + max_index = *(const uint16_t*)next_char; + PCRE2_ASSERT(max_index >= XCL_ITEM_COUNT_MASK); + next_char += 2; + } + +next_char += (max_index << 1); +type >>= XCL_TYPE_BIT_LEN; + +/* Alignment check. */ +PCRE2_ASSERT(((uintptr_t)next_char & 0x3) == 0); + +max_index = type & XCL_ITEM_COUNT_MASK; + +#if PCRE2_CODE_UNIT_WIDTH == 32 +if (c >= XCL_CHAR_LIST_HIGH_32_START) + { + if (max_index == XCL_ITEM_COUNT_MASK) + { + max_index = *(const uint32_t*)next_char; + PCRE2_ASSERT(max_index >= XCL_ITEM_COUNT_MASK); + next_char += 4; + } + + next_char += max_index << 2; + type >>= XCL_TYPE_BIT_LEN; + max_index = type & XCL_ITEM_COUNT_MASK; + } +#endif + +c = (uint32_t)((c << XCL_CHAR_SHIFT) | XCL_CHAR_END); + +if (max_index == XCL_ITEM_COUNT_MASK) + { + max_index = *(const uint32_t*)next_char; + next_char += 4; + } + +if (max_index == 0 || c < *(const uint32_t*)next_char) + return ((type & XCL_BEGIN_WITH_RANGE) != 0) == not_negated; + +min_index = 0; +value = ((const uint32_t*)next_char)[--max_index]; +if (c >= value) + return (value == c || (value & XCL_CHAR_END) == 0) == not_negated; + +max_index--; + +/* Binary search of a range. */ +while (TRUE) + { + uint32_t mid_index = (min_index + max_index) >> 1; + value = ((const uint32_t*)next_char)[mid_index]; + + if (c < value) + max_index = mid_index - 1; + else if (((const uint32_t*)next_char)[mid_index + 1] <= c) + min_index = mid_index + 1; + else + return (value == c || (value & XCL_CHAR_END) == 0) == not_negated; + } +} + + + +/************************************************* +* Match character against an ECLASS * +*************************************************/ + +/* This function is called to match a character against an extended class +used for describing characters using boolean operations on sets. + +Arguments: + c the character + data_start points to the start of the ECLASS data + data_end points one-past-the-last of the ECLASS data + utf TRUE if in UTF mode + +Returns: TRUE if character matches, else FALSE +*/ + +BOOL +PRIV(eclass)(uint32_t c, PCRE2_SPTR data_start, PCRE2_SPTR data_end, + const uint8_t *char_lists_end, BOOL utf) +{ +PCRE2_SPTR ptr = data_start; +PCRE2_UCHAR flags; +uint32_t stack = 0; +int stack_depth = 0; + +PCRE2_ASSERT(data_start < data_end); +flags = *ptr++; +PCRE2_ASSERT((flags & ECL_MAP) == 0 || + (data_end - ptr) >= 32 / (int)sizeof(PCRE2_UCHAR)); + +/* Code points < 256 are matched against a bitmap, if one is present. +Otherwise all codepoints are checked later. */ + +if ((flags & ECL_MAP) != 0) + { + if (c < 256) + return (((const uint8_t *)ptr)[c/8] & (1u << (c&7))) != 0; + + /* Skip the bitmap. */ + ptr += 32 / sizeof(PCRE2_UCHAR); + } + +/* Do a little loop, until we reach the end of the ECLASS. */ +while (ptr < data_end) + { + switch (*ptr) + { + case ECL_AND: + ++ptr; + stack = (stack >> 1) & (stack | ~(uint32_t)1u); + PCRE2_ASSERT(stack_depth >= 2); + --stack_depth; + break; + + case ECL_OR: + ++ptr; + stack = (stack >> 1) | (stack & (uint32_t)1u); + PCRE2_ASSERT(stack_depth >= 2); + --stack_depth; + break; + + case ECL_XOR: + ++ptr; + stack = (stack >> 1) ^ (stack & (uint32_t)1u); + PCRE2_ASSERT(stack_depth >= 2); + --stack_depth; + break; + + case ECL_NOT: + ++ptr; + stack ^= (uint32_t)1u; + PCRE2_ASSERT(stack_depth >= 1); + break; + + case ECL_XCLASS: + { + uint32_t matched = PRIV(xclass)(c, ptr + 1 + LINK_SIZE, char_lists_end, utf); + + ptr += GET(ptr, 1); + stack = (stack << 1) | matched; + ++stack_depth; + break; + } + + /* This should never occur, but compilers may mutter if there is no + default. */ + + /* LCOV_EXCL_START */ + default: + PCRE2_DEBUG_UNREACHABLE(); + return FALSE; + /* LCOV_EXCL_STOP */ + } + } + +PCRE2_ASSERT(stack_depth == 1); +(void)stack_depth; /* Ignore unused variable, if assertions are disabled. */ + +/* The final bit left on the stack now holds the match result. */ +return (stack & 1u) != 0; } /* End of pcre2_xclass.c */