Anatol Belski
81eb8e7507
Mark conditions unexpected
2018-07-11 18:05:28 +02:00
Anatol Belski
0630e3bc03
Reduce error buffer size
...
120 bytes is ample, the doc says.
2018-07-05 17:24:38 +02:00
Anatol Belski
ff8f2710f6
Check return value of pcre2_maketables()
2018-06-29 19:15:38 +02:00
Anatol Belski
e03739d4ab
Remove obsolete version checks in tests
2018-06-22 17:56:18 +02:00
Anatol Belski
aa92d42018
If there's no setlocale, char tables are not used
2018-06-22 17:31:26 +02:00
Anatol Belski
8b58b2aac6
Don't discard char tables just generated
2018-06-22 15:18:39 +02:00
Anatol Belski
684ce24eec
Improve locale character tables handling and reduce pattern cache size
...
If a locale other than C is active, character tables are saved into the
compile context. Every compiled pattern will have a pointer to the
character table, that was present in the context at the time of the
pattern compilation. Thus, the cache entries don't need to carry char
tables pointer, which reduces their size to 8 bytes on 64-bit. Instead,
the generated character tables are tracked in a separate HashTable. If a
character table was generated before, it'll be assigned to the compile
context when the locale changes. Otherwise a new char table will be
generated and cached.
2018-06-22 14:45:29 +02:00
Anatol Belski
bb2f1a6830
Fixed bug #76514 Regression in preg_match makes it fail with PREG_JIT_STACKLIMIT_ERROR
...
Looks like some patterns might require more stack for JIT execution. It
is a regression, as the same pattern was passing using JIT.
2018-06-22 11:05:30 +02:00
Christoph M. Becker
23ca95aa3e
Fix line endings in new PHPT
2018-06-22 00:01:51 +02:00
Christoph M. Becker
71d16feebb
Fix #76512 : \w no longer includes unicode characters
...
The migration from PCRE to PCRE2 missed to rename once occurrence of
`PCRE_UCP` to `PCRE2_UCP`. We fix that. We also revert the changes to
bug52971.phpt which had been incorrectly made in commit a5bc5ae[1].
[1] <http://git.php.net/?p=php-src.git;a=commit;h=a5bc5aed71f7a15f14f33bb31b8e17bf5f327e2d >
2018-06-21 22:45:08 +02:00
Dmitry Stogov
5eb1f92f31
Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence.
2018-05-28 16:27:12 +03:00
Anatol Belski
16216b6666
Switch to more robust config for external pcre2
...
For the standard layout the first option is pkg-config. Otherwise,
pcre2-config is used, which is produced by a manual installation into a
prefix. This removes the most of the hackish pieces like checking for
the lib filenames and parsing headers.
2018-04-26 14:20:36 +02:00
Anatol Belski
d22d99a344
Fix regex
2018-04-25 16:30:10 +02:00
Anatol Belski
217354899b
Revamp pcre config for build with external lib
...
- support multiarch in addition to the usual lib path
- fix symbol checks
- fix jit availability check
- exit early on unsupported version
2018-04-25 16:17:20 +02:00
Anatol Belski
e107a03419
Fix lib names for build with external libpcre2
2018-04-24 17:06:27 +02:00
Gabriel Caruso
b895690dfa
remove support for string|unicode in tests
2018-02-22 08:11:30 +01:00
Gabriel Caruso
ded3d984c6
Use EXPECT instead of EXPECTF when possible
...
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Anatol Belski
28132878f2
Reduce var scope
2018-02-17 13:02:49 +01:00
Anatol Belski
703e037090
Upgrade bundled PCRE2 to 10.31
2018-02-14 13:44:38 +01:00
Gabriel Caruso
21e3b0c70c
Remove trailing whitespace in inc files
2018-02-10 19:20:23 +01:00
Gabriel Caruso
ce1d69a1f6
Use int instead of integer in type errors
...
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Gabriel Caruso
53dbc69a8d
Use %d when expecting line number in tests
2018-02-02 22:35:13 +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
Xinchen Hui
a6519d0514
year++
2018-01-02 12:57:58 +08:00
Dmitry Stogov
856ad54f45
Use zend_hash_find() instead of zend_hash_find_ptr() to avoid double check
2017-12-27 13:25:21 +03:00
Michael Moravec
84235344f9
Fixed bug #75355 : preg_quote() does not quote # control character
2017-12-16 17:34:41 +01:00
Anatol Belski
9c8ffbf1af
Merge branch 'PHP-7.2'
...
* PHP-7.2:
Fix use after free revealed by phpdbg
2017-12-05 18:35:16 +01:00
Anatol Belski
d4af204637
Merge branch 'PHP-7.1' into PHP-7.2
...
* PHP-7.1:
Fix use after free revealed by phpdbg
2017-12-05 18:34:39 +01:00
Anatol Belski
092fd44474
Fix use after free revealed by phpdbg
2017-12-05 18:32:32 +01:00
Anatol Belski
9cca85ff07
Fixed bug #75601 Thread race in PCRE JIT support
2017-12-05 17:41:08 +01:00
Anatol Belski
75a2ee7f7b
Fixed bug #75601 Thread race in PCRE JIT support
2017-12-05 17:40:00 +01:00
Anatol Belski
31b2b14a71
Fixed bug #75601 Thread race in PCRE JIT support
2017-12-05 17:38:18 +01:00
Anatol Belski
6db15b7dba
Fix test
2017-11-21 21:44:09 +01:00
Anatol Belski
c029bd3342
Fix macro name
2017-11-21 20:27:17 +01:00
Anatol Belski
54e7b0a6f7
Merge branch 'PHP-7.2'
...
* PHP-7.2:
Fixed #75539 and #74183 - preg_last_error not returning error code after error
2017-11-21 20:15:30 +01:00
Anatol Belski
f6b0d365a7
Merge branch 'PHP-7.1' into PHP-7.2
...
* PHP-7.1:
Fixed #75539 and #74183 - preg_last_error not returning error code after error
2017-11-21 20:11:21 +01:00
Anatol Belski
f5c0754f6e
Merge branch 'PHP-7.0' into PHP-7.1
...
* PHP-7.0:
Fixed #75539 and #74183 - preg_last_error not returning error code after error
2017-11-21 20:10:49 +01:00
Nester
8fdef981ef
Fixed #75539 and #74183 - preg_last_error not returning error code after error
2017-11-21 20:10:18 +01:00
David Carlier
d006270040
seemingly a tiny typo error in pcre module.
2017-11-21 12:28:15 +01:00
Nikita Popov
26f8fc833b
Enable and fix printf() format warnings
...
Add _unchecked() variants of zend_spprintf and zend_strpprintf for
cases where we specifically want to disable these checks, such as
use of %H.
2017-11-16 21:15:36 +01:00
Dmitry Stogov
73bde7bbd0
Merge branch 'master' of git.php.net:php-src
...
* 'master' of git.php.net:php-src:
Fix (*NO_JIT) usage when JIT is enabled
Refactor ASCII to wide conversion
2017-11-16 17:10:04 +03:00
Dmitry Stogov
ccc12b82da
Avoid unnecessary reference-counting on strings.
2017-11-16 17:09:32 +03:00
Anatol Belski
a370a6af64
Fix (*NO_JIT) usage when JIT is enabled
...
If (*NO_JIT) is put into the pattern, the JIT compilation will still
succeed but produce no code. The pattern will still have to be
interpreted and is not suitable for the JIT fast path. This means,
we still need to check the pattern info after JIT compilation and only
set the flags when the JIT code was produced.
2017-11-16 14:12:05 +01:00
Anatol Belski
ce85d0f24f
Add missing ifdef
2017-11-15 20:21:40 +01:00
Anatol Belski
691a5a9c4c
Initialize jit global
2017-11-14 21:47:56 +01:00
Anatol Belski
91407fb82d
Fix wrong return
2017-11-14 21:44:46 +01:00
Anatol Belski
13696d7aae
Use already available pattern length, fix signedness warnings
2017-11-14 16:36:33 +01:00
Anatol Belski
19c56e42c5
Add skipif as this test became only valid with JIT compiled in
...
Without JIT, the depth limit is respected, but for JIT it's irrelevant.
2017-11-14 15:53:06 +01:00
Anatol Belski
a385993c0c
Merge branch 'PHP-7.2'
...
* PHP-7.2:
Fix UTF check in pcre_grep
2017-11-14 13:56:25 +01:00