Commit graph

44 commits

Author SHA1 Message Date
Niklas Keller
f8b217a345
Fix pcre.jit on Apple Silicon
This backports https://github.com/zherczeg/sljit/pull/105. Relates to bug #80435, however, it doesn't solve the bus error on PHP 8.0, but PHP 8.1 builds fine now.

Closes GH-9279.
2022-08-31 14:22:44 +02:00
Christoph M. Becker
6008a75f39
Update to PCRE2 10.39
We also apply an respective upstream fix[1].

[1] <d144199dfb>

Closes GH-7678.
2021-11-25 18:38:31 +01:00
Christoph M. Becker
5356d06990
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81424: PCRE2 10.35 JIT performance regression
2021-10-12 14:22:52 +02:00
Christoph M. Becker
845a67feb5
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81424: PCRE2 10.35 JIT performance regression
2021-10-12 14:21:09 +02:00
Christoph M. Becker
788a701e22
Fix #81424: PCRE2 10.35 JIT performance regression
We backport the respective upstream fix[1] to our bundled pcre2lib plus
the follow-up fix[2] for a functional regression.

[1] <dc5f966635>
[2] <e7af7efaa1>

Closes GH-7573.
2021-10-12 14:19:22 +02:00
Christoph M. Becker
34cd6cbfe0
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Revert "Fix #81424: PCRE2 10.35 JIT performance regression"
2021-10-05 11:52:32 +02:00
Christoph M. Becker
9523542733
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Revert "Fix #81424: PCRE2 10.35 JIT performance regression"
2021-10-05 11:50:31 +02:00
Christoph M. Becker
a19f655b84
Revert "Fix #81424: PCRE2 10.35 JIT performance regression"
This reverts commit a2471383fe.

Fixing the performance regression, apparently fixes a functional
regression[1], so we revert for now.

[1] <https://github.com/PhilipHazel/pcre2/issues/21>

Closes GH-7556.
2021-10-05 11:49:04 +02:00
Christoph M. Becker
311b1de649
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81424: PCRE2 10.35 JIT performance regression
2021-09-13 14:38:37 +02:00
Christoph M. Becker
12e79ddae4
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81424: PCRE2 10.35 JIT performance regression
2021-09-13 14:35:49 +02:00
Christoph M. Becker
a2471383fe
Fix #81424: PCRE2 10.35 JIT performance regression
We backport the respective upstream fix[1] to our bundled pcre2lib.

[1] <dc5f966635>

Closes GH-7484.
2021-09-13 14:34:13 +02:00
Anatol Belski
cfec7a4131
pcre: Apply upstream patch for bug #81101 to bundled libpcre
Signed-off-by: Anatol Belski <ab@php.net>
2021-06-06 19:37:55 +02:00
Anatol Belski
79755cad96
pcre2lib: Fix wrong check-in
Signed-off-by: Anatol Belski <ab@php.net>
2021-05-29 15:11:09 +02:00
Anatol Belski
5d4290088e
pcre2lib: Pull PCRE2 10.37
Excerpt from the release news:

Version 10.37 26-May-2021
-------------------------

