diff options
author | Anatol Belski <ab@php.net> | 2018-09-21 15:58:50 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-09-21 15:58:50 +0200 |
commit | 4ec7463df6e8ca34baaf766f7357e02ebc46f3a4 (patch) | |
tree | 999bec4be77cadf99e96b883042e55ea2f78954d | |
parent | 7b9b398daad24d8829df487131bdf5d266e34f74 (diff) | |
parent | 9c58ab37c78d596fcbda1c1c6d53698aa3119024 (diff) | |
download | php-git-4ec7463df6e8ca34baaf766f7357e02ebc46f3a4.tar.gz |
Merge branch 'PHP-7.3'
* PHP-7.3:
Add test for bug #76909
Fixed bug #76909 preg_match difference between 7.3 and < 7.3
Upgrade PCRE2 to 10.32
-rw-r--r-- | ext/pcre/pcre2lib/pcre2_jit_compile.c | 6 | ||||
-rw-r--r-- | ext/pcre/tests/bug76909.phpt | 21 |
2 files changed, 24 insertions, 3 deletions
diff --git a/ext/pcre/pcre2lib/pcre2_jit_compile.c b/ext/pcre/pcre2lib/pcre2_jit_compile.c index 32e985b793..e2b08ba22a 100644 --- a/ext/pcre/pcre2lib/pcre2_jit_compile.c +++ b/ext/pcre/pcre2lib/pcre2_jit_compile.c @@ -5856,9 +5856,6 @@ int i, j, k, len, c; if (!sljit_has_cpu_feature(SLJIT_HAS_CMOV)) return FALSE; -if (invert) - nclass = !nclass; - len = 0; for (i = 0; i < 32; i++) @@ -5940,6 +5937,9 @@ if (j != 0) } } +if (invert) + nclass = !nclass; + type = nclass ? SLJIT_NOT_EQUAL : SLJIT_EQUAL; add_jump(compiler, backtracks, CMP(type, TMP2, 0, SLJIT_IMM, 0)); return TRUE; diff --git a/ext/pcre/tests/bug76909.phpt b/ext/pcre/tests/bug76909.phpt new file mode 100644 index 0000000000..e98da4048c --- /dev/null +++ b/ext/pcre/tests/bug76909.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #76909 preg_match difference between 7.3 and < 7.3 +--FILE-- +<?php + +$data = " domain.com"; +$reg0 = "/^[\x{0100}-\x{017f}]{1,63}$/iu"; +$reg0 = "/(*NO_JIT)^[\x{0100}-\x{017f}]{1,63}$/iu"; + +$n0 = preg_match($reg0, $data, $m0); +$n1 = preg_match($reg0, $data, $m1); + +var_dump($n0, $n1, count($m0), count($m1)); + +?> +--EXPECT-- +int(0) +int(0) +int(0) +int(0) + |