summaryrefslogtreecommitdiff
path: root/ext/pcre
Commit message (Collapse)AuthorAgeFilesLines
...
* | Store default parameter values of internal functions in arg infoMáté Kocsis2020-04-081-18/+18
| | | | | | | | | | | | | | Closes GH-5353. From now on, PHP will have reflection information about default values of parameters of internal functions. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | Generate function entries for another batch of extensionsMáté Kocsis2020-04-053-27/+43
| | | | | | | | Closes GH-5352
* | Improve error messages of various extensionsMáté Kocsis2020-03-233-3/+3
| | | | | | | | Closes GH-5278
* | Merge branch 'PHP-7.4'Remi Collet2020-03-031-0/+2
|\ \ | |/ | | | | | | * PHP-7.4: this test needs json
| * this test needs jsonRemi Collet2020-03-031-0/+2
| |
* | Change argument error message formatMáté Kocsis2020-02-266-11/+11
| | | | | | | | Closes GH-5211
* | Add preg_last_error_msg() functionNicolas Oelgart2020-02-2510-12/+149
| | | | | | | | | | | | | | | | Provides the last PCRE error as a human-readable message, similar to functionality existing in other extensions, such as json_last_error_msg(). Closes GH-5185.
* | Make type error messages more consistentMáté Kocsis2020-02-176-13/+13
| | | | | | | | Closes GH-5092
* | Revert "Replace @param annotations with type declarations"Christoph M. Becker2020-02-172-10/+24
| | | | | | | | This reverts commit c31029f335ca1b453af799805c43c37e959ad555.
* | Replace @param annotations with type declarationsChristoph M. Becker2020-02-162-24/+10
| |
* | Merge branch 'PHP-7.4'Nikita Popov2020-02-112-5/+235
|\ \ | |/ | | | | | | * PHP-7.4: Fixed bug #79257
| * Fixed bug #79257Nikita Popov2020-02-112-5/+235
| | | | | | | | Replace an existing entry for a given name only if we have a match.
* | Merge branch 'PHP-7.4'Nikita Popov2020-02-072-4/+56
|\ \ | |/ | | | | | | | | * PHP-7.4: PCRE: Only remember valid UTF-8 if start offset zero PCRE: Check whether start offset is on char boundary
| * PCRE: Only remember valid UTF-8 if start offset zeroNikita Popov2020-02-072-4/+18
| | | | | | | | | | | | | | PCRE only validates the string starting from the start offset (minus maximum look-behind, but let's ignore that), so we can only remember that the string is fully valid UTF-8 is the original start offset is zero.
| * PCRE: Check whether start offset is on char boundaryNikita Popov2020-02-072-1/+39
| | | | | | | | | | | | We need not just the whole string to be UTF-8, but the start position to be on a character boundary as well. Check this by looking for a continuation byte.
* | Make ASSIGN, ASSIGN_OP, INC and DEC opcodes to return IS_TMP_VAR instead of ↵Dmitry Stogov2020-02-071-1/+6
| | | | | | | | | | | | | | | | | | IS_VAR. This helps to avoid unnecessary IS_REFERENCE checks. This changes some notices "Only variables should be passed by reference" to exception "Cannot pass parameter %d by reference". Also, for consistency, compile-time fatal error "Only variables can be passed by reference" was converted to exception "Cannot pass parameter %d by reference"
* | Merge branch 'PHP-7.4'Nikita Popov2020-02-052-18/+29
|\ \ | |/ | | | | | | * PHP-7.4: Fixed bug #79188
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-02-052-18/+29
| |\ | | | | | | | | | | | | * PHP-7.3: Fixed bug #79188
| | * Fixed bug #79188Nikita Popov2020-02-052-18/+29
| | |
* | | Reindent phpt filesNikita Popov2020-02-0324-96/+96
| | |
* | | inline by hand to avoid uninitialized variable warningSebastian Pop2020-01-311-6/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* | | Fix bundled PCRE2 compilation on ARM64Anatol Belski2020-01-251-1/+1
| | |
* | | Upgrade bundled PCRE2 to 10.34Anatol Belski2020-01-2539-4637/+7338
| | |
* | | Fix #78880: Another bunch of spelling errorsMáté Kocsis2020-01-165-10/+10
| | |
* | | Use RETURN_THROWS() after zend_type_error()Máté Kocsis2020-01-011-1/+1
| | |
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-11-222-1/+13
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78853: preg_match() may return integer > 1
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-11-222-1/+13
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78853: preg_match() may return integer > 1
| | * Fix #78853: preg_match() may return integer > 1Christoph M. Becker2019-11-222-1/+13
| | | | | | | | | | | | | | | | | | | | | Commit 54ebebd[1] optimized the match loop, but for this case it has been overlooked, that we must only loop if we're doing global matching. [1] <http://git.php.net/?p=php-src.git;a=commit;h=54ebebd686255c5f124af718c966edb392782d4a>
* | | Add union return types for function stubsMáté Kocsis2019-11-112-29/+22
| | |
* | | Clean DONE tags from testsFabien Villepinte2019-11-0713-27/+0
| | | | | | | | | | | | | | | | | | | | | Remove most of the `===DONE===` tags and its variations. Keep `===DONE===` if the test output otherwise becomes empty. Closes GH-4872.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-11-071-2/+4
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix php_pcre_mutex_free()
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-11-071-2/+4
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix php_pcre_mutex_free()
| | * Fix php_pcre_mutex_free()Nikita Popov2019-11-071-2/+4
| | | | | | | | | | | | | | | | | | We should only set the mutex to NULL if we actually freed it. Due to missing braces non-main threads may currently set it to NULL first.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-10-191-0/+6
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78684: PCRE bug72463_2 test is sending emails on Linux
| * | Fix #78684: PCRE bug72463_2 test is sending emails on LinuxChristoph M. Becker2019-10-191-0/+6
| | | | | | | | | | | | | | | This test is not supposed to run on non Windows systems; otherwise it would try to send an email.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-10-082-2/+11
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-10-082-2/+11
| |\ \ | | |/
| | * Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-10-082-2/+11
| | |\
| | | * Add pcre_get_compiled_regex_cache_ex() with local_aware flagSergei Turchanov2019-10-082-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new function `pcre_get_compiled_regex_cache_ex()` is introduced, which allows to compile regexp pattern using the "C" locale instead of a current locale. This will be needed to replace setlocale() usage in fileinfo, which is not thread-safe.
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-10-071-5/+5
|\ \ \ \ | |/ / /
| * | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-10-071-5/+5
| |\ \ \ | | |/ /
| | * | Backport fix for uaf during pcre jit fallbackNikita Popov2019-10-071-5/+5
| | | | | | | | | | | | | | | | | | | | Backports parts of https://vcs.pcre.org/pcre2?view=revision&revision=1175 fixing https://bugs.exim.org/show_bug.cgi?id=2453.
* | | | Remove most uses of ZEND_PARSE_PARAMETERS_END_EX()Nikita Popov2019-10-071-2/+2
| | | | | | | | | | | | | | | | | | | | As ZPP now throws, it makes no sense to specify an explicit return value.
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-10-041-0/+6
|\ \ \ \ | |/ / /
| * | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-10-041-0/+6
| |\ \ \ | | |/ /
| | * | Improve diagnostic on PCRE JIT mmap failureNikita Popov2019-10-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Print a more informative message that indicates that this is likely a permission issue, and also indicate that pcre.jit=0 can be used to work around it. Also automatically disable the JIT, so that this message is only shown once. See bug #78630.
* | | | Convert some notices to warningsNikita Popov2019-10-0211-24/+15
| | | | | | | | | | | | | | | | Part of https://wiki.php.net/rfc/engine_warnings.
* | | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-252-4/+0
| | | | | | | | | | | | | | | | Closes GH-4732.
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-09-181-2/+0
|\ \ \ \ | |/ / /
| * | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-09-181-2/+0
| |\ \ \ | | |/ /