A few more bug fixes and tidies. The only change of real note is the removal of
the actual POSIX names regcomp etc. from the POSIX wrapper library because
these have caused issues for some applications (see 10.33 #2 below).

Version 10.36 04-December-2020
------------------------------

Again, mainly bug fixes and tidies. The only enhancements are the addition of
GNU grep's -m (aka --max-count) option to pcre2grep, and also unifying the
handling of substitution strings for both -O and callouts in pcre2grep, with
the addition of $x{...} and $o{...} to allow for characters whose code points
are greater than 255 in Unicode mode.

NOTE: there is an outstanding issue with JIT support for MacOS on arm64
hardware. For details, please see Bugzilla issue #2618.

Signed-off-by: Anatol Belski <ab@php.net>
2021-05-29 14:52:27 +02:00
Christoph M. Becker
48e9181519 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #80118: Erroneous whitespace match with JIT only
2020-09-21 10:29:36 +02:00
Christoph M. Becker
d27dc5c028 Fix #80118: Erroneous whitespace match with JIT only
We backport r1273[1] from PCRE2.

[1] <https://vcs.pcre.org/pcre2?revision=1273&view=revision>

Closes GH-6165.
2020-09-21 10:28:22 +02:00
Christoph M. Becker
9f2d03952d Update to PCRE2 10.35
We also backport the fix for bug #79846, and add a test case for the
related bug #79363.
2020-09-17 14:07:05 +02:00
Christoph M. Becker
4659c12ae0 Fix #79846: 8c67c16699 broke simple regexp
We backport the respective upstream fix[1].

[1] <https://vcs.pcre.org/pcre2?view=revision&revision=1267>
2020-07-16 18:32:26 +02:00
Christoph M. Becker
8c67c16699 Update to PCRE2 10.35
We also port a fix for the build system regarding the `-fcf-protection`
gcc flag; cf. <https://bugs.exim.org/show_bug.cgi?id=2578>.
2020-07-02 12:15:04 +02:00
Nikita Popov
e2a407c2fe Revert "Update to PCRE2 10.35"
This reverts commit b419f96c62.

This breaks the GCC build with -fcf-protection (default on Ubuntu
at least).
2020-06-30 18:24:48 +02:00
Christoph M. Becker
b419f96c62 Update to PCRE2 10.35 2020-06-30 16:19:02 +02:00
George Peter Banyard
d50b076fa3 Fix [-Wundef] warning in PCRE extension 2020-05-20 14:01:10 +02:00
Christoph M. Becker
225117af71 Upgrade to PCRE2 10.34
We backport the slightly modified variant from master.
2020-04-22 14:23:26 +02:00
Sebastian Pop
ee87e86d0a inline by hand to avoid uninitialized variable warning
When compiling with "-Wall -Werror" gcc emits two errors:

../src/pcre2_jit_neon_inc.h:211:8: error: ‘cmp1b’ is used uninitialized in this function [-Werror=uninitialized]
  211 | data = fast_forward_char_pair_compare(compare1_type, data, cmp1a, cmp1b);
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/pcre2_jit_neon_inc.h:212:9: error: ‘cmp2b’ is used uninitialized in this function [-Werror=uninitialized]
  212 | data2 = fast_forward_char_pair_compare(compare2_type, data2, cmp2a, cmp2b);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The compiler emits the error message before inlining.
Because the warning is based on an intra-procedural data
flow analysis, the compiler does not see that cmp1b and
cmp2b are not used when they are not initialized.

Here is the code of that function, cmp2 is only used
when ctype is compare_match2 or compare_match1i,
and not when ctype is compare_match1:

static inline vect_t fast_forward_char_pair_compare(compare_type ctype, vect_t dst, vect_t cmp1, vect_t cmp2)
{
if (ctype == compare_match2)
 {
 vect_t tmp = dst;
 dst = VCEQQ(dst, cmp1);
 tmp = VCEQQ(tmp, cmp2);
 dst = VORRQ(dst, tmp);
 return dst;
 }

if (ctype == compare_match1i)
  dst = VORRQ(dst, cmp2);
dst = VCEQQ(dst, cmp1);
return dst;
}

The patch inlines by hand the case of compare_match1 such that the
code avoids referring to cmp1b and cmp2b.

Tested on aarch64-linux with `make check`.
2020-01-31 14:56:51 +01:00
Anatol Belski
378010a120 Fix bundled PCRE2 compilation on ARM64 2020-01-25 17:44:18 +01:00
Anatol Belski
52d07834df Upgrade bundled PCRE2 to 10.34 2020-01-25 13:37:37 +01:00
Máté Kocsis
0b4778c377
Fix #78880: Another bunch of spelling errors 2020-01-16 09:46:47 +01:00
Nikita Popov
1dbf80bcc2 Merge branch 'PHP-7.3' into PHP-7.4 2019-10-07 13:24:16 +02:00
Nikita Popov
ab61d5caf9 Backport fix for uaf during pcre jit fallback
Backports parts of https://vcs.pcre.org/pcre2?view=revision&revision=1175
fixing https://bugs.exim.org/show_bug.cgi?id=2453.
2019-10-07 13:23:56 +02:00
Nikita Popov
db7702213c Merge branch 'PHP-7.3' into PHP-7.4 2019-09-18 10:45:07 +02:00
Nikita Popov
e11ed02870 Fixed bug #78272
Use MAP_JIT only when running under hardened runtime, because MAP_JIT
is incompatible with fork().

The check is based on
f879e35e3e.
2019-09-18 10:41:27 +02:00
Nikita Popov
03efeda538 Backport MAP_JIT fixes from PCRE2 10.33
This is intended to fix the primary issue from bug #77260.

Prior to macOS 10.14 multiple MAP_JIT segments were not permitted,
leading to mmap failures and corresponding "no more memory" errors
on macOS 10.13.
2019-09-18 09:28:54 +02:00
Stanislav Malyshev
fd6874c64d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78338: Array cross-border reading in PCRE
2019-07-29 14:51:21 -07:00
Christoph M. Becker
8947fd9e9f Fix #78338: Array cross-border reading in PCRE
We backport r1092 from pcre2.
2019-07-29 14:49:33 -07:00
Anatol Belski
aa9433e928 Upgrade bundled PCRE2 to 10.33 2019-05-25 11:37:30 +02:00
Peter Kokot
69b20f51e1 Disable PACKAGE_* preprocessor symbols
Autoconf defines PACKAGE_* symbols:
- PACKAGE_NAME
- PACKAGE_VERSION
- PACKAGE_TARNAME
- PACKAGE_STRING
- PACKAGE_BUGREPORT
- PACKAGE_URL

and appends them to the generated config.h.in files. With AC_INIT change
via afd52f9d99 where package version, URL,
bug report location and similar meta data are defined, these
preprocessor macros are then non empty strings in the generated
configuration header file. When using phpize, PHP shares the config
files in extensions, warnings of redefined macros appear, such as:
- `warning: 'PACKAGE_NAME' macro redefined`

This patch now disables these non utilized symbols in the generated
config header files.

Better practice would be to include only API specific headers where
needed but this would require even more refactorings. Some extensions
such as pcre, pgsql, and pdo_pgsql solve this issue by undefining some
of these symbols before including the library configuration headers in
the code also. Because these symbols can be defined by any library which
uses Autotools.

Additionally, the unused PACKAGE_* symbols were cleaned for the bundled
libmbfl library and with this patch not needed undef code removed.
2019-04-13 07:00:17 +02:00
Anatol Belski
7a02ecb7fe Fixed bug #76909 preg_match difference between 7.3 and < 7.3
Applied upstream patch, see https://bugs.exim.org/show_bug.cgi?id=2321
2018-09-21 15:55:03 +02:00
Anatol Belski
91b2b6c65d Upgrade PCRE2 to 10.32
(cherry picked from commit d918e0776b)
2018-09-21 15:54:14 +02:00
Gabriel Caruso
9e4d590b19
Remove extra semicolons 2018-07-25 21:47:04 -03:00
Anatol Belski
703e037090 Upgrade bundled PCRE2 to 10.31 2018-02-14 13:44:38 +01:00
Gabriel Caruso
2238403892 Trailing whitespaces on ext/*
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-04 02:38:32 -02:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Anatol Belski
5a6c49474e Remove unused file 2017-11-14 09:14:17 +01:00
Anatol Belski
a5bc5aed71 Patch core for PCRE2 support
RFC https://wiki.php.net/rfc/pcre2-migration
2017-11-13 19:37:38 +01:00