Compare commits

..
902 Commits
Author SHA1 Message Date
Christoph M. Becker bd3656d9fd Update version for PHP 7.3.6 2019-05-28 10:51:18 +02:00
Christoph M. Becker 83cb78416b Update NEWS for 7.3.6 GA 2019-05-28 09:07:49 +02:00
Stanislav Malyshev d27b4824e6 Fix bug #77967 - Bypassing open_basedir restrictions via file uris
(cherry picked from commit c34895e837)
2019-05-28 09:03:25 +02:00
Stanislav Malyshev 70523ce41f Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow
(cherry picked from commit 7cf7148a8f)
2019-05-28 09:01:00 +02:00
Christoph M. Becker 903b1828dc Fix #77973: Uninitialized read in gdImageCreateFromXbm
We have to ensure that `sscanf()` does indeed read a hex value here,
and bail out otherwise.

(cherry picked from commit ed6dee9a19)
2019-05-28 08:59:50 +02:00
Stanislav Malyshev b7dc3d9039 Fix bug #77988 - heap-buffer-overflow on php_jpg_get16
(cherry picked from commit 73ff4193be)
2019-05-28 08:55:19 +02:00
Dmitry Stogov 53c1b48574 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed possible crashes, because of inconsistent PCRE cache and opcache SHM reset
2019-05-15 08:44:16 +00:00
Christoph M. Becker 40235e7eef Prepare 7.3.6RC1 2019-05-14 09:37:40 +00:00
Christoph M. Becker 1a98878bfe Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix test case
2019-05-14 10:25:02 +02:00
Christoph M. Becker 704a0ab0c9 Fix test case
stderr is supposed to be redirected to NUL (which is roughly equivalent
to /dev/null on POSIX), but actually was redirected to a file.
2019-05-14 10:23:58 +02:00
Jakub Zelenka aa74c30466 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-13 18:51:05 +01:00
Jakub Zelenka ad63bd169b Add ping to the fpm test for bug #77934 2019-05-13 18:50:24 +01:00
Christoph M. Becker 69bab6e5a5 Fix #78003: strip_tags output change since PHP 7.3
A refactoring of the strip tags state machine[1] missed the special
treatment of `depth > 0` when a `>` is encountered in state 2 or 3.  We
re-add it for BC reasons.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=5cf64742773ddbf9af69d962a4d12b567fcf0084>
2019-05-13 13:10:24 +02:00
Nikita Popov bec68d59a2 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-13 11:06:14 +02:00
Theodore Brown b6b15fc65c Fix #77993: Wrong parse error for invalid hex literal on Windows
If a PHP file contains an invalid hex literal such as `0x_10`, the expected error
is `Parse error: syntax error, unexpected 'x_10' (T_STRING) in %s on line %d`.

This already worked correctly on Linux, but on Windows prior to this patch a different
error was produced: `Parse error: Invalid numeric literal in %s on line %d`.
2019-05-13 11:04:56 +02:00
Peter Kokot 43e6fd1e2b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Convert CRLF to LF
2019-05-13 03:53:31 +02:00
Peter Kokot f95b27c6f6 Convert CRLF to LF
These files are tracked with CRLF line endings in Git and can be
converted to LF. Neither are parts of tests or code itself.
2019-05-13 03:51:00 +02:00
Jakub Zelenka 0cad701374 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-11 20:08:57 +01:00
Jakub Zelenka cc5c51e7f0 Fix bug #77934 (php-fpm kill -USR2 not working) 2019-05-11 20:07:39 +01:00
Peter Kokot bec22af8d7 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Convert CRLF to LF in *.wsdl files
2019-05-11 17:15:08 +02:00
Peter Kokot b15bfb9129 Convert CRLF to LF in *.wsdl files
These EOL types are part of different environments and not part of the
tests themselves.
2019-05-11 17:12:28 +02:00
Christoph M. Becker 49b5ffe48c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix typo
2019-05-10 18:44:47 +02:00
Christoph M. Becker 3759c6316d Fix typo
Since opcache.enable defaults to 1 anyway, this change is only
cosmetic.
2019-05-10 18:43:40 +02:00
George Wang d2037b1bd4 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-09 18:14:11 -04:00
George Wang af4143753f Updated LiteSpeed SAPI to 7.3.2 to allow request header value length up to 64K. 2019-05-09 18:13:25 -04:00
Christoph M. Becker fd1ffa4692 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix erroneous assertions
2019-05-09 16:55:35 +02:00
Christoph M. Becker 27f168cf63 Fix erroneous assertions
Since PHP strings are binary safe (i.e. they may contain NUL bytes), we
must not assume that strlen()/wcslen() actually return the length of
the string.  Only if the given in_len is zero, it is safe to assert
this.
2019-05-09 16:54:11 +02:00
Nikita Popov 90318fbcbe Merge branch 'PHP-7.2' into PHP-7.3 2019-05-09 12:35:11 +02:00
Nikita Popov 35c80583f0 Fixed bug #75186 2019-05-09 12:33:53 +02:00
Christoph M. Becker e46b3c3e70 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix log_verbosity_bug.phpt
2019-05-09 12:15:32 +02:00
Christoph M. Becker e359812ce3 Fix log_verbosity_bug.phpt
This test may fail on Windows due to the file cache fallback.  We
ensure that this will not happen.
2019-05-09 12:15:00 +02:00
Christoph M. Becker 236522529c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add {TMP} placeholder for PHPT INI sections
2019-05-08 19:22:21 +02:00
Christoph M. Becker 3d0a0f801b Add {TMP} placeholder for PHPT INI sections
Several tests use `/tmp` in the `--INI--` section, but this is not
portable.  We therefore introduce the `{TMP}` placeholder which
evaluates to the system's temporary directory using
`sys_get_temp_dir()`.

We also remove the doubtful `strpos()` optimization.
2019-05-08 19:21:38 +02:00
Nikita Popov e2ef4e9e2f Merge branch 'PHP-7.2' into PHP-7.3 2019-05-08 11:37:49 +02:00
Nikita Popov d19b6aa5ba Fix resolution of "parent" during inheritance check
We can't assume that the method we're checking against is part of
the parent class...
2019-05-08 11:35:26 +02:00
Peter Kokot d153fbc5a9 Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2019-05-07 04:34:37 +02:00
Jakub Zelenka 36a7d9fca4 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-05 21:05:55 +01:00
Jakub Zelenka 9977de0028 Fix OpenSSL online test for ca context
The php.net is redirected to https so use nginx.org
2019-05-05 21:04:28 +01:00
Javier Spagnoletti 78d24429f2 Update NEWS with changes made at #4093 2019-05-03 17:32:40 +02:00
Javier Spagnoletti 6b73e692c9 Add more missing CURL_VERSION_* constants
And also check for CURL_VERSION_* constants in the sync-constants.php
script.

Related to request #72189: Add missing `CURL_VERSION_*` constants.
2019-05-02 15:11:42 +02:00
Christoph M. Becker d91b643c87 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS wrt. sec fixes
2019-04-30 09:36:09 +02:00
Christoph M. Becker 1210c3b960 Update NEWS wrt. sec fixes 2019-04-30 09:34:53 +02:00
Stanislav Malyshev 66b32f25d5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
2019-04-30 00:05:43 -07:00
Stanislav Malyshev cb5af4e8a0 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
2019-04-30 00:05:32 -07:00
Stanislav Malyshev f80ad18afa Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
I do not completely understand what is going on there, but I am pretty
sure dir_entry <= offset_base if not a normal situation, so we better not
to rely on such dir_entry.
2019-04-30 00:05:23 -07:00
Stanislav Malyshev 506a764089 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:10 -07:00
Stanislav Malyshev 2c3933821f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:04 -07:00
Christoph M. Becker 6c631ccfef Fix #77821: Potential heap corruption in TSendMail()
`zend_string_tolower()` returns a copy (not a duplicate) of the given
string, if it is already in lower case.  In this case we must not not
`zend_string_free()` both strings.  The cleanest solution is to call
` zend_string_release()` on both strings, which properly handles the
refcount.
2019-04-29 22:08:19 -07:00
Christoph M. Becker a30b919872 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77943: imageantialias($image, false); does not work
2019-04-29 17:23:45 +02:00
Christoph M. Becker 18a9ae412f Fix #77943: imageantialias($image, false); does not work
Firstly, we must not call `gdImageSetAntiAliased()` (which sets the
color to anti-alias), but rather modify the `gdImage.AA` flag.
Furthermore, we have to actually use the supplied boolean value.

We also make sure that we don't attempt to enable anti-aliasing for
palette images.
2019-04-29 17:23:16 +02:00
Christoph M. Becker 44494c09bc Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add tests for bug77943
2019-04-29 16:29:29 +02:00
Christoph M. Becker 3891e0d13a Add tests for bug77943 2019-04-29 16:29:08 +02:00
Christoph M. Becker 3fc1bdc81c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77943: imageantialias($image, false); does not work
2019-04-29 16:18:27 +02:00
Christoph M. Becker cd94cf60a2 Fix #77943: imageantialias($image, false); does not work
Firstly, we must not call `gdImageSetAntiAliased()` (which sets the
color to anti-alias), but rather modify the `gdImage.AA` flag.
Furthermore, we have to actually use the supplied boolean value.

We also make sure that we don't attempt to enable anti-aliasing for
palette images.
2019-04-29 16:16:46 +02:00
Nikita Popov ff2b5bda59 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-29 13:53:45 +02:00
Nikita Popov 5da0579259 Fixed bug #77945
Make sure that we proper distinguish between empty string key and
no key during SDL serialization.
2019-04-29 13:52:18 +02:00
Christoph M. Becker 7faaf5a89a Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix tests
2019-04-29 09:05:04 +02:00
Christoph M. Becker 9bf11045db Fix tests
These tests are obviously meant to test successful and failing uri:
DSNs, but did not pass proper file:// URIs, so actually ended up
testing for invalid data source URIs twice.  We fix this, and adjust
the expectations accordingly.

We also unfork the -win32 variant, since both test cases are almost
identical, and the expected error message may be either one.
2019-04-29 09:04:33 +02:00
Christoph M. Becker 06b130579e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Make MySQLPDOTest::extractVersion() more liberal
2019-04-28 23:49:19 +02:00
Christoph M. Becker fc9cdb723b Make MySQLPDOTest::extractVersion() more liberal
MySQL/MariaDB version strings may have suffixes which may contain dots;
for instance, Debian stretch has 5.5.5-10.1.37-MariaDB-0+deb9u1 or
such.  Therefore, we make the version extraction more liberal, and only
require that there are at least three parts separated by dot, and
ignore additional parts.

We also fix an erroneous test expectation, which would be triggered on
CI now, right away.  This patch has been provided by petk@.
2019-04-28 23:48:27 +02:00
Peter Kokot f83c207d60 Update NEWS 2019-04-28 00:51:18 +02:00
Peter Kokot 1bdd97a601 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
  Fix #77024: SplFileObject::__toString() may return array
2019-04-28 00:50:54 +02:00
Peter Kokot 6d8892aacd Update NEWS 2019-04-28 00:50:40 +02:00
Craig Duncan 91c6fb881e Fix #77024: SplFileObject::__toString() may return array
- Correct the behaviour of casting spl files to strings
- Add a test for Bug 77024
2019-04-28 00:44:48 +02:00
Christoph M. Becker 3309f2fbb9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  PHP, meet MySQL
2019-04-27 19:22:10 +02:00
Christoph M. Becker 57d5dc5688 PHP, meet MySQL
All pdo_mysql tests are skipped on AppVeyor because "No such host is
known".  We change the DSN to use semicolons instead of spaces to fix
that.
2019-04-27 19:21:51 +02:00
Christoph M. Becker e561d4100b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77944: Wrong meta pdo_type for bigint on LLP64
2019-04-27 18:47:32 +02:00
Christoph M. Becker 16609880f8 Fix #77944: Wrong meta pdo_type for bigint on LLP64
When actually fetching the data, bigint (unsigned) column values are
returned as integers on LLP64 architectures, so their pdo_type has to
be PDO::PARAM_INT accordingly.
2019-04-27 18:46:27 +02:00
Christoph M. Becker 70239ea1d3 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 23:29:03 +02:00
Christoph M. Becker 7ddfe73e69 Fix #77940: test using outdated mon_thousands_sep for Swedish
Of course, we should expect a comma, not a period.
2019-04-25 23:28:41 +02:00
Christoph M. Becker 3e31ae5d70 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 19:40:05 +02:00
Christoph M. Becker bfbfb9dabd Fix #77940: test using outdated mon_thousands_sep for Swedish
This time so that it works for all Windows 10 versions (hopefully).
2019-04-25 19:39:42 +02:00
Christoph M. Becker dcba479848 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 08:59:09 +02:00
Christoph M. Becker 37ca6a7a2a Fix #77940: test using outdated mon_thousands_sep for Swedish 2019-04-25 08:58:13 +02:00
Christoph M. Becker ad0acc0aa9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77938: socket_get_option error
2019-04-25 00:04:37 +02:00
Christoph M. Becker fe202d99c8 Fix #77938: socket_get_option error
Since tcp_socket/ssl streams are not representable, we suppress the
redirect to fix the test case.
2019-04-25 00:03:45 +02:00
Remi Collet 191e15309f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  news entry for litespeed
2019-04-24 09:46:06 +02:00
Remi Collet 5d21a15cc3 news entry for litespeed 2019-04-24 09:45:48 +02:00
Nikita Popov 68892410f7 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-23 12:43:32 +02:00
Nikita Popov 4831e150c5 Fixed bug #77843 2019-04-23 12:43:07 +02:00
Nikita Popov cedee4408b Fixed bug #77931 2019-04-23 11:40:13 +02:00
George Wang fb4c811835 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-21 15:59:07 -04:00
George Wang ce73841cdc Improved LSAPI_End_Response_r() . 2019-04-21 15:04:54 -04:00
George Wang ccf051c317 Fixed bug in litespeed_finish_request(), disable fastcgi_finish_request() alias for now. 2019-04-21 14:59:51 -04:00
Peter Kokot 0b8414832e Update changelog 2019-04-20 19:13:06 +02:00
Peter Kokot 2549f7d220 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update changelog
  Fix #77921: static.php.net doesn't work anymore
2019-04-20 19:12:31 +02:00
Peter Kokot 295c66911f Update changelog 2019-04-20 19:12:17 +02:00
Peter Kokot 4450288344 Fix #77921: static.php.net doesn't work anymore
This embeds the PHP logo image in the FPM status HTML page instead of
using remote location. The phpinfo() output also uses such approach
and browser compatibility looks decent [1].

1: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
2019-04-20 19:00:51 +02:00
Peter Kokot d1bce98597 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update Git repository for Windows build tool kit
2019-04-19 21:11:01 +02:00
Peter Kokot 06fa35568e Update Git repository for Windows build tool kit 2019-04-19 21:09:46 +02:00
Christoph M. Becker fd4c42efab Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Use php-sdk-2.2.0beta5 on AppVeyor
2019-04-18 16:51:38 +02:00
Christoph M. Becker a7ada30ac6 Use php-sdk-2.2.0beta5 on AppVeyor 2019-04-18 16:51:10 +02:00
Dmitry Stogov 3a04adce82 Check assert only when RC_DEBUG is enabled 2019-04-18 14:26:15 +03:00
Nikita Popov b2f49c69b1 Add a dl() test to Travis
Compile the zend_test extension as shared and try loading it with dl()
to test for obvious issues. Doing this as a standalone call because this
is very specific to the CI setup.
2019-04-18 12:57:54 +02:00
Nikita Popov e9aa0337ab Fix more dl() interned string assertions 2019-04-18 12:14:07 +02:00
Dmitry Stogov bfadd9fdaf It's safe to keep old string if it's stored not in SHM. 2019-04-17 21:57:17 +03:00
Dmitry Stogov ac12cc85aa Fixed dl() function. It failed in DEBUG build without opcache because of assert during string interning. 2019-04-17 19:31:28 +03:00
Christoph M. Becker f0ccd9ffc6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77911: Wrong warning for session.sid_bits_per_character
2019-04-17 17:24:15 +02:00
Christoph M. Becker d20053a556 Fix #77911: Wrong warning for session.sid_bits_per_character 2019-04-17 17:23:23 +02:00
Derick Rethans 6088713216 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-17 09:40:18 +01:00
Ignace Nyamagana Butera 7b1a4e2400 Fixed bug #77909: DatePeriod::__construct() with invalid recurrence count value
Improve error message on invalid reccurence count

Adding test when reccurence is -1
2019-04-17 09:39:03 +01:00
Christoph M. Becker ec8457d982 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix tests for non English environments
2019-04-17 09:57:37 +02:00
Christoph M. Becker 6fe75f9e45 Fix tests for non English environments 2019-04-17 09:56:55 +02:00
Remi Collet e90bce7f08 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  next is 7.2.19
2019-04-16 13:12:33 +02:00
Remi Collet 6c44a71e4a next is 7.2.19 2019-04-16 13:11:23 +02:00
Nikita Popov f9a755d0d2 Fix HT flags copying wrt iterator count
HT_FLAGS() includes the full flag word, including the iterator
count. When we're fully reassigning it, we need to make sure that
we either really do want to copy the iterator count (as in some
cases in array.c) or we need to mask only the actual flag byte.

Add an assert to hash_iterators_del() to make sure the iterator
count is non-zero (which is how I ran into this) and make sure that
the iterator count is correctly preserved during array splicing.
2019-04-16 12:14:45 +02:00
Christoph M. Becker 5ae49c43dc Prepare main branch for PHP 7.3.6 2019-04-16 11:56:03 +02:00
Nikita Popov 9a9eed472b Fix second part of bug #77903
When a HT iterator is one past the end and we rehash, we need to make
sure that it is move to the new one past the end position, to make
sure that newly inserted elements are picked up.
2019-04-16 10:38:20 +02:00
Nikita Popov e1b4cabbd6 Partial fix for bug #77903
In the hash position APIs, make sure we always advance to the next
non-undef element and not just when the position is 0 (similar to
what foreach does). This can happen when the position of an
ArrayIterator is one past its current end and a new element is
inserted not directly at that position because the array is packed.

There is still a bug here (as shown in the tests), but this is a
separate issue that also affects plain array iteration in foreach.
2019-04-16 10:23:11 +02:00
Nikita Popov a2f3ec1777 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-15 15:27:30 +02:00
Nikita Popov 619c4e9f2e Fixed bug #77895 2019-04-15 15:26:58 +02:00
Nikita Popov e05c6a25f9 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-15 15:00:49 +02:00
Nikita Popov 9b1950b005 Zero sockaddr struct
in6 has a bunch of extra fields that we're leaving uninitialized. I
don't see them locally, but there's valgrind warnings on gcov.
2019-04-15 14:59:05 +02:00
Nikita Popov 5611058766 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-15 10:54:31 +02:00
Nikita Popov 917952453c Fix uninitialized cert_captured
This is a legimitimate bug and also shows up under valgrind.
2019-04-15 10:53:33 +02:00
Nikita Popov 14047b50b4 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-15 10:25:11 +02:00
Nikita Popov e9c0367fdc Fixed bug #77882 2019-04-15 10:22:40 +02:00
Côme Chilliet 3e1eff251b Updated NEWS 2019-04-15 10:19:19 +02:00
Côme Chilliet ea0f26420d Fix a NULL dereferencing crash in php-ldap
This happens when parsing a control response to a VLV request which does
 not contain a "context" string.

See bug #77869
2019-04-15 10:16:29 +02:00
George Wang 7f551c728c Merge branch 'PHP-7.2' into PHP-7.3 2019-04-12 17:44:32 -04:00
George Wang 1e7f1b90e8 LiteSpeed SAPI 7.3, better process management, new API function litespeed_finish_request(). 2019-04-12 17:43:45 -04:00
Christoph M. Becker 8ed3b74a0c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix tests wrt. internationalization
2019-04-12 13:08:13 +02:00
Christoph M. Becker d07a6fdedf Fix tests wrt. internationalization 2019-04-12 13:07:39 +02:00
Nikita Popov 354a1c27aa Merge branch 'PHP-7.2' into PHP-7.3 2019-04-12 10:37:08 +02:00
Nikita Popov 3b53d28e60 Fix key leaks in mb_convert_encoding() 2019-04-12 10:36:58 +02:00
Christoph M. Becker d2d1a50b04 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix potential OPcache file cache related issues
2019-04-11 18:30:27 +02:00
Anatol Belski 5477d68300 Fix potential OPcache file cache related issues
To solve issues detected during testing, we backport the following
commits to PHP 7.2:

129c5c1181
9ac133a0b3
ce72bc6b65
2019-04-11 18:28:49 +02:00
Nikita Popov a61d24e4d8 Avoid onig match param unused variable warning 2019-04-11 12:35:24 +02:00
Anatol Belski ce72bc6b65 Ensure double slashes are replaced by the path normalization 2019-04-10 15:20:36 +02:00
Anatol Belski 1aa30bb71c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix phar:// include handling with file cache
2019-04-10 14:56:29 +02:00
Anatol Belski f31d7ca85e Fix phar:// include handling with file cache 2019-04-10 14:55:15 +02:00
Nikita Popov b67ca4f07c Merge branch 'PHP-7.2' into PHP-7.3 2019-04-10 13:06:55 +02:00
Nikita Popov 8f13599a64 Fix 29nb_async_connect.phpt
Intermediate states are unreliable across versions (I think), make
sure we go through the whole connect procedure.
2019-04-10 13:06:02 +02:00
Nikita Popov 6615b9c287 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-10 12:22:34 +02:00
Nikita Popov c7a86a38a3 Fix pgsql use after free trying to reuse closed connection
When a connection is closed, we also need to remove the hash entry
from the regular_list, as it now points to freed memory. To do this
store a reverse mapping from the connection to the hash string.

It would be nicer to introduce a wrapping structure for the pgsql
link resource that could store the hash (and notices), but that would
require large changes to the extension, so I'm going for a more
minimal fix here.
2019-04-10 12:18:57 +02:00
Nikita Popov ed1df9d135 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-10 10:38:32 +02:00
Nikita Popov b55715d61a Fix use after free on pg_close() of default connection 2019-04-10 10:38:24 +02:00
Dmitry Stogov 8e5a2096a9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Repare SWITCH VM
2019-04-09 01:11:02 +03:00
Dmitry Stogov 7b8212f4d1 Repare SWITCH VM 2019-04-09 00:41:11 +03:00
Nikita Popov a90ac8b5b2 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-08 13:00:05 +02:00
twosee bdac9ef10d Preserve keys in emulate_read_fd_set()
Keys are already preserved in the non-emulated case.
2019-04-08 12:58:46 +02:00
Nikita Popov 08a3062816 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-08 11:41:48 +02:00
Nikita Popov d7b5954f28 Fixed bug #77853 2019-04-08 11:40:50 +02:00
Nikita Popov 0a25b41f6d Merge branch 'PHP-7.2' into PHP-7.3 2019-04-08 11:12:52 +02:00
Nikita Popov eea61cda7d Fixed bug #77844
We should probably return an integer result from the operation in
typed mode, right now the result is always a string.
2019-04-08 11:11:58 +02:00
Stanislav Malyshev 805a330681 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Always use ZEND_SECURE_ZERO() when cleaning up data
  bump versions after release
2019-04-06 19:06:16 -07:00
Stanislav Malyshev d1d692abe7 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Always use ZEND_SECURE_ZERO() when cleaning up data
  bump versions after release
2019-04-06 19:05:37 -07:00
Stanislav Malyshev 588db7cecf Always use ZEND_SECURE_ZERO() when cleaning up data
Optimizing compilers have an annoying tendency to throw out
memsets over data that they think aren't used anymore. Apply secure
zero-out in cases where this has potential to happen.
2019-04-06 18:15:42 -07:00
Joe Watkins 0c6a68fa36 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Follow up #77849 PDOStatement objects in undefined state after clone
2019-04-06 01:27:58 +02:00
Joe Watkins a2b8a62abf Follow up #77849 PDOStatement objects in undefined state after clone 2019-04-06 01:26:47 +02:00
Joe Watkins 0d5be6ce91 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77849 Disable cloning of PDO handle/connection objects to avoid segfault
2019-04-06 00:55:46 +02:00
Cameron Porter 9ec1525eb5 Fix bug #77849 Disable cloning of PDO handle/connection objects to avoid segfault 2019-04-06 00:54:59 +02:00
Christoph M. Becker 31fe6cfe76 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update Appveyor CI to php-sdk-2.2.0beta4
2019-04-05 23:15:50 +02:00
Christoph M. Becker 7b0ed8975d Update Appveyor CI to php-sdk-2.2.0beta4 2019-04-05 23:15:22 +02:00
Christoph M. Becker 54bed8d2ea Fix typos 2019-04-04 14:22:36 +02:00
Matteo Beccati 9f02f9fd5c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Ref #76801 remove old file source from file_sources hash in case of file included more than once
2019-04-03 14:36:11 +02:00
Alessandro Chitolina 4029c0b6a2 Ref #76801 remove old file source from file_sources hash in case of file included more than once 2019-04-03 14:35:57 +02:00
Dmitry Stogov 0f811bb7b6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed CFG construction for SWITCH opcodes
2019-04-03 03:09:47 +03:00
Dmitry Stogov 56a5d0bd91 Fixed CFG construction for SWITCH opcodes 2019-04-03 03:09:03 +03:00
Christoph M. Becker 849c49a714 Update NEWS 2019-04-02 16:54:15 +02:00
Joe Watkins 731eeb8dec bump versions after release 2019-04-02 16:50:20 +02:00
Remi Collet 002983e463 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  fix paste issue
2019-04-02 11:05:54 +02:00
Remi Collet f7755163b7 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  fix paste issue
2019-04-02 11:05:39 +02:00
Remi Collet dc1cd3daf2 fix paste issue 2019-04-02 11:05:09 +02:00
Christoph M. Becker b8fdaa7c42 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Pointer arithmetic on void pointers is illegal
2019-04-02 10:41:26 +02:00
Christoph M. Becker f6efe70505 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Pointer arithmetic on void pointers is illegal
2019-04-02 10:40:56 +02:00
Christoph M. Becker 01a4de5c58 Pointer arithmetic on void pointers is illegal
We quick-fix this by casting to char*; it might be more appropriate to
use char pointers in the first place.
2019-04-02 10:39:44 +02:00
Stanislav Malyshev da5fbb8c36 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77831 - Heap-buffer-overflow in exif_iif_add_value in EXIF
2019-04-02 00:13:00 -07:00
Stanislav Malyshev c83af86f8b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #77831 - Heap-buffer-overflow in exif_iif_add_value in EXIF
2019-04-02 00:12:54 -07:00
Stanislav Malyshev 887a7b5714 Fixed bug #77831 - Heap-buffer-overflow in exif_iif_add_value in EXIF 2019-04-02 00:12:26 -07:00
Derick Rethans a22bd7a3a8 Updated to version 2019.1 (2019a) 2019-04-01 10:38:40 +01:00
Stanislav Malyshev 3d5b6f234e Update NEWS & UPGRADING 2019-04-01 00:03:49 -07:00
Stanislav Malyshev bc8f292c05 Merge branch 'mb-limit-73' into PHP-7.3
* mb-limit-73:
  Add fallbacks for older oniguruma versions
  Add mbstring.regex_stack_limit to php.ini-*
  Implement RF bug #72777 - ensure stack limits on mbstring functions.
2019-04-01 00:00:14 -07:00
Stanislav Malyshev d2a86e1c0f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
2019-03-31 23:11:27 -07:00
Stanislav Malyshev 682d28abf7 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWS
2019-03-31 23:11:24 -07:00
Stanislav Malyshev c684d32fb8 Update NEWS 2019-03-31 23:11:15 -07:00
Stanislav Malyshev 9efaac30ae Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77753 - Heap-buffer-overflow in php_ifd_get32s
2019-03-31 23:09:57 -07:00
Stanislav Malyshev f3ab302270 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77753 - Heap-buffer-overflow in php_ifd_get32s
2019-03-31 23:09:18 -07:00
Stanislav Malyshev f3aefc6d07 Fix bug #77753 - Heap-buffer-overflow in php_ifd_get32s 2019-03-31 23:09:06 -07:00
Christoph M. Becker d8b7728b0e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77827: preg_match does not ignore \r in regex flags
2019-03-31 13:33:21 +02:00
Christoph M. Becker 88460c017a Fix #77827: preg_match does not ignore \r in regex flags 2019-03-31 13:31:54 +02:00
Stanislav Malyshev e12c069d33 Add fallbacks for older oniguruma versions 2019-03-30 23:18:33 -07:00
Anatol Belski a2c87c7f29 Fix memory leak 2019-03-30 21:28:51 +01:00
Matteo Beccati 263c587854 Fixed SKIPIF when --disable-mbregex is used 2019-03-30 18:29:49 +01:00
Matteo Beccati f030f34622 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed SKIPIF when --disable-mbregex is used
2019-03-30 18:29:44 +01:00
Matteo Beccati 0dbb581cf4 Fixed SKIPIF when --disable-mbregex is used 2019-03-30 18:28:33 +01:00
Christoph M. Becker 9d8b913de5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix test expectation
2019-03-29 09:56:58 +01:00
Christoph M. Becker 0aa1a2c833 Fix test expectation
The `W32_SM_SENDMAIL_FROM_MALFORMED` error message will only be shown
if the `$additional_headers` parameter is passed to `mail`, which is
not the case for this test.  Instead we have to expect `BAD_MSG_RPATH`.
2019-03-29 09:55:04 +01:00
Stanislav Malyshev bc4cb277d3 Add mbstring.regex_stack_limit to php.ini-* 2019-03-28 22:57:07 -07:00
Stanislav Malyshev 66c35b083b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Validate subject encoding in mb_split and mb_ereg_match
  Validate pattern against mbregex encoding
  SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
2019-03-28 00:42:56 -07:00
Stanislav Malyshev 402adc1df1 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Validate subject encoding in mb_split and mb_ereg_match
  Validate pattern against mbregex encoding
  SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
2019-03-28 00:35:22 -07:00
Yasuo Ohgaki 738016bd88 Implement RF bug #72777 - ensure stack limits on mbstring functions.
The patch creates new config: mbstring.regex_stack_limit, which
defaults to 100000.
2019-03-28 00:31:57 -07:00
Joe Watkins 62a652a0d5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  fix build: readline support must be disabled by default in phpdbg
2019-03-28 07:35:15 +01:00
Joe Watkins b7442f1bb8 fix build: readline support must be disabled by default in phpdbg 2019-03-28 07:34:45 +01:00
Nikita Popov 0ecac37c40 Validate subject encoding in mb_split and mb_ereg_match
We were already validating the subject encoding in most functions,
but not these two.
2019-03-27 23:20:27 -07:00
Nikita Popov 40fe50daf6 Validate pattern against mbregex encoding
Oniguruma does not consistently perform this validation itself (at least
on older versions), so make sure we check pattern encoding validity on the
PHP side.
2019-03-27 23:19:46 -07:00
Joe Watkins 218154e695 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Consider phpdbg as cli
2019-03-27 10:38:45 +01:00
Samuele Kaplun 79f046f89e Consider phpdbg as cli
* When configuring extensions, considers the PHPDBG SAPI as CLI thus
  allowing e.g. to have the pcntl extension available within PHPDBG.

Signed-off-by: Samuele Kaplun <kaplun@protonmail.com>
2019-03-27 10:38:03 +01:00
Joe Watkins eb405a2192 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77805 phpdbg build fails when readline is shared
2019-03-27 10:04:07 +01:00
Joe Watkins 7af270eb28 Fix #77805 phpdbg build fails when readline is shared 2019-03-27 10:02:42 +01:00
Joe Watkins 1e4cff9ddb Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  more work on phpdbg conditional breaks
2019-03-27 00:02:31 +01:00
Joe Watkins 6d3a2b4693 more work on phpdbg conditional breaks 2019-03-27 00:02:15 +01:00
Joe Watkins e177d26d0e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77800 phpdbg segfaults on conditional breakpoints
2019-03-26 23:06:15 +01:00
Joe Watkins 7df8e4fc0a Fix #77800 phpdbg segfaults on conditional breakpoints 2019-03-26 23:05:06 +01:00
Peter Kokot 6ef6d31776 [ci skip] Update NEWS 2019-03-25 21:57:20 +01:00
Peter Kokot 58e00df9fe Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
  Fix #77794: Incorrect Date header format in built-in server
2019-03-25 21:56:39 +01:00
Peter Kokot 72a2ab39ba [ci skip] Update NEWS 2019-03-25 21:46:41 +01:00
Niklas Keller 7f9872387e Fix #77794: Incorrect Date header format in built-in server
- Fix the date format to be compliant with https://tools.ietf.org/html/rfc7231#section-7.1.1.2
- Fix date format length and use GMT time
- Previously, local time was used instead of GMT.
- Remove extra whitespace
- Simplify string appends in php_cli_server.c
2019-03-25 21:41:45 +01:00
Nikita Popov e4d9d91462 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-25 17:45:03 +01:00
Vlad Temian ec2ecb7e12 Fix bug #77680: Correctly implement recursive mkdir on FTP stream
If the root directory was missing, an extra CWD without arguments was
made. Also, the MKD contained an empty string.

Now the CWD will use / and MKDs will be issued starting from the root
directory.
2019-03-25 17:43:46 +01:00
Nikita Popov e97577edde Fixed bug #77793
By making sure that we always first increment the refcount of the
new value before we destroy the old one.
2019-03-25 17:33:17 +01:00
Nikita Popov 91d4d175ab Merge branch 'PHP-7.2' into PHP-7.3 2019-03-25 16:43:21 +01:00
Nikita Popov 85095dfd09 Fixed bug #72175
Make sure we don't close the connection we're trying to reuse...
2019-03-25 16:41:21 +01:00
Joe Watkins 93740a2482 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  fix bug #76801: phpdbg too many open files error
2019-03-23 09:48:20 +01:00
Alessandro Chitolina b8b880932e fix bug #76801: phpdbg too many open files error 2019-03-23 09:47:49 +01:00
Remi Collet e68fd40e22 ensure pcre.jit=1 for this test 2019-03-22 15:31:36 +01:00
Remi Collet bb47fb0783 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  ensure pcre.jit=1 for these tests
2019-03-22 15:01:49 +01:00
Remi Collet 2e9dccef78 ensure pcre.jit=1 for these tests 2019-03-22 15:00:31 +01:00
Nikita Popov 30ddfd49ed Fixed bug #77773 2019-03-22 13:07:00 +01:00
Nikita Popov 620a753185 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-22 12:41:02 +01:00
Nikita Popov da35fa2cb8 Fixed bug #77772 2019-03-22 12:39:27 +01:00
Remi Collet 5c8d69bf6f fix test 2019-03-21 09:19:42 +01:00
Remi Collet cf65905974 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix tests after fix for #76717
2019-03-20 14:08:18 +01:00
Remi Collet a467a89f16 Fix tests after fix for #76717 2019-03-20 14:07:26 +01:00
Remi Collet 999370b756 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  NEWS
  Revert "Fix #77609: Tests from mailparse extension fails"
2019-03-20 11:55:06 +01:00
Remi Collet a785ccd21a NEWS 2019-03-20 11:54:49 +01:00
Remi Collet 32e7b0864c Revert "Fix #77609: Tests from mailparse extension fails"
This reverts commit 3ead672394.
2019-03-20 11:54:27 +01:00
Sara Golemon 4c55b1c16d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Bump versions for 7.2.18
2019-03-19 14:32:28 -04:00
Sara Golemon 963428a75d Bump versions for 7.2.18 2019-03-19 14:31:08 -04:00
Remi Collet 5686e6e33e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  comment out sqlite3.defensive = 1 follow common practice, this is the default value
2019-03-19 16:27:57 +01:00
Remi Collet 78c9a53df7 comment out sqlite3.defensive = 1
follow common practice, this is the default value
2019-03-19 16:26:26 +01:00
Christoph M. Becker a2de42041c Prepare main branch for PHP 7.3.5 2019-03-19 16:20:55 +01:00
Remi Collet c421d9afec fix test for upcoming pcre2 10.33
"group name ..." => "subpattern name ..."
2019-03-19 16:15:14 +01:00
Nikita Popov 661bce47ae Fixed bug #76127
Per documentation, and consistent with other preg functions, we
should return false if an error occurred.
2019-03-19 13:57:39 +01:00
Nikita Popov d53e9c7392 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-19 10:03:05 +01:00
Vlad Temian fe2885d80a Fixed bug #77765
Set mode 40755 for directories, via FTP stream stat.

Because we already manage to CWD into the current directory,
we should set 40755 as mode, instead of 40644.
2019-03-19 10:02:38 +01:00
Nikita Popov 20c261b2fe Merge branch 'PHP-7.2' into PHP-7.3 2019-03-19 09:55:42 +01:00
Miriam Lauter 09e522322a Fix #77767: phpdbg break command help message shows incorrect aliases
Previously the aliases for at and del were listed as A and d
in the help message for break. This patch corrects the aliases
to be @ and ~ respectively.
2019-03-19 09:55:10 +01:00
Christoph M. Becker 5ead86a35e Fix order 2019-03-18 20:07:38 +01:00
Christoph M. Becker a529826d95 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77578: Crash when php unload
2019-03-18 19:24:56 +01:00
Christoph M. Becker 41bc51ce2d Fix #77578: Crash when php unload
Since we're putting `ITypeLib *`s into the hash, we're getting
`ITypeLib *`s back, not `ITypeLib **`s.
2019-03-18 19:21:38 +01:00
Christoph M. Becker 7ef2fa6d0d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add bison version check to configure
2019-03-18 15:04:09 +01:00
Christoph M. Becker f21c054903 Add bison version check to configure
Since we're already checking for the minimum required re2c version,
also checking for the minimum required bison version is sensible.
2019-03-18 15:02:52 +01:00
Xinchen Hui ab8782d1e6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Simplfy test case
2019-03-18 19:30:11 +08:00
Xinchen Hui e072537e7f Simplfy test case
(I was working on the same bug while nikic committed the similar fix
2019-03-18 19:28:23 +08:00
Nikita Popov 763a7b8ca3 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-18 12:16:12 +01:00
Nikita Popov b3a669bec1 Make test independent of icu version
We don't really care about the actual output here, just that it
doesn't fail.
2019-03-18 12:14:58 +01:00
Nikita Popov 623a11d7de Merge branch 'PHP-7.2' into PHP-7.3 2019-03-18 11:39:58 +01:00
Nikita Popov 433758ceb3 Allow DateTimeImmutable in datefmt_format_object()
As pointed out in a comment on bug #65683.
2019-03-18 11:39:16 +01:00
Nikita Popov 82fbaab53c Merge branch 'PHP-7.2' into PHP-7.3 2019-03-18 11:07:27 +01:00
Nikita Popov 4f03401628 Partial fix for bug #77751
This avoids the segfault, but it will not make writing to the
SplFileObject during output shutdown work.
2019-03-18 11:06:23 +01:00
Nikita Popov da7add3525 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-18 10:51:00 +01:00
Nikita Popov 54bf8c820f Fixed bug #77743 2019-03-18 10:49:53 +01:00
Christoph M. Becker ad2d2e41de Fix #76956: Wrong value for 'syslog.filter' documented in php.ini 2019-03-18 10:19:30 +01:00
Nikita Popov c4464526cd Remove x86 bit test optimization
This is undefined behavior and we cannot rely on it. Additionally it
breaks builds using undefined behavior sanitizers.
2019-03-18 10:12:15 +01:00
Nikita Popov 00cfa1a367 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-18 10:11:25 +01:00
Nikita Popov a573c0e9ed Fix unused variable warning 2019-03-18 10:11:00 +01:00
Nikita Popov 61eebb559e Merge branch 'PHP-7.2' into PHP-7.3 2019-03-18 10:04:29 +01:00
twosee bd6eabd659 Don't disable object slot reuse while running shutdown functions
We only need to do this once we're running destructors. The current
approach interferes with some event loop code that runs everything
inside a shutdown function.
2019-03-18 10:02:31 +01:00
Derick Rethans d209ccd4cc Merge branch 'PHP-7.2' into PHP-7.3 2019-03-17 14:55:53 -04:00
Derick Rethans ab07bc1fff Fixed 7.2 compat issue 2019-03-17 14:53:56 -04:00
Derick Rethans 7e7ef44fab Merge branch 'PHP-7.2' into PHP-7.3 2019-03-17 14:38:04 -04:00
Derick Rethans 1307275b43 Merge branch 'pr/3888' into PHP-7.2 2019-03-17 14:37:52 -04:00
Ignace Nyamagana Butera 6eb83a63e1 Fixed bug #75113: Added DatePeriod::getRecurrences() method. 2019-03-17 14:37:35 -04:00
Pedro Magalhães 3a04b507ec Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Added test for #77535 fix
2019-03-15 18:12:55 +00:00
Pedro Magalhães f167b06d4c Added test for #77535 fix 2019-03-15 18:11:51 +00:00
Nikita Popov 7899f6a906 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-15 17:07:48 +01:00
Nikita Popov 97f9fd6949 Don't immediately destroy curl pushfunction 2019-03-15 17:07:19 +01:00
Xinchen Hui b419590893 Fixed bug #77697 (Crash on Big_Endian platform) 2019-03-15 16:58:08 +08:00
Nikita Popov 217c05da52 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-14 17:25:54 +01:00
Nikita Popov e7d40afb7a Fixed bug #77742
By avoiding integer overflow in the implementation entirely. The
multiplication was already explicitly checked for overflow, so also
add a check for the addition and remove the overflow checks after
the calculation.
2019-03-14 17:24:50 +01:00
Xinchen Hui 82174e68b6 updated NEWS 2019-03-14 16:47:16 +08:00
Xinchen Hui e3965913c4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77738 (Nullptr deref in zend_compile_expr)
2019-03-14 16:46:46 +08:00
Xinchen Hui c7920aba3e Fixed bug #77738 (Nullptr deref in zend_compile_expr) 2019-03-14 16:46:04 +08:00
Nikita Popov a7739be22f Fixed bug #77722 2019-03-12 09:58:09 +01:00
Anatol Belski 95c8f67a4c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Die hard if mc.exe or mt.exe not found
2019-03-11 20:59:23 +01:00
Anatol Belski 6814ba11bc Die hard if mc.exe or mt.exe not found
Even configure would pass, that producess quite subtle build errors
which are better to avoid at configure stage already.
2019-03-11 20:41:45 +01:00
bohwaz 58c25bf679 SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws 2019-03-11 18:02:03 +01:00
Christoph M. Becker e7ce7c6bb2 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
2019-03-11 16:30:16 +01:00
bohwaz e93259bb23 SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws 2019-03-11 16:26:15 +01:00
Nikita Popov 6818ca3c02 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-11 15:36:27 +01:00
Nikita Popov 1fd32e9c2f Fixed bug #76717
Print INT_MIN as -INT_MAX-1 to avoid it getting parsed as a float
literal due to integer overflow.
2019-03-11 15:35:02 +01:00
Jakub Zelenka f8850ccd85 Speed up TLS wrapper test for min and max versions 2019-03-10 16:36:13 +00:00
Jakub Zelenka ee4fa7d482 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-10 16:34:58 +00:00
Jakub Zelenka 769d2d9b62 Speed up TLS wrapper tests when SSLv3 disabled
If SSLv3 is disabled in OpenSSL, then sslv3 is not available so the accept
times out. This commit removes the extra accept if SSLv3 is disabled.
2019-03-10 16:23:44 +00:00
Anatol Belski 3e92365fa2 Update libmagic.patch [skip ci] 2019-03-08 21:55:15 +01:00
Fabien Villepinte d9a3cb0b36 Fix typo in libmagic version 2019-03-08 20:51:09 +01:00
Anatol Belski 65ffdc2adf Fixed bug #77576 pull the libmagic implementation of gmtime_r
PHP already has all the checks to handle the *_r function variants.
Thus, reusing it to get right symbols.
2019-03-08 20:32:15 +01:00
Anatol Belski 58cb3312d6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Sync with behavior change in OpenSSL 1.1.1b
  fix news
  bump versions after release
2019-03-08 15:55:34 +01:00
Anatol Belski 9177542b4d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Sync with behavior change in OpenSSL 1.1.1b
  fix news
  bump versions after release
2019-03-08 15:54:27 +01:00
Anatol Belski 66bd861fcd Sync with behavior change in OpenSSL 1.1.1b
A behavior change in revealed by some openssl_decrypt() based test,
where an encrypt API is used with a decrypt context. The EVP_Cipher*
functions will automatically choose the right operation depending on the
context passed.

(cherry picked from commit 19a44ffb7b)
2019-03-08 15:47:32 +01:00
Dmitry Stogov 0a416b3d97 ws 2019-03-07 13:59:18 +03:00
Dmitry Stogov 5da591c529 Fixed bug #77345 (Stack Overflow caused by circular reference in garbage collection) 2019-03-07 13:33:19 +03:00
Peter Kokot 59e76ec01d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update editorconfig
2019-03-07 01:05:22 +01:00
Peter Kokot 488544b336 Update editorconfig
Changes:
- New property max_line_length
- COMMIT_EDITMSG file added when writing commit messages
- Markdown files can have trimmed trailing whitespace also to simplify
  settings.
- https link used to EditorConfig page.
- Added also *.y, *.cpp, and *.inc files
- The tab_width moved to a new all files section
2019-03-07 01:03:56 +01:00
Christoph M. Becker 0d88388912 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77700: Writing truecolor images as GIF ignores interlace flag
2019-03-06 00:37:38 +01:00
Christoph M. Becker 41fb0eaa11 Fix #77700: Writing truecolor images as GIF ignores interlace flag
We  revert the interlace flag related part of commit ff2822a[1], since
contrary to the transparent color, the interlace flag is not retained
by `gdImageCreatePaletteFromTrueColor()`.  This also matches upstream
libgd.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=ff2822a82b740edb8ccf307f080bae188c200fb9>
2019-03-06 00:34:40 +01:00
Joe Watkins b6308f5b48 fix news 2019-03-05 20:50:07 +01:00
Joe Watkins 58c5df3d37 bump versions after release 2019-03-05 18:28:47 +01:00
Remi Collet 72bfb2523a Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  add NEWS entry
2019-03-05 07:32:54 +01:00
Remi Collet 0e836f523a add NEWS entry 2019-03-05 07:32:24 +01:00
Christoph M. Becker 007ac353dd Update NEWS 2019-03-04 19:50:41 +01:00
Stanislav Malyshev 609195e991 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77630 - safer rename() procedure
2019-03-04 09:18:22 -08:00
Stanislav Malyshev 2cc1ab81c2 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77630 - safer rename() procedure
2019-03-04 09:17:14 -08:00
Stanislav Malyshev e3133e4db7 Fix bug #77630 - safer rename() procedure
In order to rename safer, we do the following:
- set umask to 077 (unfortunately, not TS, so excluding ZTS)
- chown() first, to set proper group before allowing group access
- chmod() after, even if chown() fails
2019-03-04 09:15:11 -08:00
Anatol Belski a976283c34 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix test portability
2019-03-04 14:30:01 +01:00
Anatol Belski 040196972c Fix test portability 2019-03-04 14:28:47 +01:00
Christoph M. Becker 6ff0b24ef4 Update NEWS 2019-03-04 13:47:14 +01:00
Nikita Popov 4c68aaabf1 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-04 13:16:01 +01:00
Nikita Popov 3f00c9367d Fixed bug #77691
We cannot replace an op1_def opcode with an ASSIGN, if it also has
a used res_def. Usually this doesn't happen because the res_def use
can be eliminated first. The example is a case where operand replacement
on the res_def use fails.
2019-03-04 13:11:12 +01:00
Remi Collet 06f7c177c8 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  add NEWS entries
2019-03-04 11:09:17 +01:00
Remi Collet 2694953ada add NEWS entries 2019-03-04 11:09:01 +01:00
Stanislav Malyshev 6d60ed69a1 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77586 - phar_tar_writeheaders_int() buffer overflow
2019-03-03 23:33:48 -08:00
Stanislav Malyshev 3e8d8f7fb3 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77586 - phar_tar_writeheaders_int() buffer overflow
2019-03-03 23:33:43 -08:00
Stanislav Malyshev e0f5d62bd6 Fix bug #77586 - phar_tar_writeheaders_int() buffer overflow 2019-03-03 23:05:32 -08:00
Stanislav Malyshev e3f7c352dc Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
  Fix test error message
  Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE
  Fix bug #77540 - Invalid Read on exif_process_SOFn
  Fix integer overflows on 32-bits
  Fix #77431 SplFileInfo::__construct() accepts NUL bytes
  Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename
2019-03-03 22:20:42 -08:00
Stanislav Malyshev 8363df3703 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWS
  Fix test error message
  Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE
  Fix bug #77540 - Invalid Read on exif_process_SOFn
  Fix integer overflows on 32-bits
  Fix #77431 SplFileInfo::__construct() accepts NUL bytes
  Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename
2019-03-03 22:20:35 -08:00
Stanislav Malyshev 759e841b24 Update NEWS 2019-03-03 20:10:12 -08:00
Stanislav Malyshev 44f87fbf36 Fix test error message 2019-03-03 19:30:14 -08:00
Stanislav Malyshev 8ac6fee856 Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE
Also fix for bug #77659
2019-03-03 18:35:43 -08:00
Stanislav Malyshev 5f0e62a3e5 Fix bug #77540 - Invalid Read on exif_process_SOFn 2019-03-03 18:35:26 -08:00
Stanislav Malyshev 5e824a88d0 Fix integer overflows on 32-bits 2019-03-03 18:35:04 -08:00
Christoph M. Becker 254a5914ad Fix #77431 SplFileInfo::__construct() accepts NUL bytes
`SplFileInfo::__construct()` has to expect a path instead of a string,
analogous to `SplFileObject::__construct()`.
2019-03-03 18:23:46 -08:00
Stanislav Malyshev 7f0ab7c20c Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename 2019-03-03 18:22:32 -08:00
Peter Kokot fa574ddd6f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
  Fix shared module generation on AIX bug #77676
2019-03-02 18:52:01 +01:00
Peter Kokot 637713c1a4 Update NEWS 2019-03-02 18:50:33 +01:00
Kevin Adler 700f876a1a Fix shared module generation on AIX bug #77676
Makefiles for PHP extensions generated by phpize expect the PHP_MODULES
to contain a list of libtool .la files so that it can read the $dlname
variable from them by sourcing them in to a shell. On AIX, the code was
setting PHP_MODULES to a list of .so files, which meant the dlname was
blank, preventing the tests from being able to run.

Change the AIX code path in the PHP_SHARED_MODULE macro to match the
output on other platforms, using libtool .la files.
2019-03-02 18:45:55 +01:00
Peter Kokot c2fb85547d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
  Fix #77609: Tests from mailparse extension fails
2019-03-01 22:44:37 +01:00
Peter Kokot c39fb1fc4f Update NEWS 2019-03-01 22:44:22 +01:00
Ralf Habacker 3ead672394 Fix #77609: Tests from mailparse extension fails
Add installed php extensions to temporary created ini file

In php extensions configured with phpize, a temporarily generated
php.ini is used for testing, but currently contains no installed
PHP extensions, which is required by the mailparse extension,
for example.

Installed extensions must be added with their absolute path,
because the extension_dir parameter is already occupied.

See https://bugs.php.net/bug.php?id=77609
2019-03-01 22:32:01 +01:00
Nikita Popov 8be12e770f Merge branch 'PHP-7.2' into PHP-7.3 2019-03-01 14:55:15 +01:00
Jay Satiro 5025eb05bd curl_error: return an empty string if no error occurred
CURLOPT_ERRORBUFFER doc says "Do not rely on the contents of the
buffer unless an error code was returned." [1]

Prior to this change the error buffer was returned even if no error had
occurred, and that buffer may contain incorrect information in such a
case. [2]

[1]: https://curl.haxx.se/libcurl/c/CURLOPT_ERRORBUFFER.html
[2]: https://github.com/curl/curl/issues/3629
2019-03-01 14:54:37 +01:00
Nikita Popov 16cda039b5 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-01 14:51:55 +01:00
Kevin Adler 006355c9fa Fix bug #77677: WCOREDUMP not available on all systems
Add #ifdef WCOREDUMP around all uses.

Also Change core dump message to yes/no/unknown in lsapilib.
2019-03-01 14:51:15 +01:00
Nikita Popov 4dc0662eca Check for NULL GC type in objects_store_del
This might happen if OBJ_RELEASE is used on an object that was already
released by GC. Specific cases of this issue were previously fixed in
ffaee27478 and
72104d2b6e, however the issue still
affects 3rd-party extensions using OBJ_RELEASE.

The whole GC type NULL + OBJ_IS_VALID + IS_FREE_CALLED system seems
overly complicated and can probably be simplified in 7.4.
2019-03-01 14:32:11 +01:00
Derick Rethans d63a7aa6cf Merge branch 'PHP-7.2' into PHP-7.3 2019-02-28 13:51:10 +00:00
Derick Rethans 7d001aff03 Merge branch 'DateIntervalBogusData' into PHP-7.2 2019-02-28 13:50:58 +00:00
Derick Rethans a890c5beb8 Fixed bug #50020 (DateInterval:createDateFromString() silently fails) 2019-02-28 13:50:35 +00:00
Anatol Belski 58d3dd466f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Sync with behavior change in OpenSSL 1.1.1b
2019-02-28 12:52:28 +01:00
Anatol Belski 19a44ffb7b Sync with behavior change in OpenSSL 1.1.1b
A behavior change in revealed by some openssl_decrypt() based test,
where an encrypt API is used with a decrypt context. The EVP_Cipher*
functions will automatically choose the right operation depending on the
context passed.
2019-02-28 12:48:47 +01:00
Nikita Popov 019fd1d9ba Merge branch 'PHP-7.2' into PHP-7.3 2019-02-28 09:58:47 +01:00
Nikita Popov 9ad9cc71ff Fixed bug #77669 2019-02-28 09:58:01 +01:00
Nikita Popov 461e140afc Merge branch 'PHP-7.2' into PHP-7.3 2019-02-25 13:01:18 +01:00
Nikita Popov af37d58cf7 Fix assertion in Exception::getMessage() if $message is a ref
And same for other properties. Encountered in Symfony.
2019-02-25 13:00:16 +01:00
Xinchen Hui 4ac954ac3e Fixed compiler warning 2019-02-25 15:04:04 +08:00
Xinchen Hui fb3f078eeb Update NEWS 2019-02-25 15:00:37 +08:00
Xinchen Hui e8768b338c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77660 (Segmentation fault on break 2147483648)
2019-02-25 15:00:23 +08:00
Xinchen Hui 1c22ace058 Fixed bug #77660 (Segmentation fault on break 2147483648) 2019-02-25 15:00:14 +08:00
Xinchen Hui 3b5475e9ee Update NEWS 2019-02-25 14:42:18 +08:00
Xinchen Hui 3c3d59aa39 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77664 (Segmentation fault when using undefined constant in custom wrapper)
2019-02-25 14:42:01 +08:00
Xinchen Hui 4a72dd782d Fixed bug #77664 (Segmentation fault when using undefined constant in custom wrapper) 2019-02-25 14:41:46 +08:00
Jakub Zelenka 900d4cdb9e Merge branch 'PHP-7.2' into PHP-7.3 2019-02-24 13:14:36 +00:00
Jakub Zelenka 01c00953ff Print empty string in test for but 77390 just once 2019-02-24 13:11:27 +00:00
Jakub Zelenka c814b34b1d Use spaces instead of tabs in bug 77390 test 2019-02-24 13:05:43 +00:00
Nikita Popov 66fda0cdb1 Remove result def during jmp_set optimization 2019-02-22 13:41:47 +01:00
Nikita Popov 33c2b47de3 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-22 12:00:20 +01:00
Nikita Popov 2cfb09caa7 Fix inference warning about missing key type 2019-02-22 11:55:16 +01:00
Christoph M. Becker 831eba0eac Fix #77648: BOM in sapi/apache2handler/php_functions.c 2019-02-22 11:10:50 +01:00
Nikita Popov bd2a00acdf Merge branch 'PHP-7.2' into PHP-7.3 2019-02-22 10:13:21 +01:00
Nikita Popov 5388143855 Fixed bug #77652 2019-02-22 10:11:54 +01:00
Frank Denis 5c221bcd01 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77646
2019-02-21 16:34:42 +01:00
Frank Denis 08089b575b Fix bug #77646 2019-02-21 16:33:03 +01:00
Frank Denis e7ca69f1fa Fix bug #77646 2019-02-21 16:14:33 +01:00
Nikita Popov e5d8ac92a4 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-21 13:45:53 +01:00
Nikita Popov 934691fabb Fixed bug #77597
The same variable was reused in two nested loops... The test doesn't
fail on 7.2, but I'm fixing this here anyway as the code is clearly
wrong, and probably erroneous in other situations.
2019-02-21 13:42:47 +01:00
Nikita Popov af324e24df Fix issue mentioned in #77302
Apparently Serializable::serialize() can return NULL, which is encoded
as N;. As we do not allow back-references to non-object values in
PHP 7.3 we need to make sure that any references are also compiled to
N;.
2019-02-21 12:04:49 +01:00
Nikita Popov b3e0e555c8 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-20 12:11:56 +01:00
Abyr Valg 74888bede8 OpenSSL: Improve non-blocking eof test 2019-02-20 12:11:30 +01:00
Christopher Jones 4a6a9c79fd Merge branch 'PHP-7.2' into PHP-7.3 2019-02-20 11:11:06 +11:00
Christopher Jones 7a9c20f3fd Correct skipif use for OCI8 password tests 2019-02-20 11:10:57 +11:00
Christoph M. Becker 2ec59b3ef3 Prepare main branch for PHP 7.3.4 2019-02-19 13:06:40 +01:00
Remi Collet 961900fa17 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  bump version to 7.2.17-dev
2019-02-19 12:47:00 +01:00
Remi Collet b243f2feca bump version to 7.2.17-dev 2019-02-19 12:46:52 +01:00
Nikita Popov 3b3fafa637 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-18 14:04:15 +01:00
Nikita Popov 928c42211f Make MADV_HUGEPAGE conditional on USE_ZEND_ALLOC_HUGE_PAGES
There have been multiple reports of large slowdowns due to the
use of MADV_HUGEPAGE, so make it conditional on
USE_ZEND_ALLOC_HUGE_PAGES, just like MAP_HUGETLB already is.
2019-02-18 14:03:07 +01:00
Christoph M. Becker 767fa3dc02 Fix #77626: Persistence confusion in php_com_import_typelib()
We apply only the most minimal fix here, and will cater to the
unnecessary re-allocation for PHP-7.4.

We don't need to add a regression test, since bug39606.phpt and
bug77621.phpt already show the misbehavior.
2019-02-15 18:56:24 +01:00
Christoph M. Becker 8946ad3000 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77621: Already defined constants are not properly reported
2019-02-15 00:37:39 +01:00
Christoph M. Becker de738496c2 Fix #77621: Already defined constants are not properly reported
We must not check uninitialized values (i.e. `c.value`), and we have to
use proper types for printf-style formats (i.e. `char *` instead of
`zend_string *`).
2019-02-15 00:35:21 +01:00
Nikita Popov eb063c8a9f Fixed bug #77612
Port php_setcookie() to use the smart_str API to ensure that there
can be no string truncation issues.
2019-02-14 10:42:59 +01:00
Nikita Popov 7bc162f928 Work around compiler flag dependent ABI 2019-02-14 09:59:10 +01:00
Peter Kokot a89948320b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Refactor timelib.m4
2019-02-13 19:26:02 +01:00
Peter Kokot 0ffa84d740 Refactor timelib.m4
The ext/date/lib is bundled library and also includes additional
timelib.m4 macros and checks specific for PHP.

All the checks in the timelib.m4 are already done in the PHP's
configure.ac:
- headers except for io.h and strings.h
- two functions checked strftime and gettimeofday
- if size of longint is 8
- if size of int is 4
- int32_t and uint32_t types using the PHP_CHECK_STDINT_TYPES

Macro `AC_TIMELIB_C_BIGENDIAN` defined in timelib.m4 is not used.

The two checkings for strtoll and atoll have been moved to date extension's
config0.m4 file.

Additional check for headers <io.h> and <strings.h> has been added to
config0.m4 of the date extension.

Therefore the timelib.m4 can be simplified and removed from the bundled
library to have easier maintenance in the later branches and also
upstream library.
2019-02-13 19:24:39 +01:00
Johannes Schlüter aa7fbdf2cd Merge branch 'PHP-7.2' into PHP-7.3 2019-02-12 15:00:15 +01:00
Johannes Schlüter a4bce453bc Merge remote-tracking branch 'origin/PHP-7.3' into PHP-7.3 2019-02-12 14:59:59 +01:00
Johannes Schlüter 56dba3f3d0 Merge remote-tracking branch 'origin/PHP-7.2' into PHP-7.2 2019-02-12 14:59:27 +01:00
Nikita Popov 5297bed454 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-12 11:43:34 +01:00
DanielCiochiu 07877c46e3 Fixed bug #75546
By respecting the SILENT flag when checking the visibility of a
class constant.
2019-02-12 11:42:33 +01:00
Nikita Popov 2ea5a9cc64 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-12 10:50:22 +01:00
Nikita Popov 8e34de4756 Fixed bug #77608
Remove special handling of doubles and escape them as usual instead.
2019-02-12 10:49:20 +01:00
Nikita Popov 97dd1591af Merge branch 'PHP-7.2' into PHP-7.3 2019-02-12 10:10:22 +01:00
hsldymq b5cb3ac8ec Make pid & uid available while handling realtime signals 2019-02-12 10:09:33 +01:00
Nikita Popov 8ed775f548 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-12 09:57:18 +01:00
Nikita Popov a109fddba4 Remove "defensive copy" of DatePeriod properties
get_properties() constructs these as fresh objects with no relation
to the internals, there is no need to clone them again. Additionally
the current implementation leaks memory, because the original objects
are never freed (see PR #3121).
2019-02-12 09:54:52 +01:00
Nikita Popov c553d17f11 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-12 09:29:05 +01:00
Ben Ramsey c4294440ff Fixed bug #77564: Memory leak in exif_process_IFD_TAG
The memory leak occurs when more than one UserComment tag is present in
the EXIF data. It's still considered corrupt EXIF data, but this ensures
the memory is freed before trying to set to already allocated memory.
2019-02-12 09:28:33 +01:00
Dmitry Stogov b6e58dcd22 Fixed bug #77599 (Unbuffered queries; native prepared statements memory leak) 2019-02-12 10:55:05 +03:00
Dmitry Stogov 470f5891d4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Avoid dependency on "struct flock" fields order.
2019-02-12 10:21:59 +03:00
Dmitry Stogov 9222702633 Avoid dependency on "struct flock" fields order. 2019-02-12 10:15:16 +03:00
Anatol Belski b71146bde4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Replace broken binary SDK version
2019-02-11 22:30:28 -08:00
Anatol Belski 186b5de575 Replace broken binary SDK version 2019-02-11 22:28:34 -08:00
Anatol Belski ee0963c58c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update SDK version for AppVeyor
2019-02-11 22:13:42 -08:00
Anatol Belski e74a918621 Update SDK version for AppVeyor 2019-02-11 22:12:16 -08:00
Darek Slusarczyk 6f7a47db5d Merge branch 'PHP-7.2' into PHP-7.3 2019-02-11 18:18:57 +01:00
Darek Slusarczyk 83d2bc9b6d Merge branch 'PHP-7.1' into PHP-7.2 2019-02-11 18:08:21 +01:00
Darek Slusarczyk 2eaabf06fc security fix - by default 'local infile' is disabled:
- set default for mysqli.allow_local_infile=0
- explicitly disable PDO::MYSQL_ATTR_LOCAL_INFILE in case of lack of driver options
- add getAttribute support for PDO::MYSQL_ATTR_LOCAL_INFILE
- update existing tests where needed
- add new tests [checking default value and setting on] the 'local infile' in ext/mysqli and ext/pdo_mysql
2019-02-11 18:04:51 +01:00
Nikita Popov 4da67537c1 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-11 15:50:47 +01:00
Ahmed Abdou ec28d4c247 Fix bug #51068 (glob:// do not support current path relative)
Fix DirectoryIterator glob://* current path relative queries
2019-02-11 15:50:27 +01:00
Nikita Popov be64a06b1c Merge branch 'PHP-7.2' into PHP-7.3 2019-02-11 11:33:04 +01:00
johnstevenson fe4d7248cc Fix #77552: Uninitialized buffer in stat functions 2019-02-11 11:31:55 +01:00
Guilliam Xavier b3935ed2af Fix tests bareword fallback with error suppression
(cherry picked from commit aad39879f2)
(cherry picked from commit 76f8a908bb)
2019-02-11 09:36:03 +01:00
Xinchen Hui 515c51953f regenerate with re2c 1.0.3 2019-02-11 15:42:55 +08:00
Xinchen Hui 4f044f680c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77589 (Core dump using parse_ini_string with numeric sections)

Conflicts:
	Zend/zend_ini_scanner.c
2019-02-11 15:33:59 +08:00
Xinchen Hui 92055ca79b Fixed bug #77589 (Core dump using parse_ini_string with numeric sections)
Section name should not be typed(NULL, FALSE, TRUE etc)
2019-02-11 15:27:29 +08:00
Christopher Jones bdce2954c3 Merge PDO_OCI PR 2019-02-11 16:38:23 +11:00
Christopher Jones 983ba59e3e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  PDO_OCI tracing attribute PR merge
  pdo_oci: Add client identifier and module attrs
  pdo_oci: Register new attr constants and add tests
  pdo_oci: Add PDO_OCI_ATTR_ACTION and CLIENT_INFO
2019-02-11 16:36:39 +11:00
Christopher Jones 1f86dcdd13 PDO_OCI tracing attribute PR merge 2019-02-11 16:19:13 +11:00
Cameron Porter 38363f4820 pdo_oci: Add client identifier and module attrs
Add tests for the new attributes, and check the setAttribute return
value.
2019-02-11 16:10:47 +11:00
Cameron Porter fc940f0703 pdo_oci: Register new attr constants and add tests 2019-02-11 16:10:47 +11:00
Cameron Porter a095472e62 pdo_oci: Add PDO_OCI_ATTR_ACTION and CLIENT_INFO
Add the ability to set the action and client info on the database
session for PDO OCI using PDO attributes.
2019-02-11 16:10:47 +11:00
Nikita Popov 471b1d54d5 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-08 10:09:39 +01:00
YanTao 3b09123de3 Fix FTPS passive mode of data channel event poll
Bugfix: when using passive mode of FTPS protocol, data channel events
should be polled when creating data connection channel, instead of polling
the event of ftp's self control channel, which may cause ftp transfer
problem while using ftps and passive mode.
2019-02-08 09:50:29 +01:00
Anatol Belski 1bbf7013c8 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Sync test with changes in libcurl 7.64.0
  Sync test for libcurl 7.64.0
2019-02-07 22:28:45 -08:00
Anatol Belski e27301c7b3 Sync test with changes in libcurl 7.64.0 2019-02-07 22:22:38 -08:00
Anatol Belski c9f0e12353 Sync test for libcurl 7.64.0 2019-02-07 22:21:59 -08:00
Derick Rethans 65d81833bb Use pkg-config for ICU, as the old icu-config has been deprecated 2019-02-07 14:00:39 +01:00
Derick Rethans 8be649d908 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-07 11:12:42 +00:00
Derick Rethans e2edaa0cee Use pkg-config for ICU, as the old icu-config has been deprecated 2019-02-07 10:18:32 +00:00
Christoph M. Becker b2907527e9 Fix NEWS
Bug #77287 is already fixed in PHP 7.3.2.
2019-02-05 23:04:31 +01:00
Christoph M. Becker c0228f741e [ci skip] Add missing notes regarding gc_status() 2019-02-03 18:28:43 +01:00
Joe Watkins e1c93d1fb2 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Properly check for array_replace_recursive in sccp.c
2019-02-03 08:41:26 +01:00
Tyson Andre cf56832d00 Properly check for array_replace_recursive in sccp.c
Due to a typo, this code used to check for array_merge_recursive
twice.
2019-02-03 08:40:21 +01:00
Dmitry Stogov 203a2da30a Fixed bug #77329 (Buffer Overflow via overly long Error Messages) 2019-02-01 11:11:15 +03:00
Joe Watkins 7d1df603ad Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug 76596: phpdbg supports display_errors=stderr
2019-01-30 18:28:25 +01:00
Kevin Abel 3890c8bce5 Fix bug 76596: phpdbg supports display_errors=stderr 2019-01-30 18:27:57 +01:00
Guillaume Degoulet f27f902266 Fix #77546 iptcembed broken function 2019-01-30 17:09:12 +01:00
Christoph M. Becker 362d6ce834 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Prepare main branch for PHP 7.2.16
2019-01-30 01:29:05 +01:00
Christoph M. Becker cbc5a141f7 Prepare main branch for PHP 7.2.16 2019-01-30 01:27:57 +01:00
Nikita Popov 14684af0d0 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-29 09:40:06 +01:00
Nikita Popov 34898e9766 Make special assert() handling independent of compiler flags 2019-01-29 09:39:12 +01:00
Nikita Popov ab3c94a54f Merge branch 'PHP-7.2' into PHP-7.3 2019-01-28 09:23:23 +01:00
ekinhbayar ef68cd3249 Fixed bug #77530: PHP crashes when parsing "(2)::class" 2019-01-28 09:22:18 +01:00
Jakub Zelenka 0da13086bd Merge branch 'PHP-7.2' into PHP-7.3 2019-01-25 14:16:08 +00:00
Jakub Zelenka dc2ffdeed7 Fix bug #77390 (feof might hang on TLS streams in case of fragmented TLS records)
Simplified version of the fix from Abyl Valg so credit to him.
2019-01-25 14:13:11 +00:00
Jakub Zelenka d9b29029f9 Update and integrate openssl client proxy test 2019-01-25 14:09:55 +00:00
Abyr Valg 0c84c2ef50 Add a test for fragmented SSL packets 2019-01-25 14:09:55 +00:00
Nikita Popov f78e681428 Fixed bug #77498
I've renamed the function to the same name as the exported symbol
in master.
2019-01-25 11:01:06 +01:00
Nikita Popov 3c98c2d0cb Fixed bug #77514 2019-01-24 15:13:49 +01:00
Nikita Popov d460e06cb9 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-24 13:45:40 +01:00
Nikita Popov 08c5679380 Merge remote-tracking branch 'php-src/PHP-7.2' into PHP-7.2 2019-01-24 13:45:27 +01:00
Nikita Popov e926dc9305 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-24 13:40:36 +01:00
Nikita Popov cce2e33c84 Revert "Prefix error_code with underscore in FastZPP implementation"
This reverts commit 6305119a51.

This is a source-compatibility break for extensions that define
custom FastZPP macros, such as ext/uv:

https://github.com/bwoebi/php-uv/blob/a983eb17b69f74a45d785ddc6a7bff3d4531b88c/php_uv.c#L75

I don't think that FastZPP was intended to be used this way, but
let's revert this from release branches to avoid extension breakage.
2019-01-24 13:36:47 +01:00
Dmitry Stogov aa9a8dbda3 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77494 (Disabling class causes segfault on member access)
2019-01-24 13:07:31 +03:00
Dmitry Stogov 73f222d722 Fixed bug #77494 (Disabling class causes segfault on member access) 2019-01-24 13:06:36 +03:00
Nikita Popov e0f97ae7ec Merge branch 'PHP-7.2' into PHP-7.3 2019-01-24 10:57:45 +01:00
Nikita Popov 526344aa5e Add flag to disable jumptable optimization
This is useful for coverage. While it is currently safe to just
skip over the SWITCH_* opcodes, this may not be true in the future
due to opcache optimizations, so it's safer to disable emission of
SWITCH_* opcodes entirely.
2019-01-24 10:56:04 +01:00
Christoph M. Becker 19a9a6ba24 Prepare main branch for PHP 7.3.3 2019-01-22 14:04:03 +01:00
Nikita Popov 76760901fa Fixed bug #77287
There may be an EXT_NOP opcode before the parameter list, we should
skip over it.
2019-01-22 12:15:06 +01:00
George Wang 6a0a600176 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-20 15:11:37 -05:00
George Wang 66d72377d0 Checkin LiteSpeed SAPI 7.2. 2019-01-20 15:10:19 -05:00
Anatol Belski a1b1c53d13 Update NEWS [ci skip] 2019-01-20 16:00:25 +01:00
Anatol Belski 969e57c7ac Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS [ci skip]
2019-01-20 15:59:08 +01:00
Anatol Belski d978590c74 Update NEWS [ci skip] 2019-01-20 15:58:19 +01:00
Anatol Belski 52730fa30a Skip test on unsuitable build
This test reveals a difference between TS and NTS through all the
versions, which is probably too late to fix at this stage of 7.3.
While NTS always relies on the system getcwd(), TS uses a fake CWD
which might get out of sync when the real dir is deleted. Thus,
skip test on unsuitable build. Investigate possibilities to fix this
edge case for later versions.
2019-01-19 13:53:32 +01:00
Christoph M. Becker 2966da70cf Fix failing test 2019-01-19 11:13:13 +01:00
Christoph M. Becker 1907cbd8b3 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77479: imagewbmp() segfaults with very large images
2019-01-19 10:18:20 +01:00
Christoph M. Becker 44fa0b0f31 Fix #77479: imagewbmp() segfaults with very large images
We must not proceed working with the Wbmp structure, if it hasn't been
allocated.
2019-01-19 10:16:02 +01:00
Anatol Belski 4254bf87ba Make test output more reliable 2019-01-19 03:33:37 +01:00
Anatol Belski 8b20e7b68b Fixed bug #77484 Zend engine crashes when calling realpath in invalid working dir 2019-01-19 02:36:51 +01:00
Nikita Popov 986b9b5ae3 Add additional no_sanitize_address attributes
To fix bug #77447 in release mode as well.
2019-01-18 15:02:30 +01:00
Nikita Popov 14b5302591 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-18 12:48:52 +01:00
Lauri Kenttä dbe7f2a41a Fix seeking in php://input 2019-01-18 12:44:47 +01:00
Nikita Popov de38ce1a2e Merge branch 'PHP-7.2' into PHP-7.3 2019-01-18 12:05:11 +01:00
Pedro Magalhães 32ae716037 Fixed bug #76675
Leave a reference to the resource in the php_curl.
2019-01-18 12:04:25 +01:00
Jakub Zelenka 25ffdc8dc9 List me in the openssl maintainers
I have been basically doing that since 2015 or so
2019-01-17 20:04:44 +00:00
Jakub Zelenka 766b4fd515 Fix bug #77430 (php-fpm crashes with Main process exited) 2019-01-17 18:37:09 +00:00
Christoph M. Becker 26b5aa8584 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #73614: gdImageFilledArc() doesn't properly draw pies
2019-01-16 20:22:37 +01:00
Christoph M. Becker 61cfa34e11 Fix #73614: gdImageFilledArc() doesn't properly draw pies
The fix for PHP bug 43828[1] changed the algorithm from drawing filled
pies from drawing multiple triangles to drawing a single polygon.  Due
to quirks of the filled polygon drawing algorithm, we had to filter out
extraneous vertices.  This lead, however, to a bug regarding displaced
starting and ending points near 90° and 270° degrees, which we fix by
reinserting these vertices if they had been removed.

This fix is a port of libgd/libgd@1406b1a.

[1] <https://bugs.php.net/bug.php?id=43828>
2019-01-16 20:10:04 +01:00
Dmitry Stogov 1a306cc9a1 Fixed bug #77308 (Unbuffered queries memory leak) 2019-01-14 13:59:30 +03:00
Nikita Popov 5c3b17ca68 Merge branch 'PHP-7.2' into PHP-7.3
[ci skip]
2019-01-14 11:49:58 +01:00
wbob 5ac9990ddf document open_basedir and realpath cache coupling in php.ini
[ci skip]
2019-01-14 11:49:45 +01:00
Nikita Popov c8c5a3ab8a Fixed bug #77447
By disabling asan for CPU support helpers used in ifunc resolvers.
2019-01-14 11:44:48 +01:00
Dmitry Stogov 920450534e Fixed bug #77263 (Segfault when using 2 RecursiveFilterIterator) 2019-01-14 13:18:28 +03:00
Nikita Popov d6212835f2 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-14 10:23:44 +01:00
Nikita Popov 3ad0ebdf5c Fixed bug #77454 2019-01-14 10:22:48 +01:00
Anatol Belski e3e2a7f7a8 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update SDK version for AppVeyor
2019-01-12 22:14:35 +01:00
Anatol Belski 8f66ca8189 Update SDK version for AppVeyor 2019-01-12 22:13:14 +01:00
Nikita Popov b35a20e919 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-11 10:55:26 +01:00
Ondřej Surý 1ea58b6e78 Fix rl_completion_matches detection
Also fix a typo when checking for rl_on_new_line in readline library.
2019-01-11 10:55:07 +01:00
Nikita Popov e6eac08abd Merge branch 'PHP-7.2' into PHP-7.3 2019-01-11 10:29:34 +01:00
Kevin Adler 332b58f865 Fix bug #77361 (configure fails on 64-bit AIX when opcache enabled)
In f904830012, support for GNU Hurd was added to the opcache and
the configure check to ensure the opcache knows the flock struct
layout prior to building was changed check for two cases: BSD layout
and Linux layout. All the existing hard-coded cases in
ZendAccelerator.h follow these two cases, except for 64-bit AIX.
This means that even though building on 64-bit AIX would work,
the configure script refuses to continue.

Add a new configure check for the 64-bit AIX case and a new
compiler definition HAVE_FLOCK_AIX64. Now that all the cases are
covered, simplify the ifdef logic around these three HAVE_FLOCK_*
macros:
- The macOS and the various BSD flavors fall under HAVE_FLOCK_BSD
- Linux, HP-UX, GNU Hurd, 32-bit AIX, and SVR4 environments
  fall under HAVE_FLOCK_LINUX
- 64-bit AIX falls under HAVE_FLOCK_AIX64

The only difference between the existing HAVE_FLOCK_LINUX and
the hard-coded Linux/HP-UX/Hurd case is that the latter
initialized the 5th member to 0, but since the C standard already
says that un-initialized members will be initialized to 0,
it's effectively the same.
2019-01-11 10:21:02 +01:00
Jakub Zelenka 9c010cefa3 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-10 20:16:06 +00:00
Alexander Kurilo 1a1e12c2a9 Fix cleaning up after openssl_pkcs7_verify_basic test 2019-01-10 20:09:42 +00:00
Alexander Kurilo 1fab01be5b Generate certs for openssl tests on the fly
The idea is to create an easy way to provide a certificate that never
expires. In order to make it cross-platform, PHP is used rather than
openssl CLI app. Using openssl to generate certificates for tests that
test openssl might be not the best idea but pros seem to outweight cons
that this "recursice dependency" adds
2019-01-10 20:09:42 +00:00
Christoph M. Becker 3f9ddeb122 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #73281: imagescale(…, IMG_BILINEAR_FIXED) can cause black border
2019-01-10 16:27:43 +01:00
Christoph M. Becker 6b4cdbaade Fix #73281: imagescale(…, IMG_BILINEAR_FIXED) can cause black border
We port the upstream fixes for libgd/libgd#329 and libgd/libgd#224.
2019-01-10 16:11:23 +01:00
Christoph M. Becker 1e407256f2 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77272: imagescale() may return image resource on failure
2019-01-10 14:25:11 +01:00
Christoph M. Becker 772b1cb245 Fix #77272: imagescale() may return image resource on failure
`_gdScaleHoriz()` and `_gdScaleVert()` may fail, but don't signal
failure since they are void functions.  We change that according to
upstream libgd.

We also remove the unused `Scale()` function, which doesn't exist in
upstream libgd either, right away.
2019-01-10 14:05:09 +01:00
Nikita Popov 00e5d0e859 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-10 10:57:41 +01:00
Nikita Popov 5d33024a5d Fixed bug #77439 2019-01-10 10:57:04 +01:00
Nikita Popov ade702a0d2 Fixed bug #77434
Mark arrays containing partial arrays as partial. This was already
done for the ADD_ARRAY_ELEMENT case, but not for ASSIGN_DIM.
2019-01-10 10:25:55 +01:00
Xinchen Hui 16176ad0e3 Incase of invalid read 2019-01-10 14:50:39 +08:00
Anatol Belski 300249226b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Revert visibility
2019-01-09 16:16:47 +01:00
Andrey Hristov 7a88f89a90 Revert visibility
(cherry picked from commit 71ffae9605)
2019-01-09 13:39:48 +01:00
Christoph M. Becker c4c6b80b9c Sync NEWS with 7.3.1
All these bugs are fixed in PHP-7.3.1 already.
2019-01-09 11:46:48 +01:00
Lauri Kenttä 63c38c9e49 Fixed bug #77289
Use mysqlnd_restart_psession and mysqlnd_end_psession in PDO MySQL.
This makes sure we free last_message while ZMM is still live.
2019-01-09 09:50:26 +01:00
Nikita Popov bf4dab0163 Make operator swapping depend on IGNORE_OVERLOADING flag
Add MUL back to the list and instead make the entire optimization
depend on IGNORE_OVERLOADING, which is there exactly so we can make
these kinds of assumptions.
2019-01-09 09:27:56 +01:00
Sara Golemon 85f440362b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Bump for 7.1.27
2019-01-08 14:20:18 -05:00
Sara Golemon bbc10549e8 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Bump for 7.1.27
2019-01-08 14:19:37 -05:00
Sara Golemon fabade1573 Bump for 7.1.27 2019-01-08 14:17:43 -05:00
Xinchen Hui cd49db9d47 Fixed bug #77266 (Assertion failed in dce_live_ranges) 2019-01-08 19:19:01 +08:00
Nikita Popov 76c687feaf Fixed bug #77428
mb_ereg_replace historically has not supported escaping backslashes
with backslashes. Go back to that behavior for BC reasons.
2019-01-08 10:21:01 +01:00
Nikita Popov 7f8cab2535 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-08 09:38:02 +01:00
Nikita Popov 1165a9068c Don't swap operands of ZEND_MUL
If this is used with operator overloading, then the operation does
not necessarily commute (for example, matrix multiplication).
2019-01-08 09:37:49 +01:00
Remi Collet b9072788cd Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  cleanup merge
2019-01-08 09:34:05 +01:00
Remi Collet 0d9935739c cleanup merge 2019-01-08 09:33:41 +01:00
Nikita Popov f7a7d32e65 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-08 09:26:31 +01:00
twosee 6305119a51 Prefix error_code with underscore in FastZPP implementation
To avoid conflicts with parameter names.
2019-01-08 09:25:35 +01:00
Derick Rethans 24b446291d Merge branch 'PHP-7.2' into PHP-7.3 2019-01-07 12:48:49 +00:00
Derick Rethans bd1d2c7bfe Update tests due to data changes in tzdata 2018i 2019-01-07 12:48:42 +00:00
Christoph M. Becker deb88f2269 Fix NEWS
The fixes for bug #77359 and #77360 have been ported to PHP-7.3.1, and
the release has been postponed by one week.
2019-01-07 13:11:04 +01:00
Derick Rethans 11105e90c4 Updated to version 2018.9 (2018i) 2019-01-07 11:50:16 +00:00
Derick Rethans 7ad9d6a63b Empty merge 2019-01-07 11:50:16 +00:00
Derick Rethans 81da7f75e3 Updated to version 2018.9 (2018i) 2019-01-07 11:50:14 +00:00
Remi Collet ddccc1db73 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] fix NEWS
2019-01-07 11:12:46 +01:00
Remi Collet 3e780d7f25 [ci skip] fix NEWS 2019-01-07 11:12:13 +01:00
Remi Collet 88fc59d4c9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] fix NEWS
2019-01-07 11:02:58 +01:00
Remi Collet 03a630ded7 [ci skip] fix NEWS 2019-01-07 11:02:40 +01:00
Nikita Popov 6f75890e7b Fix one issue reported in bug #77310
SCCP did not handle array ASSIGN_* with a BOT operand correctly.
2019-01-07 10:05:23 +01:00
Stanislav Malyshev b5669d207b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Still leaking for some reason, XFAIL for now, I'll look into it later.
2019-01-07 01:04:16 -08:00
Stanislav Malyshev 289c45109c Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Still leaking for some reason, XFAIL for now, I'll look into it later.
2019-01-07 01:03:26 -08:00
Stanislav Malyshev 27625f063e Still leaking for some reason, XFAIL for now, I'll look into it later. 2019-01-07 01:03:04 -08:00
Stanislav Malyshev aeec40cb50 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77418 - Heap overflow in utf32be_mbc_to_code
  Add NEWS
  [ci skip] Add NEWS
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 23:35:09 -08:00
Stanislav Malyshev cfe77ea543 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77418 - Heap overflow in utf32be_mbc_to_code
  Add NEWS
  [ci skip] Add NEWS
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 23:34:26 -08:00
Stanislav Malyshev 1afebfb3fa Merge branch 'PHP-5.6' into PHP-7.1
* PHP-5.6:
  Fix bug #77418 - Heap overflow in utf32be_mbc_to_code
  [ci skip] Add NEWS
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 23:33:34 -08:00
Stanislav Malyshev 9d6c59eeea Fix bug #77418 - Heap overflow in utf32be_mbc_to_code 2019-01-06 23:31:15 -08:00
Stanislav Malyshev 7ed3cfb2e8 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix tests - newer versions check Unicode
  Add NEWS
  Fix test
2019-01-06 13:50:28 -08:00
Stanislav Malyshev d0d0d922de Fix tests - newer versions check Unicode 2019-01-06 13:28:30 -08:00
Stanislav Malyshev 1b7c599a02 Add NEWS 2019-01-06 13:11:55 -08:00
Stanislav Malyshev fc02e7e3fe Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Add NEWS
2019-01-06 13:08:48 -08:00
Stanislav Malyshev 08bb0ce4e4 Add NEWS 2019-01-06 13:08:24 -08:00
Stanislav Malyshev 25c95752d6 Add NEWS 2019-01-06 13:04:51 -08:00
Stanislav Malyshev b51eaf4166 [ci skip] Add NEWS 2019-01-06 13:03:38 -08:00
Stanislav Malyshev ed4db1bb22 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix test
2019-01-06 12:54:09 -08:00
Stanislav Malyshev 0c35032012 Fix test 2019-01-06 12:30:44 -08:00
Christoph M. Becker e617f03066 Fix #77367: Negative size parameter in mb_split
When adding the last element to the result value of `mb_split`, the
`chunk_pos` may point beyond the end of the string, in which case the
unsigned `n` would underflow.  Therefore, we check whether this is the
case in the first place, and only calculate `n` otherwise.  Since `n`
is no longer used outside the block, we move its declaration inside.
2019-01-06 12:24:15 -08:00
Stanislav Malyshev e40027ef0f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77369 - memcpy with negative length via crafted DNS response
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 12:23:53 -08:00
Stanislav Malyshev fe820fcba6 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77369 - memcpy with negative length via crafted DNS response
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 11:57:16 -08:00
Stanislav Malyshev 8d3dfabef4 Fix #77369 - memcpy with negative length via crafted DNS response 2019-01-06 11:39:09 -08:00
Stanislav Malyshev 31f59e1f30 Fix more issues with encodilng length
Should fix bug #77381, bug #77382, bug #77385, bug #77394.
2019-01-06 11:38:46 -08:00
Christoph M. Becker 567c9f5842 Fix #77270: imagecolormatch Out Of Bounds Write on Heap
At least some of the image reading functions may return images which
use color indexes greater than or equal to im->colorsTotal.  We cater
to this by always using a buffer size which is sufficient for
`gdMaxColors` in `gdImageColorMatch()`.
2019-01-06 11:38:46 -08:00
Stanislav Malyshev 4feb9e66ff Fix bug #77380 (Global out of bounds read in xmlrpc base64 code) 2019-01-06 11:38:46 -08:00
Stanislav Malyshev c6e34d91b8 Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) 2019-01-06 11:38:46 -08:00
Stanislav Malyshev deb06bbb9c Fix bug #77370 - check that we do not read past buffer end when parsing multibytes 2019-01-06 11:38:46 -08:00
Christoph M. Becker dfd8237aec Fix #77269: Potential unsigned underflow in gdImageScale
Belatedly, we're porting the respective upstream patch[1].

[1] <https://github.com/libgd/libgd/commit/60bfb401ad5a4a8ae995dcd36372fe15c71e1a35>
2019-01-06 11:38:46 -08:00
Stanislav Malyshev 78bd347774 Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext) 2019-01-06 11:38:46 -08:00
Stanislav Malyshev 9c62b95e5e Fix bug #77242 (heap out of bounds read in xmlrpc_decode()) 2019-01-06 11:38:46 -08:00
Alexander Kurilo e3e3289bd1 Regenerate certs for openssl tests 2019-01-06 11:38:46 -08:00
Stanislav Malyshev c95daa9c75 Fix more issues with encodilng length
Should fix bug #77381, bug #77382, bug #77385, bug #77394.
2019-01-06 11:34:27 -08:00
Christoph M. Becker 7a12dad4dd Fix #77270: imagecolormatch Out Of Bounds Write on Heap
At least some of the image reading functions may return images which
use color indexes greater than or equal to im->colorsTotal.  We cater
to this by always using a buffer size which is sufficient for
`gdMaxColors` in `gdImageColorMatch()`.
2019-01-06 11:34:20 -08:00
Stanislav Malyshev 1cc2182bcc Fix bug #77380 (Global out of bounds read in xmlrpc base64 code) 2019-01-06 11:34:00 -08:00
Stanislav Malyshev 28362ed4fa Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) 2019-01-06 11:33:54 -08:00
Stanislav Malyshev 20407d06ca Fix bug #77370 - check that we do not read past buffer end when parsing multibytes 2019-01-06 11:33:44 -08:00
Christoph M. Becker a918020c03 Fix #77269: Potential unsigned underflow in gdImageScale
Belatedly, we're porting the respective upstream patch[1].

[1] <https://github.com/libgd/libgd/commit/60bfb401ad5a4a8ae995dcd36372fe15c71e1a35>
2019-01-06 11:33:38 -08:00
Stanislav Malyshev 428d8164ff Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext) 2019-01-06 11:33:32 -08:00
Stanislav Malyshev 4fc0bceb7c Fix bug #77242 (heap out of bounds read in xmlrpc_decode()) 2019-01-06 11:33:25 -08:00
Nikita Popov 361d3ede93 Fix bug #77410 2019-01-04 12:40:28 +01:00
Nikita Popov 1ed20669c5 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-04 09:53:30 +01:00
Nikita Popov 41af1e6781 Fix self::class inside constant in global scope
Previously this triggered an assertion failure. The behavior is
not quite correct, in that self::class should generate an exception
if there is no self, but returns an empty string here. Fixing that
would be a bit too intrusive for the 7.2 branch.
2019-01-04 09:52:04 +01:00
Nikita Popov 07873fab3c Add NEWS entry for bug #77357
The fix has been confirmed.

[ci skip]
2019-01-04 09:07:50 +01:00
Nikita Popov 5a361c3a54 Possible fix for bug #77357
Don't invoke CPUID with feature levels above the supported maximum.
In this case CPUID will return the highest supported basic information
leaf, which will have unrelated bits in the relevant positions.
2019-01-03 10:24:48 +01:00
Nikita Popov 349dbb7938 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-03 09:40:42 +01:00
Nikita Popov cb009b12a5 Fixed bug #77273 2019-01-03 09:40:07 +01:00
Alexander Kurilo f51062523d Regenerate certs for openssl tests 2019-01-02 10:00:36 -08:00
Nikita Popov 325a113974 Possible fix for bug #77287
The cache size could be off by 4, if we're on a 32-bit system and
the slot had to be bumped for alignment reasons.

I wasn't able to reproduce the issue reported in bug #77287, but I
think this might be the cause.
2019-01-02 14:12:58 +01:00
Nikita Popov 291589114a Disable ifuncs on FreeBSD
Intended as at least a preliminary fix for bug #77284. If/when we
figure out what exactly the issue is, we can relax this.
2019-01-02 12:59:22 +01:00
Nikita Popov 613683580b Merge branch 'PHP-7.2' into PHP-7.3 2019-01-02 11:34:15 +01:00
Nikita Popov 73596c56e7 Partial fix for bug #75426
This does not print the exact line of the comma, but rather the line
of the previous element. This should generally be "good enough", as
the line number is close (off by one) to the actual issue now.
Previously it would point to the start of the array, which may be
very far away.
2019-01-02 11:32:48 +01:00
Vincent JARDIN 91e44a27f6 skeleton: support PHP 7.2
skeleton can still be leveraged with older PHP releases, including
PHP 7.2.

I wanted to add this capability since PHP 7.2 is still widely provided
with most Linux distributions.

I am using ext_skel.php on a vanilla Ubuntu 18.04 and Windows
in order to illustrate how to develop a PHP extension for both
OS using the default tools provided by the distributions.
  see: https://github.com/vjardin/php-bonjour
2019-01-02 11:21:25 +01:00
Anatol Belski 1732ce9c23 Update NEWS 2019-01-02 11:02:29 +01:00
Anatol Belski d1c616f077 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #75684 In mysqlnd_ext_plugin.h the plugin methods family has no external visibility
2019-01-02 11:01:34 +01:00
Anatol Belski 7b3f8e746a Fixed bug #75684 In mysqlnd_ext_plugin.h the plugin methods family has no external visibility 2019-01-02 11:00:33 +01:00
Xinchen Hui 1b86f84908 Entry get lost while merging 2019-01-02 16:46:41 +08:00
Xinchen Hui 33011be5bf Merge branch 'PHP-7.3' of git.php.net:/php-src into PHP-7.3
* 'PHP-7.3' of git.php.net:/php-src:
  Fixed bug #77257
2019-01-02 16:45:38 +08:00
Xinchen Hui 54a58a7380 Fixed bug #77387 (Recursion detection broken when printing GLOBALS) 2019-01-02 16:42:05 +08:00
Nikita Popov 91888cc372 Fixed bug #77257
Correctly handle the case of duplicate predecessors, by removing the
duplicate predecessor and corresponding phi node operands.

For the future, it would be better to instead allow duplicate
predecessors and avoid this kind of fragile code...
2019-01-02 09:31:50 +01:00
Xinchen Hui e01f08f679 Fixed bug #77376 ("undefined function" message no longer includes namespace) 2019-01-02 15:32:17 +08:00
Xinchen Hui 703ccd5d27 Update NEWS 2019-01-02 12:10:23 +08:00
Xinchen Hui e527626d9f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77395 (segfault about array_multisort)
2019-01-02 12:10:04 +08:00
Xinchen Hui 8ebae84674 Fixed bug #77395 (segfault about array_multisort) 2019-01-02 12:09:47 +08:00
Christoph M. Becker 6f663c3a2e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77391: 1bpp BMPs may fail to be loaded
2018-12-31 20:50:19 +01:00
Christoph M. Becker b0cfa28d6d Fix #77391: 1bpp BMPs may fail to be loaded
We port the upstream fix[1].

[1] <https://github.com/libgd/libgd/commit/d0859134fcbd8817f87895bd1cb158096568a7a2>
2018-12-31 20:45:47 +01:00
Christoph M. Becker b051ab56dc Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Regenerate certs for openssl tests
2018-12-31 18:27:26 +01:00
Alexander Kurilo 687dad3674 Regenerate certs for openssl tests 2018-12-31 18:20:34 +01:00
Christoph M. Becker 42b0bbd758 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Drop deprecated /Gm compile option
2018-12-30 14:37:04 +01:00
Christoph M. Becker 20de58f51d Drop deprecated /Gm compile option
The `/Gm` option of `cl` is deprecated[1], and `cl` claims that it will
be removed in the future, so we're dropping it right away.

[1] <https://docs.microsoft.com/en-us/cpp/build/reference/gm-enable-minimal-rebuild?view=vs-2017>
2018-12-30 14:36:05 +01:00
Anatol Belski d4b7cc1dba Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Increase timeout for test on AppVeyor
2018-12-29 17:51:39 +01:00
Anatol Belski 54a2b42778 Increase timeout for test on AppVeyor 2018-12-29 17:48:25 +01:00
Anatol Belski 2567eba330 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add memory check to the test
2018-12-29 16:23:24 +01:00
Anatol Belski 222fa032d2 Add memory check to the test 2018-12-29 16:22:31 +01:00
Anatol Belski 6896d2a685 [ci skip] Update NEWS 2018-12-28 16:40:06 +01:00
Anatol Belski d874d4a15c Fixed bug #77346 webm files incorrectly detected as application/octet-stream
HEADSUP data from file 5.34 is used from now on
2018-12-28 13:25:40 +01:00
Lauri Kenttä 16c62a8179 Fix #77360: class_uses causes segfault 2018-12-27 15:34:02 +01:00
Lauri Kenttä 89bf3df67d Fix #77359: spl_autoload causes segfault
Use the correct function to free the string.
2018-12-27 15:28:25 +01:00
Anatol Belski d2621c3185 Update NEWS [ci skip] 2018-12-26 20:45:19 +01:00
Anatol Belski b53d2b69f2 Update NEWS [ci skip] 2018-12-26 20:07:31 +01:00
Anatol Belski b48823101c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS [ci skip]
2018-12-26 20:06:01 +01:00
Anatol Belski a2cb8228fe Update NEWS [ci skip] 2018-12-26 20:05:15 +01:00
Anatol Belski e38e44e3c6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Initialize s_un (sockaddr_un) to zero before using it. Fixes #76839.
2018-12-26 19:01:36 +01:00
Michael Meyer 3c42c784c2 Initialize s_un (sockaddr_un) to zero before using it. Fixes #76839. 2018-12-26 18:58:27 +01:00
Nikita Popov b1deb98c42 Fixed bug #77338
Set preg_options to 0 in php_pcre_get_compiled_regex(_ex). These
options are intended to be passed to pcre2_match. However, we do
not have any flags that actually need to be set during matching
(all relevant flags are set during compilation), and the preg_flags
value is used for PHP-specific flags instead.

This parameter should be removed entirely in master to avoid confusion.
2018-12-26 17:11:27 +01:00
Anatol Belski 078c1d8ef7 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update binary SDK version for AppVeyor
2018-12-26 14:17:56 +01:00
Anatol Belski 3c7dc7b4c4 Update binary SDK version for AppVeyor 2018-12-26 14:15:21 +01:00
Anatol Belski 199914b42d Fixed bug #77317 __DIR__, __FILE__, realpath() reveal physical path for subst virtual drive
Keep compatibility with 7.2 and below which better comply with
realpath(3). This might have been fixable another way, say by checking
of QueryDosDevice or alike, sadly that comes with a huge performance
impact. The new internal realpath API is kept available so is
usable when bind or network mount or other OS specific realpath
variants are needed. If not used by default, a userspace function for
this specific case might be considered to be offered in next minor.
2018-12-26 12:59:00 +01:00
Dmitry Stogov b45774eed0 Respect EG(vm_stack_page_size) 2018-12-26 13:09:32 +03:00
Dmitry Stogov 1ce7cbe590 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Backport later interned strings destruction.
2018-12-24 13:45:40 +03:00
Dmitry Stogov 5888fbde0d Backport later interned strings destruction. 2018-12-24 13:45:02 +03:00
Dmitry Stogov ddfb44f2cf Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77339 (__callStatic may get incorrect arguments)
2018-12-24 13:23:47 +03:00
Dmitry Stogov 7e597f48e9 Fixed bug #77339 (__callStatic may get incorrect arguments) 2018-12-24 13:22:43 +03:00
Nikita Popov 69f54dd549 Merge branch 'PHP-7.2' into PHP-7.3 2018-12-23 20:20:53 +01:00
Nikita Popov 64de5bc224 Fix invalid efree in browscap
Related to bug #77338.
2018-12-23 20:20:04 +01:00
Derick Rethans c4e46c3043 Merge branch 'timelib-201801RC3' into PHP-7.3 2018-12-23 17:57:09 +00:00
Derick Rethans a9a084c092 Update API use due to changes in timelib 2018.01RC3 2018-12-23 17:54:57 +00:00
Derick Rethans 3e4a3d005a Upgrade timelib to 2018.01RC3 2018-12-23 17:54:37 +00:00
CHU Zhaowei b15189f4d8 Fix #77298: segfault occurs when add property to unserialized empty ArrayObject 2018-12-21 17:45:52 +01:00
Dmitry Stogov 95193c3872 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Removed /e modifirer and fixed ws.
2018-12-21 19:01:18 +03:00
Dmitry Stogov 8db63adb6d Removed /e modifirer and fixed ws. 2018-12-21 18:58:50 +03:00
Christoph M. Becker b1e25ce319 [ci skip] Add missing entry for bug 77020 2018-12-18 23:23:08 +01:00
Remi Collet 4efa618b9e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  missing entry for #77020
2018-12-18 16:29:53 +01:00
Remi Collet 3245d1bb09 missing entry for #77020 2018-12-18 16:29:31 +01:00
Remi Collet c04ef40026 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  bump to 7.2.15-dev
2018-12-18 13:12:05 +01:00
Remi Collet 7161fe629d bump to 7.2.15-dev 2018-12-18 13:11:32 +01:00
Christoph M. Becker 8734d6a73d [ci skip] Fix release date 2018-12-18 13:10:03 +01:00
Christoph M. Becker a65133a17a Prepare main branch for 7.3.2 2018-12-18 12:15:25 +01:00
Scott e0e08d376e Fix #77297: SodiumException segfaults on PHP 7.3
Instead of trying to clean the argument arrays from the backtrace, we
overwrite them with empty arrays.
2018-12-16 16:36:47 +01:00
Christoph M. Becker 0061db5503 Fix #77291: magic methods inherited from a trait may be ignored
When adding methods from a trait, we must not assume that a method name
with the same length as the name of the using class is either a PHP 4
style constructor, or not a magic method at all – it may well be
another magic method.

We mostly preserve the spirit of the optimization which caused this
regression, and avoid string comparisons for all method names which can
never be magic methods.
2018-12-16 13:30:11 +01:00
Xinchen Hui 54739c7e66 Update NEWS 2018-12-11 15:25:19 +08:00
Xinchen Hui c3eb291e41 Merge branch 'i386-PIC' of https://github.com/ryandesign/php-src into PHP-7.3
* 'i386-PIC' of https://github.com/ryandesign/php-src:
  Fix __zend_cpuid on i386 PIC without __cpuid_count
2018-12-11 15:22:50 +08:00
Anatol Belski 7dc1c7f630 Remove BOM 2018-12-11 00:38:54 +01:00
Christoph M. Becker 9b335c5649 Update/fix UPGRADING 2018-12-10 14:32:20 +01:00
Nikita Popov 93aabf1533 Fixed bug #77275
Instead of juggling with this problem during literal compaction,
make sure that we always initialize Z_EXTRA for literals, which
seems like the more robust solution.
2018-12-10 13:36:23 +01:00
Nikita Popov 59cacdcefd Fix typos in compact literals debugging code 2018-12-10 13:35:55 +01:00
Christopher Jones 6f6a15e1ae Merge branch 'PHP-7.2' into PHP-7.3 2018-12-10 21:54:23 +11:00
Christopher Jones 3aee9ca571 LOL I had 2.10 on my mind 2018-12-10 21:54:13 +11:00
Christopher Jones 5b72f49c9e Merge branch 'PHP-7.3' of https://git.php.net/repository/php-src into PHP-7.3 2018-12-10 11:00:32 +11:00
Christopher Jones 95581c6dd9 Merge branch 'PHP-7.2' into PHP-7.3 2018-12-10 10:57:10 +11:00
Christopher Jones 444e400c3b Bundle the new test 2018-12-10 10:45:43 +11:00
Christopher Jones e47025ffc5 Merge branch 'PHP-7.2' into PHP-7.3 2018-12-10 10:16:27 +11:00
Christoph M. Becker b0177d3892 Fix version numbers in main branch
This should have already happened, when `PHP-7.3.0` was branched.
2018-12-10 00:16:23 +01:00
Christopher Jones e4d894edb3 Improve test portability 2018-12-10 10:16:15 +11:00
Christopher Jones 56e2c0d7db Update for newer Oracle versions 2018-12-10 10:15:53 +11:00
Anatol Belski 6734b1106f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix syntax error
2018-12-09 19:15:11 +01:00
Anatol Belski 81207fc607 Fix syntax error 2018-12-09 19:13:09 +01:00
Anatol Belski be599873f0 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix libtidy exports when ext/tidy compiled static
2018-12-09 19:01:17 +01:00
Anatol Belski 0d166f76ee Fix libtidy exports when ext/tidy compiled static 2018-12-09 18:59:05 +01:00
Derick Rethans 77b1f5baa3 Back to -dev
This should have been done as soon as PHP-7.3.0 was branched.
2018-12-09 16:23:31 +00:00
Christopher Jones 8c37d5f451 Add OCI8 changes 2018-12-09 20:56:25 +11:00
Christopher Jones 1f84f2a766 Merge branch 'PHP-7.2' into PHP-7.3 2018-12-09 20:55:21 +11:00
Christopher Jones 99f1f3dedf Add oci_set_call_timeout() and bump version to 2.10.0 2018-12-09 20:55:04 +11:00
Christopher Jones 31eeca8a19 Merge branch 'PHP-7.2' into PHP-7.3 2018-12-09 12:38:53 +11:00
Christopher Jones e2ecd60f2f Upgrade internal OCI call 2018-12-09 12:38:35 +11:00
Christopher Jones 3da368be2e Merge branch 'PHP-7.2' into PHP-7.3 2018-12-09 12:17:04 +11:00
Christopher Jones 4246702406 Enable Oracle Database DBOP tracing attribute 2018-12-09 12:16:47 +11:00
Christopher Jones 03f6b16de7 Merge branch 'PHP-7.2' into PHP-7.3 2018-12-09 11:30:15 +11:00
Christopher Jones 465c149cd3 Update OCI8 README 2018-12-09 11:28:52 +11:00
Christopher Jones 216d6592e1 Convert some parameter parsing to the Fast Parameter Parsing API 2018-12-09 11:28:04 +11:00
Pierrick Charron b3a6ca90af Fix 77264: curl_getinfo returning microseconds, not seconds
Since curl 7.55.0, libcurl introduced new constants to return
more sensible variable types with curl_getinfo.

When curl_getinfo with no option was called, and curl >= 7.55.0, some
of the result were returned as int when they where returned as float
in previous versions. This commit remove this BC Break.

If someone still want to use more sensible variable types, it's always
possible to call curl_getinfo with newer constants.

CURLINFO_CONTENT_LENGTH_DOWNLOAD => CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
CURLINFO_CONTENT_LENGTH_UPLOAD => CURLINFO_CONTENT_LENGTH_UPLOAD_T
CURLINFO_SIZE_DOWNLOAD => CURLINFO_SIZE_DOWNLOAD_T
CURLINFO_SIZE_UPLOAD => CURLINFO_SIZE_UPLOAD_T
CURLINFO_SPEED_DOWNLOAD => CURLINFO_SPEED_DOWNLOAD_T
CURLINFO_SPEED_UPLOAD => CURLINFO_SPEED_UPLOAD_T
CURLINFO_APPCONNECT_TIME => CURLINFO_APPCONNECT_TIME_T
CURLINFO_CONNECT_TIME => CURLINFO_CONNECT_TIME_T
CURLINFO_NAMELOOKUP_TIME => CURLINFO_NAMELOOKUP_TIME_T
CURLINFO_PRETRANSFER_TIME => CURLINFO_PRETRANSFER_TIME_T
CURLINFO_REDIRECT_TIME => CURLINFO_REDIRECT_TIME_T
CURLINFO_STARTTRANSFER_TIME => CURLINFO_STARTTRANSFER_TIME_T
CURLINFO_TOTAL_TIME => CURLINFO_TOTAL_TIME_T
2018-12-08 15:09:43 -05:00
Ryan Schmidt 4fb019994a Fix __zend_cpuid on i386 PIC without __cpuid_count
Closes https://bugs.php.net/bug.php?id=76654
2018-12-08 09:52:52 -06:00
Remi Collet cb3a1df946 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  add imap.enable_insecure_rsh in php.ini
2018-12-08 10:25:20 +01:00
Remi Collet fd0077bf06 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  add imap.enable_insecure_rsh in php.ini
2018-12-08 10:25:05 +01:00
Remi Collet 4288674651 add imap.enable_insecure_rsh in php.ini 2018-12-08 10:24:36 +01:00
Christopher Jones a5991a2f9f Merge branch 'PHP-7.3' of https://git.php.net/repository/php-src into PHP-7.3 2018-12-08 20:20:04 +11:00
Christopher Jones 290671e7f2 Merge branch 'PHP-7.2' of https://git.php.net/repository/php-src into PHP-7.2 2018-12-08 20:19:59 +11:00
Christopher Jones 6119d4c670 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Note that PECL install now works on PHP 7.3
  Don't skip with 18c DB
2018-12-08 20:13:57 +11:00
Christopher Jones 43adf3dc5e Note that PECL install now works on PHP 7.3 2018-12-08 20:13:40 +11:00
Christopher Jones 9a0ec35fa3 Don't skip with 18c DB 2018-12-08 20:12:43 +11:00
Remi Collet 1de2ff2e5e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  missing entry for #77020
  missing entry for #77020
2018-12-08 10:07:20 +01:00
Remi Collet 431ff36f51 missing entry for #77020 2018-12-08 10:07:01 +01:00
Remi Collet da90b477c6 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  missing entry for #77020
2018-12-08 10:06:34 +01:00
Remi Collet 9b8f2417ad missing entry for #77020 2018-12-08 10:06:19 +01:00
Christopher Jones e355e55e01 Merge branch 'PHP-7.2' into PHP-7.3 2018-12-08 19:24:59 +11:00
Christopher Jones dd0a8091f4 Fix resource warning value 2018-12-08 19:24:32 +11:00
Christopher Jones 2d53040a6d Bump OCI8 version 2018-12-08 19:23:22 +11:00
Christopher Jones 78c299ae2d Update NEWS 2018-12-08 19:14:16 +11:00
Christopher Jones 18b25f0f65 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
2018-12-08 19:13:12 +11:00
Christopher Jones 8ff6a30598 Update NEWS 2018-12-08 19:12:04 +11:00
Christopher Jones de9f64f5dd Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  When releasing an oci8 connection always set the resource to null.
2018-12-08 18:51:13 +11:00
KoenigsKind 3c91851874 When releasing an oci8 connection always set the resource to null. 2018-12-08 18:49:12 +11:00
Christopher Jones 49944e4bcf Merge branch 'PHP-7.2' into PHP-7.3 2018-12-07 23:22:30 +11:00
Nikita Popov e3946534a4 Drop unnecessary HASH_OF uses in ext/oci8
These only operate on arrays.
2018-12-07 23:21:32 +11:00
Christopher Jones 171389b435 Merge branch 'PHP-7.2' into PHP-7.3 2018-12-07 23:20:27 +11:00
Christopher Jones b797818e09 Simplify based on feedback from nikic 2018-12-07 23:07:37 +11:00
Christopher Jones 91776f7264 Sync with test files 2018-12-07 21:41:34 +11:00
Christoph M. Becker 327e2d0153 [ci skip] Fix NEWS wrt. ChangeLog conversion
We have to be rather picky in this regard; otherwise we need to
manually post process the ChangeLog.
2018-12-06 17:15:43 +01:00
Christoph M. Becker 43329e85e6 [ci skip] Fix typo 2018-12-06 00:24:25 +01:00
Ferenc Kovacs c7095bd607 Merge branch 'PHP-7.2' into PHP-7.3 2018-12-05 09:44:22 +01:00
Ferenc Kovacs bc32061dba Merge branch 'PHP-7.1' into PHP-7.2 2018-12-05 09:36:31 +01:00
Ferenc Kovacs 6cbdc5e207 Merge branch 'PHP-7.0' into PHP-7.1 2018-12-05 09:30:20 +01:00
Ferenc Kovacs bd289af963 Merge branch 'PHP-5.6' into PHP-7.0 2018-12-05 09:25:53 +01:00
Ferenc Kovacs c26cb383a5 5.6.40 will be next. probably not 2018-12-05 09:13:30 +01:00
Côme Chilliet cb00ca7cfe Add LDAP information in UPGRADING 2018-12-04 17:15:55 +01:00
Anatol Belski 807d8aa00d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Sync NEWS [ci skip]
2018-12-04 12:50:40 +01:00
Anatol Belski 6e9435f339 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Sync NEWS [ci skip]
2018-12-04 12:50:04 +01:00
Anatol Belski d07e63211a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Sync NEWS [ci skip]
2018-12-04 12:49:42 +01:00
Anatol Belski a8f125fbca Sync NEWS [ci skip] 2018-12-04 12:49:10 +01:00
Jakub Zelenka 6493d54897 Update UPGRADING with info about FPM logging changes 2018-12-03 18:30:41 +00:00
Stanislav Malyshev 36534afd10 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix null pointer deref in qprint-encode filter (bug #77231)
2018-12-03 10:20:07 -08:00
Stanislav Malyshev a9ef7ecc60 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix null pointer deref in qprint-encode filter (bug #77231)
2018-12-03 10:20:02 -08:00
Stanislav Malyshev d5dc3c69f9 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix null pointer deref in qprint-encode filter (bug #77231)
2018-12-03 10:19:57 -08:00
Stanislav Malyshev 036bc5c1fb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix null pointer deref in qprint-encode filter (bug #77231)
2018-12-03 10:19:49 -08:00
Stanislav Malyshev 78bffa72c1 Fix null pointer deref in qprint-encode filter (bug #77231) 2018-12-03 10:19:08 -08:00
Christoph M. Becker 5be58a437c [ci skip] Prepare NEWS for 7.3 GA 2018-12-03 13:56:14 +01:00
Stanislav Malyshev 3d8d13f7b9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77143 - add more checks to buffer reads
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
  Don't need interactive progress on git clones in Travis
  Fix TSRM signature - php_stream_stat macro has it's own TSRM
  Regenerate certificates for openssl tests
  Improve test for bug77022
2018-12-03 00:42:55 -08:00
Stanislav Malyshev 8fff90250b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77143 - add more checks to buffer reads
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
2018-12-03 00:42:50 -08:00
Stanislav Malyshev 8ab5d22332 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #77143 - add more checks to buffer reads
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
2018-12-03 00:42:45 -08:00
Stanislav Malyshev 5718d73dbb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #77143 - add more checks to buffer reads
2018-12-03 00:42:35 -08:00
Stanislav Malyshev 48f0f73f75 Fix bug #77143 - add more checks to buffer reads 2018-12-03 00:41:46 -08:00
Stanislav Malyshev 66a0f061f6 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
2018-12-03 00:39:03 -08:00
Stanislav Malyshev 54212674b9 Fix bug #77143 - add more checks to buffer reads 2018-12-03 00:03:10 -08:00
Stanislav Malyshev 7edc639b9f Fix #77020: null pointer dereference in imap_mail
If an empty $message is passed to imap_mail(), we must not set message
to NULL, since _php_imap_mail() is not supposed to handle NULL pointers
(opposed to pointers to NUL).
2018-12-03 00:00:56 -08:00
Stanislav Malyshev 1f78b1dfd0 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Don't need interactive progress on git clones in Travis
2018-12-02 16:04:33 -08:00
Philip Prindeville 61af343768 Don't need interactive progress on git clones in Travis
Travis logs are usually inspected after the build completes, by which time
progress info is useless.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-12-02 16:04:22 -08:00
Stanislav Malyshev 1225467d8a Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix TSRM signature - php_stream_stat macro has it's own TSRM
  Regenerate certificates for openssl tests
  Improve test for bug77022
2018-12-02 15:12:15 -08:00
Stanislav Malyshev f8eac1f438 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix TSRM signature - php_stream_stat macro has it's own TSRM
  Regenerate certificates for openssl tests
  Improve test for bug77022
2018-12-02 13:38:59 -08:00
Stanislav Malyshev 6e3f5d57d4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix TSRM signature - php_stream_stat macro has it's own TSRM
  Regenerate certificates for openssl tests
  Improve test for bug77022
2018-12-02 13:18:07 -08:00
Stanislav Malyshev aabdb71dc3 Fix TSRM signature - php_stream_stat macro has it's own TSRM 2018-12-02 12:54:19 -08:00
Alexander Kurilo 0382e761d7 Regenerate certificates for openssl tests 2018-12-02 12:08:19 -08:00
Stanislav Malyshev 2fba1e2f59 Improve test for bug77022 2018-12-02 12:06:13 -08:00
Jakub Zelenka 1deee2ba7c Merge branch 'PHP-7.2' into PHP-7.3 2018-12-02 19:38:38 +00:00
Alexander Kurilo 655fb96354 Regenerate certificates for openssl tests 2018-12-02 19:37:10 +00:00
Stanislav Malyshev e614b12712 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
2018-12-01 21:48:44 -08:00
Stanislav Malyshev c5869fd1c8 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
2018-12-01 21:48:40 -08:00
Stanislav Malyshev 09885f78c6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
2018-12-01 21:48:35 -08:00
Stanislav Malyshev cea277048d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #77022 - use file mode or umask for new files
2018-12-01 21:48:27 -08:00
Stanislav Malyshev cc84d893c7 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77022 - use file mode or umask for new files
2018-12-01 21:47:49 -08:00
Stanislav Malyshev 8136d130b6 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77022 - use file mode or umask for new files
2018-12-01 21:47:44 -08:00
Stanislav Malyshev 1aec05defd Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #77022 - use file mode or umask for new files
2018-12-01 21:47:37 -08:00
Stanislav Malyshev 67f3615102 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #77022 - use file mode or umask for new files
2018-12-01 21:08:38 -08:00
Stanislav Malyshev 69f5e7992b Fix bug #77022 - use file mode or umask for new files 2018-12-01 21:06:45 -08:00
Anatol Belski ea454583eb Update NEWS [ci skip] 2018-12-01 17:10:43 +01:00
Anatol Belski ef1269d5c1 Fixed bug #77193 Infinite loop in preg_replace_callback
Don't return preallocated match data more than once in nested calls.
2018-12-01 10:24:06 +01:00
Christoph M. Becker 471eb0dd95 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77051: Issue with re-binding on SQLite3
2018-11-29 02:18:56 +01:00
BohwaZ 94ec262fca Fix #77051: Issue with re-binding on SQLite3
We have to call `sqlite3_reset()` before re-binding the parameters.
2018-11-29 02:16:57 +01:00
Stanislav Malyshev 3f165e8ca3 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add DISPLAY_INI_ENTRIES for imap
  Disable rsh/ssh functionality in imap by default (bug #77153)
  Disable rsh/ssh functionality in imap by default (bug #77153)
2018-11-28 15:47:07 -08:00
Stanislav Malyshev 4ac764e8bb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Add DISPLAY_INI_ENTRIES for imap
  Disable rsh/ssh functionality in imap by default (bug #77153)
  Disable rsh/ssh functionality in imap by default (bug #77153)
2018-11-28 15:47:00 -08:00
Stanislav Malyshev 223b8c15a8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Add DISPLAY_INI_ENTRIES for imap
  Disable rsh/ssh functionality in imap by default (bug #77153)
  Disable rsh/ssh functionality in imap by default (bug #77153)
2018-11-28 15:46:53 -08:00
Stanislav Malyshev 87bf84c8c7 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add DISPLAY_INI_ENTRIES for imap
2018-11-28 15:46:39 -08:00
Stanislav Malyshev d8765852e0 Add DISPLAY_INI_ENTRIES for imap 2018-11-28 15:45:51 -08:00
Derick Rethans dd48f0899d Merge branch 'PHP-7.2' into PHP-7.3 2018-11-28 20:35:16 +00:00
Derick Rethans a3f2871b8e Fixed bug #77097 (DateTime::diff gives wrong diff when the actual diff is less than 1 second) by upgrading to timelib 2017.09 2018-11-28 20:34:21 +00:00
Nikita Popov f4eec70260 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-28 20:10:17 +01:00
Nikita Popov 17f8b9fb36 Fixed bug #77215
Remove invalid assertion: A block can have multiple switch frees,
so if we don't do live range block splitting, it is not necessarily
true that the free is located at the start of a block.
2018-11-28 20:08:39 +01:00
Nikita Popov 12e88781e1 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-27 19:44:45 +01:00
Nikita Popov b565c85b9e Improve fix for #76046
Also locate the JMP at the start of the foreach.

Patch suggested by Derick.
2018-11-27 19:43:25 +01:00
Nikita Popov d78211aec0 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-27 16:39:21 +01:00
Nikita Popov d6595f276f Fixed bug #76046
Place FE_FREE on start line of foreach, instead of whatever random
line number might be in CG(zend_lineno) at the time.
2018-11-27 16:37:55 +01:00
Nikita Popov fb18b8bdf6 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-26 22:49:18 +01:00
Colin Basnett 9ec519e094 Fixed bug #77184
The U in URATIONAL is for unsigned, so the values should be printed
as unsigned.
2018-11-26 22:48:48 +01:00
Adam Baratz 2c4425a87a update NEWS 2018-11-26 10:39:24 -05:00
Adam Baratz a22d2850d4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Check column number before trying to fetch the value
2018-11-26 10:36:18 -05:00
Sergei Morozov e126ca1557 Check column number before trying to fetch the value 2018-11-26 10:34:37 -05:00
Christoph M. Becker 07d6dfbfe4 Use zend_empty_array
No need to define our own `com_dotnet_object_properties` as empty hash,
since we can use `zend_empty_array` instead as of PHP 7.3.0.

Cf. <https://github.com/php/php-src/pull/3672#issuecomment-440467704>.
2018-11-26 15:33:58 +01:00
Christoph M. Becker 070f6838db Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77200: imagecropauto(…, GD_CROP_SIDES) crops left but not right
2018-11-25 19:03:38 +01:00
Christoph M. Becker a1aaec08b5 Fix #77200: imagecropauto(…, GD_CROP_SIDES) crops left but not right
We apply the upstream patch[1].

[1] <https://github.com/libgd/libgd/commit/6613094e5d218dc4d4372757aef5e58c6462a9f7>
2018-11-25 19:00:50 +01:00
Christoph M. Becker d2a1839d82 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77198: auto cropping has insufficient precision
2018-11-25 15:56:35 +01:00
Christoph M. Becker b47b8886dd Fix #77198: auto cropping has insufficient precision
We apply the upstream patch[1], and also fix the erroneous bailout at
the end of `gdImageAutoCrop()`, since `crop.x` and `crop.y` may very
well be zero.

[1] <https://github.com/libgd/libgd/commit/bda85aaeeb1d7467d92c892ba4c30eaa53d7a6d4>
2018-11-25 15:41:27 +01:00
Frank Denis 8e5381915b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  ext/sodium: remove redundant code
  ext/sodium: Correct base64 decoding with unpadded variants
2018-11-24 17:56:33 +01:00
Frank Denis ff02d50909 ext/sodium: remove redundant code 2018-11-24 17:55:36 +01:00
Frank Denis 542d0bce50 ext/sodium: Correct base64 decoding with unpadded variants
Backports 0eee0b957a3b75f8175cdd30b306c15e372685e8 from the PECL extension
2018-11-24 17:53:08 +01:00
Christoph M. Becker aab9aa7661 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix test case
2018-11-24 13:38:09 +01:00
Christoph M. Becker 5af5f56fc9 Fix test case 2018-11-24 13:36:42 +01:00
Christoph M. Becker caabf3a1bb Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77195: Incorrect error handling of imagecreatefromjpeg()
2018-11-24 12:57:44 +01:00
Christoph M. Becker 60a9f7a3a3 Fix #77195: Incorrect error handling of imagecreatefromjpeg()
The broken JPEG image triggers a notice, two warnings and outputs a
message to stderr directly.  The additional notice is pretty useless,
and the direct output to stderr is bad.  Therefore, we port the
relevant differences from upstream to our bundled libgd.  This leaves
us with two warnings; the first one is triggered by libjpeg and shows
the actual problem, the second one is triggered by our libgd wrapper
whenever an image can't be read, what may not have necessarily
triggered a warning before.
2018-11-24 12:52:08 +01:00
Christoph M. Becker 2979c6a56d [ci skip] Preliminary fix for NEWS
No more regular bug fixes for PHP 7.3.0.

We'll clean up the rest later.
2018-11-23 18:37:12 +01:00
Christoph M. Becker b0a86566dc Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77177: Serializing or unserializing COM objects crashes
2018-11-23 16:36:00 +01:00
Christoph M. Becker 115ee49b0b Fix #77177: Serializing or unserializing COM objects crashes
Firstly, we avoid returning NULL from the get_property handler, but
instead return an empty HashTable, which already prevents the crashes.
Secondly, since (de-)serialization obviously makes no sense for COM,
DOTNET and VARIANT objects (at least with the current implementation),
we prohibit it right away.
2018-11-23 16:32:33 +01:00
Sara Golemon 5b55b587ea Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Prep for 7.1.26
2018-11-21 14:39:40 -05:00
Sara Golemon f2de4d185d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Prep for 7.1.26
2018-11-21 14:39:25 -05:00
Sara Golemon 0b3cbd665e Prep for 7.1.26 2018-11-21 14:37:37 -05:00
Xinchen Hui aaafd793e6 Fixed bug #77088 (Segfault when using SoapClient with null options)
SoapClient constructor has its own error handler
2018-11-21 11:30:32 +08:00
Xinchen Hui efeb810a3d Fixed proto & folder mark 2018-11-21 11:18:48 +08:00
Nikita Popov b6d5d92661 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-20 21:30:53 +01:00
Nikita Popov bbbaf1ca85 Merge branch 'PHP-7.1' into PHP-7.2 2018-11-20 21:30:38 +01:00
Valentin V. Bartenev 11ddf7669a Fix bug #71041 dynamic embed SAPI load error
If the library is built with ZEND_SIGNALS defined, it's unusable with an
external SAPI module because the zend_signal_startup() call is mandatory
in this case.

This bug is similar to #74149, but related to dynamic loading of PHP library.
2018-11-20 21:30:02 +01:00
Nikita Popov 7a0d3406f6 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-20 21:16:28 +01:00
Mizunashi Mana e672cd4385 Define __APPLE_USE_RFC_3542 for new ipv6 constants 2018-11-20 21:16:03 +01:00
Sara Golemon 7d766bd657 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Bump for 7.2.14
2018-11-20 14:41:31 -05:00
Sara Golemon 9fc52c16b5 Bump for 7.2.14 2018-11-20 14:40:21 -05:00
Stanislav Malyshev 63973d1b33 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Disable rsh/ssh functionality in imap by default (bug #77153)
2018-11-20 11:20:45 -08:00
Stanislav Malyshev 44b08a9802 Disable rsh/ssh functionality in imap by default (bug #77153) 2018-11-20 11:19:45 -08:00
Stanislav Malyshev 336d2086a9 Disable rsh/ssh functionality in imap by default (bug #77153) 2018-11-20 11:18:53 -08:00
Stanislav Malyshev 05782f01f5 Disable rsh/ssh functionality in imap by default (bug #77153) 2018-11-20 11:16:08 -08:00
Stanislav Malyshev aed4065aa6 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Disable rsh/ssh functionality in imap by default (bug #77153)
2018-11-20 11:14:18 -08:00
Stanislav Malyshev 628df47e79 Disable rsh/ssh functionality in imap by default (bug #77153) 2018-11-20 11:14:07 -08:00
Christoph M. Becker 03a3a04e55 [ci skip] Update NEWS wrt. php-7.3.0RC6 tagging 2018-11-20 13:36:10 +01:00
Remi Collet 3ed07cc34a NEWS 2018-11-20 11:20:40 +01:00
Remi Collet 928d7fc8df Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  NEWS
  NEWS
  Fix #77151 ftp_close(): SSL_read on shutdown
2018-11-20 11:20:26 +01:00
Remi Collet e7acb29eb0 NEWS 2018-11-20 11:20:05 +01:00
Remi Collet 6ce4be1762 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  NEWS
  Fix #77151 ftp_close(): SSL_read on shutdown
2018-11-20 11:19:52 +01:00
Remi Collet 1adbf70e26 NEWS 2018-11-20 11:19:29 +01:00
Remi Collet d9afc2f662 Fix #77151 ftp_close(): SSL_read on shutdown
Regression introduced in fix for #76972

only display the error message when sslerror
or if errno is set (for SSL_ERROR_SYSCALL case)
2018-11-20 11:18:34 +01:00
Stanislav Malyshev e5bfea64c8 Disable rsh/ssh functionality in imap by default (bug #77153) 2018-11-20 00:13:50 -08:00
Anatol Belski 05df19b9f0 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-11-18 14:41:14 +01:00
Anatol Belski 68442312e3 [ci skip] Update NEWS 2018-11-18 14:40:00 +01:00
Anatol Belski 6742b4b7cc [ci skip] Update NEWS 2018-11-18 14:38:35 +01:00
Anatol Belski 6e32f59525 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-11-18 14:37:56 +01:00
Anatol Belski 3e78380d02 [ci skip] Update NEWS 2018-11-18 14:37:04 +01:00
Anatol Belski 5f64afc073 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77047 pg_convert has a broken regex for the 'TIME WITHOUT TIMEZONE' data type
2018-11-18 12:33:35 +01:00
Anatol Belski fb06cca6cb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #77047 pg_convert has a broken regex for the 'TIME WITHOUT TIMEZONE' data type
2018-11-18 12:32:47 +01:00
Anatol Belski 0434141ce9 Fixed bug #77047 pg_convert has a broken regex for the 'TIME WITHOUT TIMEZONE' data type
Backport 369c991d and 282a63da to 7.1, closes #3634
2018-11-18 12:29:34 +01:00
Anatol Belski 282a63dace Add test for bug #77047 2018-11-18 11:52:00 +01:00
andy 369c991d5c FIX #77047: fixes regex for "time" data type 2018-11-18 11:50:32 +01:00
Anatol Belski cf764f02b3 [ci skip] Update NEWS 2018-11-17 23:01:17 +01:00
Anatol Belski 10192a9ca4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
2018-11-17 23:00:50 +01:00
Anatol Belski b4776cda2e [ci skip] Update NEWS 2018-11-17 23:00:12 +01:00
Anatol Belski b0591f5e46 Simplify assignment on 64-bit 2018-11-17 22:56:39 +01:00
Anatol Belski 00c08a2e4a Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77111 php-win.exe corrupts unicode symbols from cli parameters
2018-11-16 23:22:19 +01:00
Anatol Belski a7e9790969 Fixed bug #77111 php-win.exe corrupts unicode symbols from cli parameters
The binary can be of course used on console, for whatever reasons, so
UNICODE API should be used in that case. That might however not work as
expected, if the binary is used for a service.
2018-11-16 23:19:33 +01:00
Nikita Popov dee5a450d9 Fixed bug #77165
Also add some helper macros for PROTECT/UNPROTECT that check for
IMMUTABLE. These checks are needed for nearly any use of
PROTECT/UNPROTECT.
2018-11-15 17:16:39 +01:00
Anatol Belski 2a062f3c02 Rework magic data once more
The change reduces the input size on patterns using posix character
classes. It is still better than reverting to the patterns from the
older version, as the upstream data uses posix classes also in the later
versions. The input reduction speeds up the pattern matching in some
cases.

This patch is functionally almost same as upstream, but might show some diff
when the input is very long. While the magic data in the newer versions is
functionally an improvement, with jit=0 it might show a performance regression.
The slowdown is negligible in the normal usage and is still acceptable for the
malicious input. If some functional regressions show up, this patch should be
reverted and the tests timing should be adapted instead.
2018-11-14 22:23:24 +01:00
Christoph M. Becker 9a2bd2f453 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77147: Fix for 60494 ignores ICONV_MIME_DECODE_CONTINUE_ON_ERROR
2018-11-14 14:59:30 +01:00
Christoph M. Becker 211c6189f6 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77147: Fix for 60494 ignores ICONV_MIME_DECODE_CONTINUE_ON_ERROR
2018-11-14 14:57:40 +01:00
Christoph M. Becker a56cdd0a82 Fix #77147: Fix for 60494 ignores ICONV_MIME_DECODE_CONTINUE_ON_ERROR
If the `ICONV_MIME_DECODE_CONTINUE_ON_ERROR` flag is set, parsing
should not fail, if there are illegal characters in the headers;
instead we silently ignore these like before.
2018-11-14 14:55:38 +01:00
Joe Watkins 8a11c9ee76 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Validate length on socket_write
2018-11-13 13:00:08 +01:00
Joe Watkins ce4eb89976 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Validate length on socket_write
2018-11-13 12:58:23 +01:00
Thiago Carvalho ec2e7a2d48 Validate length on socket_write 2018-11-13 12:56:37 +01:00
Jan Rękorajski f76be1a0d6 Fix compilation on x32
Signed-off-by: Elan Ruusamäe <glen@pld-linux.org>
2018-11-13 12:31:00 +01:00
Christoph M. Becker 512b93e9d6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77141: Signedness issue in SOAP when precision=-1
2018-11-12 23:24:48 +01:00
Christoph M. Becker 77646d2fd9 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77141: Signedness issue in SOAP when precision=-1
2018-11-12 23:22:16 +01:00
Christoph M. Becker f6079e3c56 Fix #77141: Signedness issue in SOAP when precision=-1
According to php_gcvt(), we assume at most 17 fractional digits for
negative precision.
2018-11-12 23:19:30 +01:00
Anatol Belski ee50461e4b Update libmagic.patch [ci skip] 2018-11-10 22:02:44 +01:00
Anatol Belski df9c58e27a Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update libmagic.patch [ci skip]
2018-11-10 22:02:24 +01:00
Anatol Belski 1550451020 Update libmagic.patch [ci skip] 2018-11-10 22:01:49 +01:00
Anatol Belski b50d93bc11 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fork test with pcre.jit=0
2018-11-10 20:07:25 +01:00
Anatol Belski 3fd46e19ac Fork test with pcre.jit=0 2018-11-10 20:06:47 +01:00
Anatol Belski 0e38909170 Rework magic data
Still upstream contains some slower patterns. Those might need to
be patched, if regressions arise.
2018-11-10 18:22:44 +01:00
Anatol Belski 992e4fbc65 Fix regex 2018-11-10 12:13:03 +01:00
Anatol Belski 1c2518f906 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix regex
2018-11-10 12:12:25 +01:00
Anatol Belski 9d77bf0978 Fix regex 2018-11-10 12:11:02 +01:00
Anatol Belski 982a62819e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Rework magic data
2018-11-10 01:32:35 +01:00
Anatol Belski 60adea5496 Rework magic data
Avoid patching where vanilla data suffices. More precisely, avoid data
using [:space:] posix class in regex, as it is likely to cause performance
regressions.
2018-11-10 01:28:23 +01:00
Anatol Belski 3061d7bdad Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Sync one more upstream libmagic piece
2018-11-10 00:20:39 +01:00
Anatol Belski 22f71a66ec Sync one more upstream libmagic piece 2018-11-10 00:19:42 +01:00
Christoph M. Becker 155aecd397 [ci skip] Update NEWS wrt. php-7.3.0RC5 tagging 2018-11-06 11:46:20 +01:00
Anatol Belski ddd54401db Update NEWS [ci skip] 2018-11-05 22:53:45 +01:00
Anatol Belski 1cab286151 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS [ci skip]
2018-11-05 22:53:19 +01:00
Anatol Belski fab72d7571 Update NEWS [ci skip] 2018-11-05 22:53:01 +01:00
Anatol Belski a957af6c06 Update libmagic.patch [ci skip] 2018-11-05 22:25:31 +01:00
Anatol Belski b996611531 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update libmagic.patch [ci skip]
2018-11-05 22:25:04 +01:00
Anatol Belski dbb2cce968 Update libmagic.patch [ci skip] 2018-11-05 22:24:27 +01:00
Anatol Belski 29dcf19f8b Declare function proto in header 2018-11-05 21:29:35 +01:00
Anatol Belski 4aa77c380c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Declare function proto in header
2018-11-05 21:29:06 +01:00
Anatol Belski 0e33c2822c Declare function proto in header 2018-11-05 21:28:04 +01:00
Christoph M. Becker 7625f972db Fix #76825: Undefined symbols ___cpuid_count
Apparently, the presence of `cpuid.h` is not necessarily sufficient to
guarantee the availability of `__cpuid_count()`.  We therefore test for
the latter explicitly.
2018-11-05 18:24:39 +01:00
Remi Collet d78479737c NEWS 2018-11-05 17:06:40 +01:00
Remi Collet d53ecd040b Fix: #77110 undefined symbol zend_string_equal_val in C++ build 2018-11-05 17:05:49 +01:00
Anatol Belski 68ad401b34 Implement handling for JIT recognition when cross compiling 2018-11-05 01:15:09 +01:00
Anatol Belski db1534b1b4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Backport 7f5f4601 for 7.2
2018-11-04 16:59:27 +01:00
Anatol Belski c621182c42 Backport 7f5f4601 for 7.2 2018-11-04 16:57:55 +01:00
Christoph M. Becker 579d76d87b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #76348: WSDL_CACHE_MEMORY causes Segmentation fault
2018-11-04 16:47:13 +01:00
Christoph M. Becker 0afc818976 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76348: WSDL_CACHE_MEMORY causes Segmentation fault
2018-11-04 16:44:45 +01:00
Christoph M. Becker 625f614cb1 Fix #76348: WSDL_CACHE_MEMORY causes Segmentation fault
“Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end.”
2018-11-04 16:40:27 +01:00
Anatol Belski 7f5f46013b Rework places in libmagic regarding previous CVE-2014-3538 fixes
CVE-2014-3538 was fixed upstream, but the old patch was still kept in
the PHP port. This patch causes performance regressions when PCRE JIT is
not enabled. This is fixed by applying the relevant original code from
the newer libmagic, which makes the old patch obsolete as the
CVE-2014-3538 tests still pass.
2018-11-04 13:11:28 +01:00
Anatol Belski aea411657e Change the way JIT availability is checked
The pcre2_jit_compile_8 sysmbol is always available, even JIT might be
not. If JIT is not enabled explicitly and is enabled in the PHP runtime,
this will lead to a malfunction. This approach ensures JIT is indeed
available on the given platform. For cross compilation this might get
complicated, as it would require an explicit processor architecture and
PCRE2 version check.

Another solution for this case is to run pcre2_config at runtime. That
however would require more condition checks that would impact
architectures where JIT is available.
2018-11-03 20:50:05 +01:00
Nikita Popov d92f7630f7 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-02 14:30:50 +01:00
Nikita Popov 4daa413898 Fixed bug #77092
Weird that this worked for so long, probably because nearly all
ext/standard functions use fast ZPP rather than ordinary ZPP.
2018-11-02 14:29:03 +01:00
Zeev Suraski 9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Rasmus Lerdorf 99a9e85c65 Fix stray newline that caused this test to fail 2018-10-31 11:41:17 -07:00
Rasmus Lerdorf 4e8195769d Fix session tests that fail if error_log is set 2018-10-31 10:58:45 -07:00
Rasmus Lerdorf 1954c7e1c6 This test needs to log to stdout 2018-10-31 10:43:45 -07:00
Anatol Belski ee9d879f57 Fix error condition 2018-10-30 20:43:45 +01:00
Anatol Belski 8827cc34cf Fixed bug #77081 ftruncate() changes seek pointer in c mode 2018-10-30 20:42:00 +01:00
Christoph M. Becker 2816a3fdfa Fix and improve test case
We fix the erroneous doctype declaration, clarify the expectation, and
add a comment to clarify the purpose of the tag mismatch in the XML.
2018-10-30 18:53:03 +01:00
Derick Rethans 10255a0cd9 Updated to version 2018.7 (2018g) 2018-10-30 11:25:48 +00:00
Derick Rethans fcefc28ce1 Empty merge 2018-10-30 11:25:47 +00:00
Derick Rethans e58388ea6d Updated to version 2018.7 (2018g) 2018-10-30 11:25:45 +00:00
Peter Kokot 17df3a194b [ci skip] Update NEWS 2018-10-30 00:24:07 +01:00
Peter Kokot 82115849b3 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  fix bug #77079
2018-10-30 00:23:38 +01:00
Peter Kokot 69496a04ff [ci skip] Update NEWS 2018-10-30 00:23:20 +01:00
Peter Kokot b1de24e68c Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
  fix bug #77079
2018-10-30 00:22:26 +01:00
Peter Kokot 91a1111160 [ci skip] Update NEWS 2018-10-30 00:22:03 +01:00
Jon Allen 8775bead3a fix bug #77079 2018-10-30 00:19:07 +01:00
Nikita Popov 09c7108f74 Fix mb_strrpos() with encoding passed as 3rd param 2018-10-29 18:56:17 +01:00
Christoph M. Becker eca3b9629f [ci skip] Update UPGRADING
PR #3317[1] is relevant for the migration guide, so we add a respective
note in UPGRADING.

[1] <https://github.com/php/php-src/pull/3317>
2018-10-28 12:48:07 +01:00
Christoph M. Becker 829b0df77b Fix #71592: External entity processing never fails
If the callback set via `xml_set_external_entity_ref_handler()` returns
a falsy value, parsing is supposed to stop and the error number set to
`XML_ERROR_EXTERNAL_ENTITY_HANDLING`.  This is already correctly done
by the libexpat binding, but the libxml2 binding ignores the return
value.  We fix this by calling `xmlStopParser()` which is available as
of libxml 2.1.0[1] (PHP-7.1 requires at least libxml 2.6.11 anyway),
and setting the desired `errNo` ourselves.

[1] <http://xmlsoft.org/news.html>
2018-10-27 17:30:13 +02:00
Adam Harvey bca0a7e285 [ci skip] Fix indentation in UPGRADING. 2018-10-25 11:59:10 -07:00
Nikita Popov b9431ef4d5 Don't optimize function if inference failed
This was respected only for the single-function optimizations, not
in func-info mode.
2018-10-25 16:44:24 +02:00
Nikita Popov 78c2e0e342 Merge branch 'PHP-7.2' into PHP-7.3 2018-10-25 16:44:19 +02:00
Nikita Popov 902ec36710 Merge branch 'PHP-7.1' into PHP-7.2 2018-10-25 16:43:36 +02:00
Nikita Popov f1ceec5533 Fixed bug #77058
Account for the fact that undef must be interpreted as null for
the purposes of INC/DEC inference.
2018-10-25 16:37:41 +02:00
Nikita Popov e7153e8a2f Improve "narrowing" error message
By including the opcode name.
2018-10-25 16:36:23 +02:00
Dmitry Stogov 335fb94d54 Fixed reseting of interned strings buffer. 2018-10-24 15:45:34 +03:00
Dmitry Stogov 770fe51bfd Make php_plain_files_wrapper to be writable (workaround for swoole) 2018-10-24 11:49:44 +03:00
Joe Watkins 33fa02ea38 bump versions 2018-10-24 08:43:27 +02:00
Υоаnn B 5df17425d3 fix typo in sysvsem.c 2018-10-23 14:57:03 +02:00
Nikita Popov 3fb0f34059 Merge branch 'PHP-7.2' into PHP-7.3 2018-10-23 14:24:55 +02:00
Cameron Porter db47e35373 Fixed bug #50675
SOAP: Stop overwriting the node name when creating an XML node
for an object reference.
2018-10-23 14:20:19 +02:00
Remi Collet 0d273cf95d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  bump to 7.2.13-dev
  Updated to version 2018.6 (2018f)
  Updated to version 2018.6 (2018f)
2018-10-23 12:16:31 +02:00
Remi Collet 1d5baf167a bump to 7.2.13-dev 2018-10-23 12:15:30 +02:00
Christoph M. Becker 4ffa415500 [ci skip] Update NEWS wrt. php-7.3.0RC4 tagging 2018-10-23 12:10:09 +02:00
Derick Rethans c3a8313136 Updated to version 2018.6 (2018f) 2018-10-22 12:05:40 +01:00
Derick Rethans c22b9e0115 Empty merge 2018-10-22 12:05:40 +01:00
Derick Rethans 41241d109a Updated to version 2018.6 (2018f) 2018-10-22 12:05:39 +01:00
730 changed files with 213006 additions and 195348 deletions

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ environment:
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
PHP_BUILD_OBJ_DIR: c:\obj
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.9beta1
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0beta5
PHP_BUILD_CRT: vc15
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
+17 -5
View File
@@ -1,17 +1,19 @@
# http://editorconfig.org/
# https://editorconfig.org/
root = true
[*.{c,h,awk,w32,bat,mk,frag}]
[*]
tab_width = 4
[*.{c,h,y,awk,w32,bat,mk,frag,cpp}]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
tab_width = 4
trim_trailing_whitespace = true
insert_final_newline = true
[*.{php,phpt}]
[*.{php,phpt,inc}]
charset = utf-8
end_of_line = lf
indent_size = 4
@@ -31,5 +33,15 @@ insert_final_newline = true
charset = utf-8
end_of_line = lf
indent_style = space
trim_trailing_whitespace = false
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80
[COMMIT_EDITMSG]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80
+5 -1
View File
@@ -1,3 +1,6 @@
git:
quiet: true
dist: trusty
language: c
sudo: required
@@ -64,7 +67,8 @@ before_script:
# Run PHPs run-tests.php
script:
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120
- ./sapi/cli/php run-tests.php -P -d extension=`pwd`/modules/zend_test.so $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120
- sapi/cli/php -d extension_dir=`pwd`/modules -r 'dl("zend_test");'
after_success:
- ccache --show-stats
+4 -3
View File
@@ -194,7 +194,7 @@ STATUS: Working
SINCE: 5.0
-------------------------------------------------------------------------------
EXTENSION: soap
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com> (2004 - 2018)
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@php.net> (2004 - 2018)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
@@ -244,7 +244,7 @@ SINCE: 5.0
-------------------------------------------------------------------------------
EXTENSION: bcmath
MAINTENANCE: Andi Gutmans <andi@zend.com> (2000 - 2004)
MAINTENANCE: Andi Gutmans <andi@php.net> (2000 - 2004)
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: bz2
@@ -378,7 +378,7 @@ MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: opcache
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com> (2013 - 2018)
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@php.net> (2013 - 2018)
Xinchen Hui <laruence@php.net> (2013 - 2018)
MAINTENANCE: Maintained
STATUS: Working
@@ -387,6 +387,7 @@ SINCE: 5.5.0
EXTENSION: openssl
PRIMARY MAINTAINER: Wez Furlong <wez@php.net> (2001 - 2006)
Pierre-Alain Joye <pajoye@php.net> (2006 - 2011)
Jakub Zelenka <bukka@php.net> (2015 - 2019)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.4
+1529 -444
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -6,7 +6,7 @@
| This source file is subject to the TSRM license, that is bundled |
| with this package in the file LICENSE |
+----------------------------------------------------------------------+
| Authors: Zeev Suraski <zeev@zend.com> |
| Authors: Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+1 -1
View File
@@ -6,7 +6,7 @@
| This source file is subject to the TSRM license, that is bundled |
| with this package in the file LICENSE |
+----------------------------------------------------------------------+
| Authors: Zeev Suraski <zeev@zend.com> |
| Authors: Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+119 -7
View File
@@ -22,7 +22,7 @@ PHP 7.3 UPGRADE NOTES
Core:
. The ext_skel utility has been completely redesigned with new options and
some old options removed. This is now written in PHP and has no external
dependencies.
dependencies.
. Support for BeOS has been dropped.
. Exceptions thrown due to automatic conversion of warnings into exceptions
in EH_THROW mode (e.g. some DateTime exceptions) no longer populate
@@ -53,7 +53,7 @@ Core:
case "baz":
continue;
// Warning: "continue" targeting switch is equivalent to
"break". Did you mean to use "continue 2"?
// "break". Did you mean to use "continue 2"?
}
}
@@ -112,6 +112,12 @@ BCMath:
. bcmul() and bcpow() now return numbers with the requested scale. Formerly,
the returned numbers may have omitted trailing decimal zeroes.
IMAP:
rsh/ssh logins are disabled by default. Use imap.enable_insecure_rsh if you want
to enable them. Note that the IMAP library does not filter mailbox names before
passing them to rsh/ssh command, thus passing untrusted data to this function
with rsh/ssh enabled is insecure.
MBString:
. Due to added support for named captures, mb_ereg_*() patterns using named
captures will behave differently. In particular named captures will be part
@@ -245,6 +251,10 @@ Standard:
PHP be linked against libargon2 reference library >= 20161029.
(RFC: https://wiki.php.net/rfc/argon2_password_hash_enhancements).
LDAP:
. Full support for LDAP Controls has been added to LDAP querying functions
and ldap_parse_result
========================================
3. Changes in SAPI modules
========================================
@@ -254,6 +264,14 @@ phpdbg:
PHPDBG_FUNC have been removed.
FPM:
. A new global option log_limit has been added. It can be used for setting
log limit for logged line which allows to log messages longer than 1024
characters without wrapping. It also fixes various wrapping issues.
. A new global option log_buffering has been added. It allows an experimental
logging without extra buffering.
. A new pool option decorate_workers_output has been added. It allows
disabling output decoration for workers output when catch_workers_output
enabled.
. The getallheaders() function is now also available.
========================================
@@ -309,7 +327,7 @@ Standard:
. Passing a non-string needle to string search functions is deprecated. In the
future the needle will be interpreted as a string instead of an ASCII codepoint.
Depending on the intended behavior, you should either explicitly cast the
needle to string or perform an explicit call to ord(). The following functions
needle to string or perform an explicit call to chr(). The following functions
are affected:
. strpos()
. strrpos()
@@ -355,6 +373,16 @@ Standard:
PCRE:
. preg_quote() now also escapes the '#' character.
LDAP:
. Added a serverctrls parameter to send controls to the server in ldap_add,
ldap_mod_replace, ldap_mod_add, ldap_mod_del, ldap_rename,
ldap_compare, ldap_delete, ldap_modify_batch,
ldap_search, ldap_list, ldap_read
. Added an out parameter to get controls from the server in ldap_parse_result
. Fixed support for LDAP_OPT_SERVER_CONTROLS and LDAP_OPT_CLIENT_CONTROLS in
ldap_get_option and ldap_set_option.
========================================
6. New Functions
========================================
@@ -369,6 +397,10 @@ Core:
are available under Linux, FreeBSD, Windows, Mac, SunOS, AIX and their
derivatives. If no required timers are provided by a corresponding
platform, the function returns false.
. Added net_get_interfaces() to retrieve an array of available network
interfaces including several details.
. Added the gc_status() function to retrieve status information regarding the
cyclic GC.
Date:
. Added the DateTime::createFromImmutable() method, which mirrors
@@ -398,6 +430,10 @@ Intl:
. Added Normalizer::getRawDecomposition() and normalizer_get_raw_decomposition(),
to retrieve the Decomposition_Mapping property of a character.
LDAP:
. Added ldap_exop_refresh() to conveniently perform a Refresh extended
operation.
OpenSSL:
. Added openssl_pkey_derive that derives a shared secret for DH, ECDH and
possibly other future algorithms supported by EVP_PKEY_derive.
@@ -425,6 +461,13 @@ Standard:
last key of an array, respectively.
(RFC: <https://wiki.php.net/rfc/array_key_first_last>)
LDAP:
. Added functions ldap_add_ext, ldap_bind_ext, ldap_delete_ext, ldap_mod_add_ext,
ldap_mod_replace_ext, ldap_mod_del_ext, ldap_rename_ext
which gives access to the result object to be able to parse it
with ldap_parse_result and get more information than just success/failure.
========================================
7. New Classes and Interfaces
========================================
@@ -449,7 +492,7 @@ JSON:
is fully backward compatible with former PHP versions.
. FILTER_SANITIZE_ADD_SLASHES has been added as an alias of the 'magic_quotes'
filter (FILTER_SANITIZE_MAGIC_QUOTES). The 'magic_quotes' filter is subject
to removal in future versions of PHP.
to removal in future versions of PHP.
FTP:
. Set default transfer mode to binary
@@ -466,12 +509,27 @@ JSON:
. Support for ODBCRouter has been removed.
. Support for Birdstep has been removed.
PCRE:
OpenSSL:
. The min_proto_version and max_proto_version ssl stream options as well as
related constants for possible TLS protocol values have been added.
See <https://github.com/php/php-src/pull/3317>.
PCRE:
. The PCRE extension has been upgraded to PCRE2, which may cause minor
behavioral changes (for instance, character ranges in classes are now more
strictly interpreted), and augments the existing regular expression syntax.
See <https://wiki.php.net/rfc/pcre2-migration> for details.
PDO_DBLIB:
. Added the attribute PDO::DBLIB_ATTR_SKIP_EMPTY_ROWSETS to enable automatic
skipping of empty rowsets.
. Exposed the TDS version via the PDO::DBLIB_ATTR_TDS_VERSION attribute.
. DATETIME2 columns are now treated like DATETIME columns.
PDO_SQLite:
. SQLite3 databases can now be opened in read-only mode by setting the
new PDO::SQLITE_ATTR_OPEN_FLAGS attribute to PDO::SQLITE_READONLY.
Standard:
. var_export() now exports stdClass objects as an array casted to an object
(`(object) array( ... )`), rather than using the nonexistent method
@@ -482,10 +540,19 @@ PCRE:
supported transparently. Since tidyp offers no API to get the release date,
tidy_get_release() and tidy::getRelease() return 'unknown' in this case.
XML:
. The return value of the `xml_set_external_entity_ref_handler()` callback is
now also heeded if the extension has been built against libxml. Formerly,
the return value has been ignored, and parsing did never stop.
Zip:
. Building against the bundled libzip is discouraged, but still possible by
adding `--without-libzip` to the configuration.
zlib:
. Added the zlib/level context option for the compress.zlib wrapper to
facilitate setting the desired compression level.
========================================
10. New Global Constants
========================================
@@ -555,27 +622,37 @@ Curl:
. CURL_SSLVERSION_MAX_TLSv1_2
. CURL_SSLVERSION_MAX_TLSv1_3
. CURL_SSLVERSION_TLSv1_3
. CURL_VERSION_ALTSVC
. CURL_VERSION_ASYNCHDNS
. CURL_VERSION_BROTLI
. CURL_VERSION_CONV
. CURL_VERSION_CURLDEBUG
. CURL_VERSION_DEBUG
. CURL_VERSION_GSSAPI
. CURL_VERSION_GSSNEGOTIATE
. CURL_VERSION_HTTPS_PROXY
. CURL_VERSION_IDN
. CURL_VERSION_KERBEROS5
. CURL_VERSION_LARGEFILE
. CURL_VERSION_MULTI_SSL
. CURL_VERSION_NTLM
. CURL_VERSION_NTLM_WB
. CURL_VERSION_PSL
. CURL_VERSION_SPNEGO
. CURL_VERSION_SSPI
. CURL_VERSION_TLSAUTH_SRP
. CURL_VERSION_UNIX_SOCKETS
Filter:
. FILTER_SANITIZE_ADD_SLASHES
JSON:
. JSON_THROW_ON_ERROR
OpenSSL:
. STREAM_CRYPTO_PROTO_SSLv3
. STREAM_CRYPTO_PROTO_TLSv1_0
. STREAM_CRYPTO_PROTO_TLSv1_1
. STREAM_CRYPTO_PROTO_TLSv1_2
MBString:
. MB_CASE_FOLD
. MB_CASE_LOWER_SIMPLE
@@ -596,6 +673,34 @@ PGSQL:
Standard:
. PASSWORD_ARGON2ID
LDAP:
. LDAP_CONTROL_MANAGEDSAIT
. LDAP_CONTROL_PROXY_AUTHZ
. LDAP_CONTROL_SUBENTRIES
. LDAP_CONTROL_VALUESRETURNFILTER
. LDAP_CONTROL_ASSERT
. LDAP_CONTROL_PRE_READ
. LDAP_CONTROL_POST_READ
. LDAP_CONTROL_SORTREQUEST
. LDAP_CONTROL_SORTRESPONSE
. LDAP_CONTROL_PAGEDRESULTS
. LDAP_CONTROL_AUTHZID_REQUEST
. LDAP_CONTROL_AUTHZID_RESPONSE
. LDAP_CONTROL_SYNC
. LDAP_CONTROL_SYNC_STATE
. LDAP_CONTROL_SYNC_DONE
. LDAP_CONTROL_DONTUSECOPY
. LDAP_CONTROL_PASSWORDPOLICYREQUEST
. LDAP_CONTROL_PASSWORDPOLICYRESPONSE
. LDAP_CONTROL_X_INCREMENTAL_VALUES
. LDAP_CONTROL_X_DOMAIN_SCOPE
. LDAP_CONTROL_X_PERMISSIVE_MODIFY
. LDAP_CONTROL_X_SEARCH_OPTIONS
. LDAP_CONTROL_X_TREE_DELETE
. LDAP_CONTROL_X_EXTENDED_DN
. LDAP_CONTROL_VLVREQUEST
. LDAP_CONTROL_VLVRESPONSE
========================================
11. Changes to INI File Handling
========================================
@@ -625,6 +730,10 @@ Standard:
. New INI to set syslog ident string which is prepended to every message. It
is used only when error_log is set syslog.
- mbstring.regex_stack_limit
. New INI directive (since 7.3.6) limiting stack depth of mbstring/oniguruma
regular expressions.
========================================
12. Windows Support
========================================
@@ -639,3 +748,6 @@ Standard:
========================================
13. Other Changes
========================================
. The cyclic GC has been enhanced, which may result in considerable performance
improvements.
+18
View File
@@ -596,3 +596,21 @@ dnl This is the most probable fallback so we assume yes in case of cross compile
if test "$ac_cv_huge_val_nan" = "yes"; then
AC_DEFINE([HAVE_HUGE_VAL_NAN], 1, [whether HUGE_VAL + -HUGEVAL == NAN])
fi
dnl
dnl Check whether __cpuid_count is available
dnl
AC_CACHE_CHECK(whether __cpuid_count is available, ac_cv_cpuid_count_available, [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <cpuid.h>
]], [[
unsigned eax, ebx, ecx, edx;
__cpuid_count(0, 0, eax, ebx, ecx, edx);
]])], [
ac_cv_cpuid_count_available=yes
], [
ac_cv_cpuid_count_available=no
])])
if test "$ac_cv_cpuid_count_available" = "yes"; then
AC_DEFINE([HAVE_CPUID_COUNT], 1, [whether __cpuid_count is available])
fi
+7
View File
@@ -45,6 +45,13 @@ elseif (PHP_OS == 'FreeBSD') {
if ($freeMemory < 2100*1024*1024) {
die('skip Not enough memory.');
}
} elseif (PHP_OS == "WINNT") {
$s = trim(shell_exec("wmic OS get FreeVirtualMemory /Value 2>nul"));
$freeMemory = explode('=', $s)[1]*1;
if ($freeMemory < 2.1*1024*1024) {
die('skip Not enough memory.');
}
}
?>
--INI--
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #75426: "Cannot use empty array elements" reports wrong position
--FILE--
<?php
$a = [
1,
2,
3,
,
5,
6,
];
?>
--EXPECTF--
Fatal error: Cannot use empty array elements in arrays in %s on line 5
+42
View File
@@ -0,0 +1,42 @@
--TEST--
Bug #77291 (magic methods inherited from a trait may be ignored)
--FILE--
<?php
trait AccessibleProperties
{
public function __isset($property)
{
return property_exists($this, $property);
}
public function __get($property)
{
if (property_exists($this, $property)) {
return $this->$property;
}
}
}
class Foo4567 {
use AccessibleProperties;
protected $a = 'Some value';
}
class Foo45 {
use AccessibleProperties;
protected $a = 'Some value';
}
$foo = new Foo4567;
var_dump(isset($foo->a));
$foo = new Foo45;
var_dump($foo->a);
?>
===DONE===
--EXPECT--
bool(true)
string(10) "Some value"
===DONE===
+33
View File
@@ -0,0 +1,33 @@
--TEST--
Bug #77339 (__callStatic may get incorrect arguments)
--FILE--
<?php
class Foo
{
static function __callStatic($name, $arguments) {
if ($name === 'get') {
if (!isset($arguments[0])) {
var_dump(['getSomeWhat']);
var_dump($arguments);
exit;
}
}
echo "OK\n";
}
protected function get ($key) {
echo "BUG!!!\n";
}
}
class Bar
{
static function __callStatic($name, $arguments) {
echo Foo::get('getSomeWhat');
}
}
Bar::someUndefinedStaticFunction();
?>
--EXPECT--
OK
+42
View File
@@ -0,0 +1,42 @@
--TEST--
Bug #77345 (Segmentation faults stack overflow in cyclic garbage collector) (Bug #77427)
--INI--
zend.enable_gc = 1
--FILE--
<?php
class Node
{
/** @var Node */
public $previous;
/** @var Node */
public $next;
}
var_dump(gc_enabled());
var_dump('start');
$firstNode = new Node();
$firstNode->previous = $firstNode;
$firstNode->next = $firstNode;
$circularDoublyLinkedList = $firstNode;
for ($i = 0; $i < 200000; $i++) {
$currentNode = $circularDoublyLinkedList;
$nextNode = $circularDoublyLinkedList->next;
$newNode = new Node();
$newNode->previous = $currentNode;
$currentNode->next = $newNode;
$newNode->next = $nextNode;
$nextNode->previous = $newNode;
$circularDoublyLinkedList = $nextNode;
}
var_dump('end');
--EXPECT--
bool(true)
string(5) "start"
string(3) "end"
+48
View File
@@ -0,0 +1,48 @@
--TEST--
Bug #77345 (Segmentation faults stack overflow in cyclic garbage collector) (Bug #77427)
--INI--
zend.enable_gc = 1
--FILE--
<?php
class Node
{
/** @var Node */
public $previous;
/** @var Node */
public $next;
}
var_dump(gc_enabled());
var_dump('start');
function xxx() {
$firstNode = new Node();
$firstNode->previous = $firstNode;
$firstNode->next = $firstNode;
$circularDoublyLinkedList = $firstNode;
for ($i = 0; $i < 300000; $i++) {
$currentNode = $circularDoublyLinkedList;
$nextNode = $circularDoublyLinkedList->next;
$newNode = new Node();
$newNode->previous = $currentNode;
$currentNode->next = $newNode;
$newNode->next = $nextNode;
$nextNode->previous = $newNode;
$circularDoublyLinkedList = $nextNode;
}
}
xxx();
gc_collect_cycles();
var_dump('end');
--EXPECT--
bool(true)
string(5) "start"
string(3) "end"
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #77376 ("undefined function" message no longer includes namespace)
--FILE--
<?php
namespace Hello;
World();
?>
--EXPECTF--
Fatal error: Uncaught Error: Call to undefined function Hello\World() %sbug77376.php:%d
Stack trace:
#0 {main}
thrown in %sbug77376.php on line %d
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #77494 (Disabling class causes segfault on member access)
--SKIPIF--
<?php if (!extension_loaded("curl")) exit("skip curl extension not loaded"); ?>
--INI--
disable_classes=CURLFile
--FILE--
<?php
$a = new CURLFile();
var_dump($a->name);
?>
--EXPECTF--
Warning: CURLFile() has been disabled for security reasons in %sbug77494.php on line 2
Notice: Undefined property: CURLFile::$name in %sbug77494.php on line 3
NULL
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #77530: PHP crashes when parsing '(2)::class'
--FILE--
<?php
echo (2)::class;
?>
--EXPECTF--
Fatal error: Illegal class name in %s on line %d
+40
View File
@@ -0,0 +1,40 @@
--TEST--
BUG #77589 (Core dump using parse_ini_string with numeric sections)
--FILE--
<?php
var_dump(
parse_ini_string(<<<INI
[0]
a = 1
b = on
c = true
["true"]
a = 100
b = null
c = yes
INI
, TRUE, INI_SCANNER_TYPED));
?>
--EXPECT--
array(2) {
[0]=>
array(3) {
["a"]=>
int(1)
["b"]=>
bool(true)
["c"]=>
bool(true)
}
["true"]=>
array(3) {
["a"]=>
int(100)
["b"]=>
NULL
["c"]=>
bool(true)
}
}
+6
View File
@@ -0,0 +1,6 @@
<?php
return [
'I' => function() {
return new class implements I {};
},
];
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #77652: Anonymous classes can lose their interface information
--FILE--
<?php
interface I {}
require __DIR__ . '/bug77652.inc';
$data = require __DIR__ . '/bug77652.inc';
print_r(class_implements($data['I']()));
?>
--EXPECT--
Array
(
[I] => I
)
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #77660 (Segmentation fault on break 2147483648)
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
--FILE--
<?php
for(;;) break 2147483648;
?>
--EXPECTF--
Fatal error: Cannot 'break' 2147483648 levels in %sbug77660.php on line %d
+8
View File
@@ -0,0 +1,8 @@
--TEST--
Bug #77738 (Nullptr deref in zend_compile_expr)
--FILE--
<?php
__COMPILER_HALT_OFFSET__;
; // <- important
--EXPECTF--
Warning: Use of undefined constant __COMPILER_HALT_OFFSET__ - assumed '__COMPILER_HALT_OFFSET__' %sbug77738.php on line %d
+7
View File
@@ -0,0 +1,7 @@
--TEST--
Bug #77993 (Wrong parse error for invalid hex literal on Windows)
--FILE--
<?php
0xg10;
--EXPECTF--
Parse error: syntax error, unexpected 'xg10' (T_STRING) in %s on line %d
@@ -0,0 +1,30 @@
--TEST--
Calling exception getters when properties hold references
--FILE--
<?php
class MyException extends Exception {
public function __construct(&$refMsg, &$refCode, &$refFile, &$refLine) {
$this->message =& $refMsg;
$this->code =& $refCode;
$this->file =& $refFile;
$this->line =& $refLine;
}
}
$refMsg = "foo";
$refCode = 0;
$refFile = "foobar";
$refLine = 42;
$ex = new MyException($refMsg, $refCode, $refFile, $refLine);
var_dump($ex->getMessage());
var_dump($ex->getCode());
var_dump($ex->getFile());
var_dump($ex->getLine());
?>
--EXPECT--
string(3) "foo"
int(0)
string(6) "foobar"
int(42)
@@ -0,0 +1,18 @@
--TEST--
Perform a packed to hash insert when the iterator is at the end of the array
--FILE--
<?php
$a = [];
$a[1] = 1;
foreach ($a as $k => &$v) {
var_dump($v);
if ($k == 1) $a[4] = 4;
if ($k == 4) $a[2] = 2;
}
?>
--EXPECT--
int(1)
int(4)
int(2)
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Inherit internal static property into userland class
--SKIPIF--
<?php if (!extension_loaded('zend-test')) die('skip requires zend-test'); ?>
--FILE--
<?php
class Test extends _ZendTestClass {
}
var_dump(Test::$_StaticProp);
_ZendTestClass::$_StaticProp = 42;
var_dump(Test::$_StaticProp);
?>
--EXPECT--
NULL
int(42)
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug object gc not working in shutdown
--FILE--
<?php
ini_set('memory_limit', '2M');
register_shutdown_function(function () {
for ($n = 1000 * 1000; $n--;) {
new stdClass;
}
echo "OK\n";
});
?>
--EXPECT--
OK
@@ -0,0 +1,23 @@
--TEST--
Use of self::class inside a constant in an unknown scope
--FILE--
<?php
class Test {
public function foobar() {
eval("
const FOO = self::class;
var_dump(FOO);
");
}
}
(new Test)->foobar();
// This should error, but doesn't
const BAR = self::class;
var_dump(BAR);
?>
--EXPECT--
string(4) "Test"
string(0) ""
@@ -0,0 +1,17 @@
--TEST--
The parent class is not necessarily the class of the prototype
--FILE--
<?php
class A {
function test(): B {}
}
class B extends A {}
class C extends B {
function test(): parent {}
}
?>
===DONE===
--EXPECT--
===DONE===
+18 -18
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
@@ -373,17 +373,17 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
switch (Z_TYPE_P(expr)) {
case IS_ARRAY:
ZEND_PUTS("Array (");
if (Z_REFCOUNTED_P(expr)) {
if (Z_IS_RECURSIVE_P(expr)) {
if (!(GC_FLAGS(Z_ARRVAL_P(expr)) & GC_IMMUTABLE)) {
if (GC_IS_RECURSIVE(Z_ARRVAL_P(expr))) {
ZEND_PUTS(" *RECURSION*");
return;
}
Z_PROTECT_RECURSION_P(expr);
GC_PROTECT_RECURSION(Z_ARRVAL_P(expr));
}
print_flat_hash(Z_ARRVAL_P(expr));
ZEND_PUTS(")");
if (Z_REFCOUNTED_P(expr)) {
Z_UNPROTECT_RECURSION_P(expr);
if (!(GC_FLAGS(Z_ARRVAL_P(expr)) & GC_IMMUTABLE)) {
GC_UNPROTECT_RECURSION(Z_ARRVAL_P(expr));
}
break;
case IS_OBJECT:
@@ -393,7 +393,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
zend_printf("%s Object (", ZSTR_VAL(class_name));
zend_string_release_ex(class_name, 0);
if (Z_IS_RECURSIVE_P(expr)) {
if (GC_IS_RECURSIVE(Z_OBJ_P(expr))) {
ZEND_PUTS(" *RECURSION*");
return;
}
@@ -402,9 +402,9 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
properties = Z_OBJPROP_P(expr);
}
if (properties) {
Z_PROTECT_RECURSION_P(expr);
GC_PROTECT_RECURSION(Z_OBJ_P(expr));
print_flat_hash(properties);
Z_UNPROTECT_RECURSION_P(expr);
GC_UNPROTECT_RECURSION(Z_OBJ_P(expr));
}
ZEND_PUTS(")");
break;
@@ -424,16 +424,16 @@ static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /*
switch (Z_TYPE_P(expr)) {
case IS_ARRAY:
smart_str_appends(buf, "Array\n");
if (Z_REFCOUNTED_P(expr)) {
if (Z_IS_RECURSIVE_P(expr)) {
if (!(GC_FLAGS(Z_ARRVAL_P(expr)) & GC_IMMUTABLE)) {
if (GC_IS_RECURSIVE(Z_ARRVAL_P(expr))) {
smart_str_appends(buf, " *RECURSION*");
return;
}
Z_PROTECT_RECURSION_P(expr);
GC_PROTECT_RECURSION(Z_ARRVAL_P(expr));
}
print_hash(buf, Z_ARRVAL_P(expr), indent, 0);
if (Z_REFCOUNTED_P(expr)) {
Z_UNPROTECT_RECURSION_P(expr);
if (!(GC_FLAGS(Z_ARRVAL_P(expr)) & GC_IMMUTABLE)) {
GC_UNPROTECT_RECURSION(Z_ARRVAL_P(expr));
}
break;
case IS_OBJECT:
@@ -446,7 +446,7 @@ static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /*
zend_string_release_ex(class_name, 0);
smart_str_appends(buf, " Object\n");
if (Z_IS_RECURSIVE_P(expr)) {
if (GC_IS_RECURSIVE(Z_OBJ_P(expr))) {
smart_str_appends(buf, " *RECURSION*");
return;
}
@@ -454,9 +454,9 @@ static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /*
break;
}
Z_PROTECT_RECURSION_P(expr);
GC_PROTECT_RECURSION(Z_OBJ_P(expr));
print_hash(buf, properties, indent, 1);
Z_UNPROTECT_RECURSION_P(expr);
GC_UNPROTECT_RECURSION(Z_OBJ_P(expr));
if (is_temp) {
zend_hash_destroy(properties);
+3 -3
View File
@@ -12,15 +12,15 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "3.3.0-dev"
#define ZEND_VERSION "3.3.6"
#define ZEND_ENGINE_3
+36 -15
View File
@@ -12,10 +12,10 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Andrei Zmievski <andrei@php.net> |
| Dmitry Stogov <dmitry@zend.com> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
@@ -2051,13 +2051,13 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /
}
name_len = strlen(module->name);
lcname = zend_string_alloc(name_len, 1);
lcname = zend_string_alloc(name_len, module->type == MODULE_PERSISTENT);
zend_str_tolower_copy(ZSTR_VAL(lcname), module->name, name_len);
lcname = zend_new_interned_string(lcname);
if ((module_ptr = zend_hash_add_mem(&module_registry, lcname, module, sizeof(zend_module_entry))) == NULL) {
zend_error(E_CORE_WARNING, "Module '%s' already loaded", module->name);
zend_string_release_ex(lcname, 1);
zend_string_release(lcname);
return NULL;
}
module = module_ptr;
@@ -2065,14 +2065,14 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /
if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type)==FAILURE) {
zend_hash_del(&module_registry, lcname);
zend_string_release_ex(lcname, 1);
zend_string_release(lcname);
EG(current_module) = NULL;
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name);
return NULL;
}
EG(current_module) = NULL;
zend_string_release_ex(lcname, 1);
zend_string_release(lcname);
return module;
}
/* }}} */
@@ -2279,14 +2279,14 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
return FAILURE;
}
}
lowercase_name = zend_string_tolower_ex(internal_function->function_name, 1);
lowercase_name = zend_string_tolower_ex(internal_function->function_name, type == MODULE_PERSISTENT);
lowercase_name = zend_new_interned_string(lowercase_name);
reg_function = malloc(sizeof(zend_internal_function));
memcpy(reg_function, &function, sizeof(zend_internal_function));
if (zend_hash_add_ptr(target_function_table, lowercase_name, reg_function) == NULL) {
unload=1;
free(reg_function);
zend_string_release_ex(lowercase_name, 1);
zend_string_release(lowercase_name);
break;
}
@@ -2378,7 +2378,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
}
ptr++;
count++;
zend_string_release_ex(lowercase_name, 1);
zend_string_release(lowercase_name);
}
if (unload) { /* before unloading, display all remaining bad function in the module */
if (scope) {
@@ -2724,10 +2724,10 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class
class_entry->info.internal.module = EG(current_module);
if (class_entry->info.internal.builtin_functions) {
zend_register_functions(class_entry, class_entry->info.internal.builtin_functions, &class_entry->function_table, MODULE_PERSISTENT);
zend_register_functions(class_entry, class_entry->info.internal.builtin_functions, &class_entry->function_table, EG(current_module)->type);
}
lowercase_name = zend_string_tolower_ex(orig_class_entry->name, 1);
lowercase_name = zend_string_tolower_ex(orig_class_entry->name, EG(current_module)->type == MODULE_PERSISTENT);
lowercase_name = zend_new_interned_string(lowercase_name);
zend_hash_update_ptr(CG(class_table), lowercase_name, class_entry);
zend_string_release_ex(lowercase_name, 1);
@@ -2786,6 +2786,11 @@ ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zen
{
zend_string *lcname;
/* TODO: Move this out of here in 7.4. */
if (persistent && EG(current_module) && EG(current_module)->type == MODULE_TEMPORARY) {
persistent = 0;
}
if (name[0] == '\\') {
lcname = zend_string_alloc(name_len-1, persistent);
zend_str_tolower_copy(ZSTR_VAL(lcname), name+1, name_len-1);
@@ -2861,6 +2866,17 @@ static zend_object *display_disabled_class(zend_class_entry *class_type) /* {{{
zend_object *intern;
intern = zend_objects_new(class_type);
/* Initialize default properties */
if (EXPECTED(class_type->default_properties_count != 0)) {
zval *p = intern->properties_table;
zval *end = p + class_type->default_properties_count;
do {
ZVAL_UNDEF(p);
p++;
} while (p != end);
}
zend_error(E_WARNING, "%s() has been disabled for security reasons", ZSTR_VAL(class_type->name));
return intern;
}
@@ -3685,6 +3701,11 @@ static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */
return Z_STR_P(zv);
}
static zend_always_inline zend_bool is_persistent_class(zend_class_entry *ce) {
return (ce->type & ZEND_INTERNAL_CLASS)
&& ce->info.internal.module->type == MODULE_PERSISTENT;
}
ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, zval *property, int access_type, zend_string *doc_comment) /* {{{ */
{
zend_property_info *property_info, *property_info_ptr;
@@ -3750,10 +3771,10 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, z
if (access_type & ZEND_ACC_PUBLIC) {
property_info->name = zend_string_copy(name);
} else if (access_type & ZEND_ACC_PRIVATE) {
property_info->name = zend_mangle_property_name(ZSTR_VAL(ce->name), ZSTR_LEN(ce->name), ZSTR_VAL(name), ZSTR_LEN(name), ce->type & ZEND_INTERNAL_CLASS);
property_info->name = zend_mangle_property_name(ZSTR_VAL(ce->name), ZSTR_LEN(ce->name), ZSTR_VAL(name), ZSTR_LEN(name), is_persistent_class(ce));
} else {
ZEND_ASSERT(access_type & ZEND_ACC_PROTECTED);
property_info->name = zend_mangle_property_name("*", 1, ZSTR_VAL(name), ZSTR_LEN(name), ce->type & ZEND_INTERNAL_CLASS);
property_info->name = zend_mangle_property_name("*", 1, ZSTR_VAL(name), ZSTR_LEN(name), is_persistent_class(ce));
}
property_info->name = zend_new_interned_string(property_info->name);
@@ -3768,7 +3789,7 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, z
ZEND_API int zend_declare_property(zend_class_entry *ce, const char *name, size_t name_length, zval *property, int access_type) /* {{{ */
{
zend_string *key = zend_string_init(name, name_length, ce->type & ZEND_INTERNAL_CLASS);
zend_string *key = zend_string_init(name, name_length, is_persistent_class(ce));
int ret = zend_declare_property_ex(ce, key, property, access_type, NULL);
zend_string_release(key);
return ret;
+3 -3
View File
@@ -12,10 +12,10 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Andrei Zmievski <andrei@php.net> |
| Dmitry Stogov <dmitry@zend.com> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+10 -11
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
@@ -191,9 +191,7 @@ typedef struct _zend_mm_free_slot zend_mm_free_slot;
typedef struct _zend_mm_chunk zend_mm_chunk;
typedef struct _zend_mm_huge_list zend_mm_huge_list;
#ifdef MAP_HUGETLB
int zend_mm_use_huge_pages = 0;
#endif
/*
* Memory is retrived from OS by chunks of fixed size 2MB.
@@ -714,7 +712,9 @@ static void *zend_mm_chunk_alloc_int(size_t size, size_t alignment)
return NULL;
} else if (ZEND_MM_ALIGNED_OFFSET(ptr, alignment) == 0) {
#ifdef MADV_HUGEPAGE
madvise(ptr, size, MADV_HUGEPAGE);
if (zend_mm_use_huge_pages) {
madvise(ptr, size, MADV_HUGEPAGE);
}
#endif
return ptr;
} else {
@@ -745,7 +745,9 @@ static void *zend_mm_chunk_alloc_int(size_t size, size_t alignment)
zend_mm_munmap((char*)ptr + size, alignment - REAL_PAGE_SIZE);
}
# ifdef MADV_HUGEPAGE
madvise(ptr, size, MADV_HUGEPAGE);
if (zend_mm_use_huge_pages) {
madvise(ptr, size, MADV_HUGEPAGE);
}
# endif
#endif
return ptr;
@@ -2668,9 +2670,7 @@ ZEND_API void shutdown_memory_manager(int silent, int full_shutdown)
static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
{
#if ZEND_MM_CUSTOM || MAP_HUGETLB
char *tmp;
#endif
#if ZEND_MM_CUSTOM
tmp = getenv("USE_ZEND_ALLOC");
@@ -2684,12 +2684,11 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
return;
}
#endif
#ifdef MAP_HUGETLB
tmp = getenv("USE_ZEND_ALLOC_HUGE_PAGES");
if (tmp && zend_atoi(tmp, 0)) {
zend_mm_use_huge_pages = 1;
}
#endif
ZEND_TSRMLS_CACHE_UPDATE();
alloc_globals->mm_heap = zend_mm_init();
}
+3 -3
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+1 -1
View File
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Dmitry Stogov <dmitry@zend.com> |
| Authors: Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+1 -1
View File
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Dmitry Stogov <dmitry@zend.com> |
| Authors: Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+1 -1
View File
@@ -13,7 +13,7 @@
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Bob Weinand <bwoebi@php.net> |
| Dmitry Stogov <dmitry@zend.com> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+1 -1
View File
@@ -13,7 +13,7 @@
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Bob Weinand <bwoebi@php.net> |
| Dmitry Stogov <dmitry@zend.com> |
| Dmitry Stogov <dmitry@php.net> |
| Nikita Popov <nikic@php.net> |
+----------------------------------------------------------------------+
*/
+1 -1
View File
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Dmitry Stogov <dmitry@zend.com> |
| Authors: Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+1 -1
View File
@@ -13,7 +13,7 @@
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Christian Seiler <chris_se@gmx.net> |
| Dmitry Stogov <dmitry@zend.com> |
| Dmitry Stogov <dmitry@php.net> |
| Marcus Boerger <helly@php.net> |
+----------------------------------------------------------------------+
*/
+1 -1
View File
@@ -13,7 +13,7 @@
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Christian Seiler <chris_se@gmx.net> |
| Dmitry Stogov <dmitry@zend.com> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+78 -25
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Nikita Popov <nikic@php.net> |
+----------------------------------------------------------------------+
*/
@@ -480,10 +480,12 @@ static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */
/* Common part of zend_add_literal and zend_append_individual_literal */
static inline void zend_insert_literal(zend_op_array *op_array, zval *zv, int literal_position) /* {{{ */
{
zval *lit = CT_CONSTANT_EX(op_array, literal_position);
if (Z_TYPE_P(zv) == IS_STRING) {
zval_make_interned_string(zv);
}
ZVAL_COPY_VALUE(CT_CONSTANT_EX(op_array, literal_position), zv);
ZVAL_COPY_VALUE(lit, zv);
Z_EXTRA_P(lit) = 0;
}
/* }}} */
@@ -1478,6 +1480,7 @@ static void zend_ensure_valid_class_fetch_type(uint32_t fetch_type) /* {{{ */
static zend_bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_ast *class_ast, zend_ast *name_ast, zend_bool constant) /* {{{ */
{
uint32_t fetch_type;
zval *class_name;
if (name_ast->kind != ZEND_AST_ZVAL) {
return 0;
@@ -1492,12 +1495,18 @@ static zend_bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_a
"Dynamic class names are not allowed in compile-time ::class fetch");
}
fetch_type = zend_get_class_fetch_type(zend_ast_get_str(class_ast));
class_name = zend_ast_get_zval(class_ast);
if (Z_TYPE_P(class_name) != IS_STRING) {
zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name");
}
fetch_type = zend_get_class_fetch_type(Z_STR_P(class_name));
zend_ensure_valid_class_fetch_type(fetch_type);
switch (fetch_type) {
case ZEND_FETCH_CLASS_SELF:
if (constant || (CG(active_class_entry) && zend_is_scope_known())) {
if (CG(active_class_entry) && zend_is_scope_known()) {
ZVAL_STR_COPY(zv, CG(active_class_entry)->name);
} else {
ZVAL_NULL(zv);
@@ -2444,7 +2453,6 @@ static inline void zend_handle_numeric_dim(zend_op *opline, znode *dim_node) /*
return;
}
}
Z_EXTRA_P(CT_CONSTANT(opline->op2)) = 0;
}
/* }}} */
@@ -3650,7 +3658,7 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
}
/* }}} */
static int zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, zend_function *fbc) /* {{{ */
static void zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, zend_function *fbc) /* {{{ */
{
if (EG(assertions) >= 0) {
znode name_node;
@@ -3693,8 +3701,6 @@ static int zend_compile_assert(znode *result, zend_ast_list *args, zend_string *
result->op_type = IS_CONST;
ZVAL_TRUE(&result->u.constant);
}
return SUCCESS;
}
/* }}} */
@@ -3901,10 +3907,6 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
return FAILURE;
}
if (zend_string_equals_literal(lcname, "assert")) {
return zend_compile_assert(result, args, lcname, fbc);
}
if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) {
return FAILURE;
}
@@ -4007,8 +4009,16 @@ void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
zend_op *opline;
lcname = zend_string_tolower(Z_STR_P(name));
fbc = zend_hash_find_ptr(CG(function_table), lcname);
/* Special assert() handling should apply independently of compiler flags. */
if (fbc && zend_string_equals_literal(lcname, "assert")) {
zend_compile_assert(result, zend_ast_get_list(args_ast), lcname, fbc);
zend_string_release(lcname);
zval_ptr_dtor(&name_node.u.constant);
return;
}
if (!fbc
|| (fbc->type == ZEND_INTERNAL_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS))
|| (fbc->type == ZEND_USER_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS))
@@ -4152,6 +4162,14 @@ void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type) /* {{
if (ce) {
zend_string *lcname = Z_STR_P(CT_CONSTANT(opline->op2) + 1);
fbc = zend_hash_find_ptr(&ce->function_table, lcname);
if (fbc && !(fbc->common.fn_flags & ZEND_ACC_PUBLIC)) {
if (ce != CG(active_class_entry)
&&((fbc->common.fn_flags & ZEND_ACC_PRIVATE)
|| !zend_check_protected(zend_get_function_root_class(fbc), CG(active_class_entry)))) {
/* incompatibe function */
fbc = NULL;
}
}
}
}
@@ -4510,7 +4528,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
zend_ast *depth_ast = ast->child[0];
zend_op *opline;
int depth;
zend_long depth;
ZEND_ASSERT(ast->kind == ZEND_AST_BREAK || ast->kind == ZEND_AST_CONTINUE);
@@ -4537,7 +4555,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
ast->kind == ZEND_AST_BREAK ? "break" : "continue");
} else {
if (!zend_handle_loops_and_finally_ex(depth, NULL)) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot '%s' %d level%s",
zend_error_noreturn(E_COMPILE_ERROR, "Cannot '%s' " ZEND_LONG_FMT " level%s",
ast->kind == ZEND_AST_BREAK ? "break" : "continue",
depth, depth == 1 ? "" : "s");
}
@@ -4554,12 +4572,12 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
if (depth == 1) {
zend_error(E_WARNING,
"\"continue\" targeting switch is equivalent to \"break\". " \
"Did you mean to use \"continue %d\"?",
"Did you mean to use \"continue " ZEND_LONG_FMT "\"?",
depth + 1);
} else {
zend_error(E_WARNING,
"\"continue %d\" targeting switch is equivalent to \"break %d\". " \
"Did you mean to use \"continue %d\"?",
"\"continue " ZEND_LONG_FMT "\" targeting switch is equivalent to \"break " ZEND_LONG_FMT "\". " \
"Did you mean to use \"continue " ZEND_LONG_FMT "\"?",
depth, depth, depth + 1);
}
}
@@ -4845,6 +4863,10 @@ void zend_compile_foreach(zend_ast *ast) /* {{{ */
zend_compile_stmt(stmt_ast);
/* Place JMP and FE_FREE on the line where foreach starts. It would be
* better to use the end line, but this information is not available
* currently. */
CG(zend_lineno) = ast->lineno;
zend_emit_jump(opnum_fetch);
opline = &CG(active_op_array)->opcodes[opnum_reset];
@@ -4943,6 +4965,10 @@ static zend_uchar determine_switch_jumptable_type(zend_ast_list *cases) {
}
static zend_bool should_use_jumptable(zend_ast_list *cases, zend_uchar jumptable_type) {
if (CG(compiler_options) & ZEND_COMPILE_NO_JUMPTABLES) {
return 0;
}
/* Thresholds are chosen based on when the average switch time for equidistributed
* input becomes smaller when using the jumptable optimization. */
if (jumptable_type == IS_LONG) {
@@ -6414,10 +6440,32 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
if (!zend_hash_exists(CG(class_table), lcname)) {
zend_hash_add_ptr(CG(class_table), lcname, ce);
} else {
/* this anonymous class has been included */
/* This anonymous class has been included, reuse the existing definition.
* NB: This behavior is buggy, and this should always result in a separate
* class declaration. However, until the problem of RTD key collisions is
* solved, this gives a behavior close to what is expected. */
zval zv;
ZVAL_PTR(&zv, ce);
destroy_zend_class(&zv);
ce = zend_hash_find_ptr(CG(class_table), lcname);
/* Manually replicate emission of necessary inheritance opcodes here. We cannot
* reuse the general code, as we only want to emit the opcodes, without modifying
* the reused class definition. */
if (ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS) {
zend_emit_op(NULL, ZEND_BIND_TRAITS, &declare_node, NULL);
}
if (implements_ast) {
zend_ast_list *iface_list = zend_ast_get_list(implements_ast);
uint32_t i;
for (i = 0; i < iface_list->children; i++) {
opline = zend_emit_op(NULL, ZEND_ADD_INTERFACE, &declare_node, NULL);
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),
zend_resolve_class_name_ast(iface_list->child[i]));
}
zend_emit_op(NULL, ZEND_VERIFY_ABSTRACT_CLASS, &declare_node, NULL);
}
return;
}
} else {
@@ -6982,6 +7030,7 @@ static inline void zend_ct_eval_greater(zval *result, zend_ast_kind kind, zval *
static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
zend_ast *last_elem_ast = NULL;
uint32_t i;
zend_bool is_constant = 1;
@@ -6994,6 +7043,10 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
zend_ast *elem_ast = list->child[i];
if (elem_ast == NULL) {
/* Report error at line of last non-empty element */
if (last_elem_ast) {
CG(zend_lineno) = zend_ast_get_lineno(last_elem_ast);
}
zend_error(E_COMPILE_ERROR, "Cannot use empty array elements in arrays");
}
@@ -7005,6 +7058,8 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
) {
is_constant = 0;
}
last_elem_ast = elem_ast;
}
if (!is_constant) {
@@ -7706,11 +7761,11 @@ void zend_compile_const(znode *result, zend_ast *ast) /* {{{ */
if (zend_string_equals_literal(resolved_name, "__COMPILER_HALT_OFFSET__") || (name_ast->attr != ZEND_NAME_RELATIVE && zend_string_equals_literal(orig_name, "__COMPILER_HALT_OFFSET__"))) {
zend_ast *last = CG(ast);
while (last->kind == ZEND_AST_STMT_LIST) {
while (last && last->kind == ZEND_AST_STMT_LIST) {
zend_ast_list *list = zend_ast_get_list(last);
last = list->child[list->children-1];
}
if (last->kind == ZEND_AST_HALT_COMPILER) {
if (last && last->kind == ZEND_AST_HALT_COMPILER) {
result->op_type = IS_CONST;
ZVAL_LONG(&result->u.constant, Z_LVAL_P(zend_ast_get_zval(last->child[0])));
zend_string_release_ex(resolved_name, 0);
@@ -8066,9 +8121,7 @@ void zend_compile_const_expr_magic_const(zend_ast **ast_ptr) /* {{{ */
zend_ast *ast = *ast_ptr;
/* Other cases already resolved by constant folding */
ZEND_ASSERT(ast->attr == T_CLASS_C &&
CG(active_class_entry) &&
(CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) != 0);
ZEND_ASSERT(ast->attr == T_CLASS_C);
zend_ast_destroy(ast);
*ast_ptr = zend_ast_create(ZEND_AST_CONSTANT_CLASS);
+5 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
@@ -1048,6 +1048,9 @@ END_EXTERN_C()
/* result of compilation may be stored in file cache */
#define ZEND_COMPILE_WITH_FILE_CACHE (1<<11)
/* disable jumptable optimization for switch statements */
#define ZEND_COMPILE_NO_JUMPTABLES (1<<12)
/* The default value for CG(compiler_options) */
#define ZEND_COMPILE_DEFAULT ZEND_COMPILE_HANDLE_OP_ARRAY
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+5 -3
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
@@ -378,7 +378,9 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
ret_constant = NULL;
} else {
if (!zend_verify_const_access(c, scope)) {
zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
}
goto failure;
}
ret_constant = &c->value;
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+24 -4
View File
@@ -29,18 +29,30 @@ typedef struct _zend_cpu_info {
static zend_cpu_info cpuinfo = {0};
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
# ifdef HAVE_CPUID_H
# if defined(HAVE_CPUID_H) && defined(HAVE_CPUID_COUNT)
# include <cpuid.h>
static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) {
__cpuid_count(func, subfunc, cpuinfo->eax, cpuinfo->ebx, cpuinfo->ecx, cpuinfo->edx);
}
# else
static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) {
#if defined(__i386__) && (defined(__pic__) || defined(__PIC__))
/* PIC on i386 uses %ebx, so preserve it. */
__asm__ __volatile__ (
"pushl %%ebx\n"
"cpuid\n"
"mov %%ebx,%1\n"
"popl %%ebx"
: "=a"(cpuinfo->eax), "=r"(cpuinfo->ebx), "=c"(cpuinfo->ecx), "=d"(cpuinfo->edx)
: "a"(func), "c"(subfunc)
);
#else
__asm__ __volatile__ (
"cpuid"
: "=a"(cpuinfo->eax), "=b"(cpuinfo->ebx), "=c"(cpuinfo->ecx), "=d"(cpuinfo->edx)
: "a"(func), "c"(subfunc)
);
#endif
}
# endif
#elif defined(ZEND_WIN32) && !defined(__clang__)
@@ -65,16 +77,24 @@ void zend_cpu_startup(void)
{
if (!cpuinfo.initialized) {
zend_cpu_info ebx;
int max_feature;
cpuinfo.initialized = 1;
__zend_cpuid(0, 0, &cpuinfo);
if (cpuinfo.eax == 0) {
max_feature = cpuinfo.eax;
if (max_feature == 0) {
return;
}
__zend_cpuid(1, 0, &cpuinfo);
/* for avx2 */
__zend_cpuid(7, 0, &ebx);
cpuinfo.ebx = ebx.ebx;
if (max_feature >= 7) {
__zend_cpuid(7, 0, &ebx);
cpuinfo.ebx = ebx.ebx;
} else {
cpuinfo.ebx = 0;
}
}
}
+16
View File
@@ -100,12 +100,22 @@ typedef enum _zend_cpu_feature {
void zend_cpu_startup();
ZEND_API int zend_cpu_supports(zend_cpu_feature feature);
/* Address sanitizer is incompatible with ifunc resolvers, so exclude the
* CPU support helpers from asan.
* See also https://github.com/google/sanitizers/issues/342. */
#if __has_attribute(no_sanitize_address)
# define ZEND_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
#else
# define ZEND_NO_SANITIZE_ADDRESS
#endif
#if PHP_HAVE_BUILTIN_CPU_SUPPORTS
/* NOTE: you should use following inline function in
* resolver functions (ifunc), as it could be called
* before all PLT symbols are resloved. in other words,
* resolver functions should not depends any external
* functions */
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_sse2() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
@@ -113,6 +123,7 @@ static zend_always_inline int zend_cpu_supports_sse2() {
return __builtin_cpu_supports("sse2");
}
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_sse3() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
@@ -120,6 +131,7 @@ static zend_always_inline int zend_cpu_supports_sse3() {
return __builtin_cpu_supports("sse3");
}
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_ssse3() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
@@ -127,6 +139,7 @@ static zend_always_inline int zend_cpu_supports_ssse3() {
return __builtin_cpu_supports("ssse3");
}
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_sse41() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
@@ -134,6 +147,7 @@ static zend_always_inline int zend_cpu_supports_sse41() {
return __builtin_cpu_supports("sse4.1");
}
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_sse42() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
@@ -141,6 +155,7 @@ static zend_always_inline int zend_cpu_supports_sse42() {
return __builtin_cpu_supports("sse4.2");
}
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_avx() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
@@ -148,6 +163,7 @@ static zend_always_inline int zend_cpu_supports_avx() {
return __builtin_cpu_supports("avx");
}
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_avx2() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+26 -14
View File
@@ -12,10 +12,10 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Marcus Boerger <helly@php.net> |
| Sterling Hughes <sterling@php.net> |
| Zeev Suraski <zeev@zend.com> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
@@ -400,11 +400,13 @@ ZEND_METHOD(error_exception, __construct)
Get the file in which the exception occurred */
ZEND_METHOD(exception, getFile)
{
zval rv;
zval *prop, rv;
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_FILE));
prop = GET_PROPERTY(getThis(), ZEND_STR_FILE);
ZVAL_DEREF(prop);
ZVAL_COPY(return_value, prop);
}
/* }}} */
@@ -412,11 +414,13 @@ ZEND_METHOD(exception, getFile)
Get the line in which the exception occurred */
ZEND_METHOD(exception, getLine)
{
zval rv;
zval *prop, rv;
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_LINE));
prop = GET_PROPERTY(getThis(), ZEND_STR_LINE);
ZVAL_DEREF(prop);
ZVAL_COPY(return_value, prop);
}
/* }}} */
@@ -424,11 +428,13 @@ ZEND_METHOD(exception, getLine)
Get the exception message */
ZEND_METHOD(exception, getMessage)
{
zval rv;
zval *prop, rv;
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_MESSAGE));
prop = GET_PROPERTY(getThis(), ZEND_STR_MESSAGE);
ZVAL_DEREF(prop);
ZVAL_COPY(return_value, prop);
}
/* }}} */
@@ -436,11 +442,13 @@ ZEND_METHOD(exception, getMessage)
Get the exception code */
ZEND_METHOD(exception, getCode)
{
zval rv;
zval *prop, rv;
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_CODE));
prop = GET_PROPERTY(getThis(), ZEND_STR_CODE);
ZVAL_DEREF(prop);
ZVAL_COPY(return_value, prop);
}
/* }}} */
@@ -448,11 +456,13 @@ ZEND_METHOD(exception, getCode)
Get the stack trace for the location in which the exception occurred */
ZEND_METHOD(exception, getTrace)
{
zval rv;
zval *prop, rv;
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_TRACE));
prop = GET_PROPERTY(getThis(), ZEND_STR_TRACE);
ZVAL_DEREF(prop);
ZVAL_COPY(return_value, prop);
}
/* }}} */
@@ -460,11 +470,13 @@ ZEND_METHOD(exception, getTrace)
Get the exception severity */
ZEND_METHOD(error_exception, getSeverity)
{
zval rv;
zval *prop, rv;
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_SEVERITY));
prop = GET_PROPERTY(getThis(), ZEND_STR_SEVERITY);
ZVAL_DEREF(prop);
ZVAL_COPY(return_value, prop);
}
/* }}} */
+2 -2
View File
@@ -12,10 +12,10 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Marcus Boerger <helly@php.net> |
| Sterling Hughes <sterling@php.net> |
| Zeev Suraski <zeev@zend.com> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+16 -6
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
@@ -170,9 +170,9 @@ ZEND_API const zend_internal_function zend_pass_function = {
#define ZEND_VM_STACK_PAGE_SIZE (ZEND_VM_STACK_PAGE_SLOTS * sizeof(zval))
#define ZEND_VM_STACK_PAGE_ALIGNED_SIZE(size) \
#define ZEND_VM_STACK_PAGE_ALIGNED_SIZE(size, page_size) \
(((size) + ZEND_VM_STACK_HEADER_SLOTS * sizeof(zval) \
+ (ZEND_VM_STACK_PAGE_SIZE - 1)) & ~(ZEND_VM_STACK_PAGE_SIZE - 1))
+ ((page_size) - 1)) & ~((page_size) - 1))
static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t size, zend_vm_stack prev) {
zend_vm_stack page = (zend_vm_stack)emalloc(size);
@@ -192,6 +192,16 @@ ZEND_API void zend_vm_stack_init(void)
EG(vm_stack_end) = EG(vm_stack)->end;
}
ZEND_API void zend_vm_stack_init_ex(size_t page_size)
{
/* page_size must be a power of 2 */
ZEND_ASSERT(page_size > 0 && (page_size & (page_size - 1)) == 0);
EG(vm_stack_page_size) = page_size;
EG(vm_stack) = zend_vm_stack_new_page(page_size, NULL);
EG(vm_stack_top) = EG(vm_stack)->top;
EG(vm_stack_end) = EG(vm_stack)->end;
}
ZEND_API void zend_vm_stack_destroy(void)
{
zend_vm_stack stack = EG(vm_stack);
@@ -212,7 +222,7 @@ ZEND_API void* zend_vm_stack_extend(size_t size)
stack->top = EG(vm_stack_top);
EG(vm_stack) = stack = zend_vm_stack_new_page(
EXPECTED(size < EG(vm_stack_page_size) - (ZEND_VM_STACK_HEADER_SLOTS * sizeof(zval))) ?
EG(vm_stack_page_size) : ZEND_VM_STACK_PAGE_ALIGNED_SIZE(size),
EG(vm_stack_page_size) : ZEND_VM_STACK_PAGE_ALIGNED_SIZE(size, EG(vm_stack_page_size)),
stack);
ptr = stack->top;
EG(vm_stack_top) = (void*)(((char*)ptr) + size);
+4 -3
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
@@ -168,6 +168,7 @@ struct _zend_vm_stack {
#endif
ZEND_API void zend_vm_stack_init(void);
ZEND_API void zend_vm_stack_init_ex(size_t page_size);
ZEND_API void zend_vm_stack_destroy(void);
ZEND_API void* zend_vm_stack_extend(size_t size);
+3 -3
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+242 -90
View File
@@ -13,7 +13,7 @@
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: David Wang <planetbeing@gmail.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
@@ -48,7 +48,7 @@
* gc_scan_roots will be called, and each root will be called with
* gc_scan(root->ref)
*
* gc_scan checkes the colors of possible members.
* gc_scan checks the colors of possible members.
*
* If the node is marked as grey and the refcount > 0
* gc_scan_black will be called on that node to scan it's subgraph.
@@ -245,6 +245,73 @@ static zend_gc_globals gc_globals;
# define GC_TRACE(str)
#endif
#define GC_STACK_SEGMENT_SIZE (((4096 - ZEND_MM_OVERHEAD) / sizeof(void*)) - 2)
typedef struct _gc_stack gc_stack;
struct _gc_stack {
gc_stack *prev;
gc_stack *next;
zend_refcounted *data[GC_STACK_SEGMENT_SIZE];
};
#define GC_STACK_DCL(init) \
gc_stack *_stack = init; \
size_t _top = 0;
#define GC_STACK_PUSH(ref) \
gc_stack_push(&_stack, &_top, ref);
#define GC_STACK_POP() \
gc_stack_pop(&_stack, &_top)
static zend_never_inline gc_stack* gc_stack_next(gc_stack *stack)
{
if (UNEXPECTED(!stack->next)) {
gc_stack *segment = emalloc(sizeof(gc_stack));
segment->prev = stack;
segment->next = NULL;
stack->next = segment;
}
return stack->next;
}
static zend_always_inline void gc_stack_push(gc_stack **stack, size_t *top, zend_refcounted *ref)
{
if (UNEXPECTED(*top == GC_STACK_SEGMENT_SIZE)) {
(*stack) = gc_stack_next(*stack);
(*top) = 0;
}
(*stack)->data[(*top)++] = ref;
}
static zend_always_inline zend_refcounted* gc_stack_pop(gc_stack **stack, size_t *top)
{
if (UNEXPECTED((*top) == 0)) {
if (!(*stack)->prev) {
return NULL;
} else {
(*stack) = (*stack)->prev;
(*top) = GC_STACK_SEGMENT_SIZE - 1;
return (*stack)->data[GC_STACK_SEGMENT_SIZE - 1];
}
} else {
return (*stack)->data[--(*top)];
}
}
static void gc_stack_free(gc_stack *stack)
{
gc_stack *p = stack->next;
while (p) {
stack = p->next;
efree(p);
p = stack;
}
}
static zend_always_inline uint32_t gc_compress(uint32_t idx)
{
return idx % GC_MAX_UNCOMPRESSED;
@@ -606,16 +673,14 @@ ZEND_API void ZEND_FASTCALL gc_remove_from_buffer(zend_refcounted *ref)
gc_remove_from_roots(root);
}
static void gc_scan_black(zend_refcounted *ref)
static void gc_scan_black(zend_refcounted *ref, gc_stack *stack)
{
HashTable *ht;
HashTable *ht = NULL;
Bucket *p, *end;
zval *zv;
GC_STACK_DCL(stack);
tail_call:
ht = NULL;
GC_REF_SET_BLACK(ref);
if (GC_TYPE(ref) == IS_OBJECT) {
zend_object_get_gc_t get_gc;
zend_object *obj = (zend_object*)ref;
@@ -630,9 +695,9 @@ tail_call:
ht = get_gc(&tmp, &zv, &n);
end = zv + n;
if (EXPECTED(!ht)) {
if (!n) return;
if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
if (zv == end) return;
if (zv == end) goto next;
}
}
while (zv != end) {
@@ -640,7 +705,8 @@ tail_call:
ref = Z_COUNTED_P(zv);
GC_ADDREF(ref);
if (!GC_REF_CHECK_COLOR(ref, GC_BLACK)) {
gc_scan_black(ref);
GC_REF_SET_BLACK(ref);
GC_STACK_PUSH(ref);
}
}
zv++;
@@ -649,33 +715,35 @@ tail_call:
ref = Z_COUNTED_P(zv);
GC_ADDREF(ref);
if (!GC_REF_CHECK_COLOR(ref, GC_BLACK)) {
GC_REF_SET_BLACK(ref);
goto tail_call;
}
return;
goto next;
}
} else {
return;
goto next;
}
} else if (GC_TYPE(ref) == IS_ARRAY) {
if ((zend_array*)ref != &EG(symbol_table)) {
ht = (zend_array*)ref;
} else {
return;
goto next;
}
} else if (GC_TYPE(ref) == IS_REFERENCE) {
if (Z_REFCOUNTED(((zend_reference*)ref)->val)) {
ref = Z_COUNTED(((zend_reference*)ref)->val);
GC_ADDREF(ref);
if (!GC_REF_CHECK_COLOR(ref, GC_BLACK)) {
GC_REF_SET_BLACK(ref);
goto tail_call;
}
}
return;
goto next;
} else {
return;
goto next;
}
if (!ht->nNumUsed) return;
if (!ht->nNumUsed) goto next;
p = ht->arData;
end = p + ht->nNumUsed;
while (1) {
@@ -687,7 +755,7 @@ tail_call:
if (Z_REFCOUNTED_P(zv)) {
break;
}
if (p == end) return;
if (p == end) goto next;
}
while (p != end) {
zv = &p->val;
@@ -698,7 +766,8 @@ tail_call:
ref = Z_COUNTED_P(zv);
GC_ADDREF(ref);
if (!GC_REF_CHECK_COLOR(ref, GC_BLACK)) {
gc_scan_black(ref);
GC_REF_SET_BLACK(ref);
GC_STACK_PUSH(ref);
}
}
p++;
@@ -710,28 +779,33 @@ tail_call:
ref = Z_COUNTED_P(zv);
GC_ADDREF(ref);
if (!GC_REF_CHECK_COLOR(ref, GC_BLACK)) {
GC_REF_SET_BLACK(ref);
goto tail_call;
}
next:
ref = GC_STACK_POP();
if (ref) {
goto tail_call;
}
}
static void gc_mark_grey(zend_refcounted *ref)
static void gc_mark_grey(zend_refcounted *ref, gc_stack *stack)
{
HashTable *ht;
HashTable *ht = NULL;
Bucket *p, *end;
zval *zv;
GC_STACK_DCL(stack);
tail_call:
if (!GC_REF_CHECK_COLOR(ref, GC_GREY)) {
ht = NULL;
do {
GC_BENCH_INC(zval_marked_grey);
GC_REF_SET_COLOR(ref, GC_GREY);
if (GC_TYPE(ref) == IS_OBJECT) {
zend_object_get_gc_t get_gc;
zend_object *obj = (zend_object*)ref;
if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
(get_gc = obj->handlers->get_gc) != NULL)) {
(get_gc = obj->handlers->get_gc) != NULL)) {
int n;
zval *zv, *end;
zval tmp;
@@ -740,31 +814,38 @@ tail_call:
ht = get_gc(&tmp, &zv, &n);
end = zv + n;
if (EXPECTED(!ht)) {
if (!n) return;
if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
if (zv == end) return;
if (zv == end) goto next;
}
}
while (zv != end) {
if (Z_REFCOUNTED_P(zv)) {
ref = Z_COUNTED_P(zv);
GC_DELREF(ref);
gc_mark_grey(ref);
if (!GC_REF_CHECK_COLOR(ref, GC_GREY)) {
GC_REF_SET_COLOR(ref, GC_GREY);
GC_STACK_PUSH(ref);
}
}
zv++;
}
if (EXPECTED(!ht)) {
ref = Z_COUNTED_P(zv);
GC_DELREF(ref);
goto tail_call;
if (!GC_REF_CHECK_COLOR(ref, GC_GREY)) {
GC_REF_SET_COLOR(ref, GC_GREY);
continue;
}
goto next;
}
} else {
return;
goto next;
}
} else if (GC_TYPE(ref) == IS_ARRAY) {
if (((zend_array*)ref) == &EG(symbol_table)) {
GC_REF_SET_BLACK(ref);
return;
goto next;
} else {
ht = (zend_array*)ref;
}
@@ -772,14 +853,17 @@ tail_call:
if (Z_REFCOUNTED(((zend_reference*)ref)->val)) {
ref = Z_COUNTED(((zend_reference*)ref)->val);
GC_DELREF(ref);
goto tail_call;
if (!GC_REF_CHECK_COLOR(ref, GC_GREY)) {
GC_REF_SET_COLOR(ref, GC_GREY);
continue;
}
}
return;
goto next;
} else {
return;
goto next;
}
if (!ht->nNumUsed) return;
if (!ht->nNumUsed) goto next;
p = ht->arData;
end = p + ht->nNumUsed;
while (1) {
@@ -791,7 +875,7 @@ tail_call:
if (Z_REFCOUNTED_P(zv)) {
break;
}
if (p == end) return;
if (p == end) goto next;
}
while (p != end) {
zv = &p->val;
@@ -801,7 +885,10 @@ tail_call:
if (Z_REFCOUNTED_P(zv)) {
ref = Z_COUNTED_P(zv);
GC_DELREF(ref);
gc_mark_grey(ref);
if (!GC_REF_CHECK_COLOR(ref, GC_GREY)) {
GC_REF_SET_COLOR(ref, GC_GREY);
GC_STACK_PUSH(ref);
}
}
p++;
}
@@ -811,8 +898,14 @@ tail_call:
}
ref = Z_COUNTED_P(zv);
GC_DELREF(ref);
goto tail_call;
}
if (!GC_REF_CHECK_COLOR(ref, GC_GREY)) {
GC_REF_SET_COLOR(ref, GC_GREY);
continue;
}
next:
ref = GC_STACK_POP();
} while (ref);
}
/* Two-Finger compaction algorithm */
@@ -852,7 +945,7 @@ static void gc_compact(void)
}
}
static void gc_mark_roots(void)
static void gc_mark_roots(gc_stack *stack)
{
gc_root_buffer *current, *last;
@@ -863,31 +956,41 @@ static void gc_mark_roots(void)
while (current != last) {
if (GC_IS_ROOT(current->ref)) {
if (GC_REF_CHECK_COLOR(current->ref, GC_PURPLE)) {
gc_mark_grey(current->ref);
GC_REF_SET_COLOR(current->ref, GC_GREY);
gc_mark_grey(current->ref, stack);
}
}
current++;
}
}
static void gc_scan(zend_refcounted *ref)
static void gc_scan(zend_refcounted *ref, gc_stack *stack)
{
HashTable *ht;
HashTable *ht = NULL;
Bucket *p, *end;
zval *zv;
GC_STACK_DCL(stack);
tail_call:
if (GC_REF_CHECK_COLOR(ref, GC_GREY)) {
if (GC_REF_CHECK_COLOR(ref, GC_WHITE)) {
if (GC_REFCOUNT(ref) > 0) {
gc_scan_black(ref);
if (!GC_REF_CHECK_COLOR(ref, GC_BLACK)) {
GC_REF_SET_BLACK(ref);
if (UNEXPECTED(!_stack->next)) {
gc_stack_next(_stack);
}
/* Split stack and reuse the tail */
_stack->next->prev = NULL;
gc_scan_black(ref, _stack->next);
_stack->next->prev = _stack;
}
} else {
GC_REF_SET_COLOR(ref, GC_WHITE);
if (GC_TYPE(ref) == IS_OBJECT) {
zend_object_get_gc_t get_gc;
zend_object *obj = (zend_object*)ref;
if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
(get_gc = obj->handlers->get_gc) != NULL)) {
(get_gc = obj->handlers->get_gc) != NULL)) {
int n;
zval *zv, *end;
zval tmp;
@@ -896,43 +999,53 @@ tail_call:
ht = get_gc(&tmp, &zv, &n);
end = zv + n;
if (EXPECTED(!ht)) {
if (!n) return;
if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
if (zv == end) return;
if (zv == end) goto next;
}
}
while (zv != end) {
if (Z_REFCOUNTED_P(zv)) {
ref = Z_COUNTED_P(zv);
gc_scan(ref);
if (GC_REF_CHECK_COLOR(ref, GC_GREY)) {
GC_REF_SET_COLOR(ref, GC_WHITE);
GC_STACK_PUSH(ref);
}
}
zv++;
}
if (EXPECTED(!ht)) {
ref = Z_COUNTED_P(zv);
goto tail_call;
if (GC_REF_CHECK_COLOR(ref, GC_GREY)) {
GC_REF_SET_COLOR(ref, GC_WHITE);
goto tail_call;
}
goto next;
}
} else {
return;
goto next;
}
} else if (GC_TYPE(ref) == IS_ARRAY) {
if ((zend_array*)ref == &EG(symbol_table)) {
GC_REF_SET_BLACK(ref);
return;
goto next;
} else {
ht = (zend_array*)ref;
}
} else if (GC_TYPE(ref) == IS_REFERENCE) {
if (Z_REFCOUNTED(((zend_reference*)ref)->val)) {
ref = Z_COUNTED(((zend_reference*)ref)->val);
goto tail_call;
if (GC_REF_CHECK_COLOR(ref, GC_GREY)) {
GC_REF_SET_COLOR(ref, GC_WHITE);
goto tail_call;
}
}
return;
goto next;
} else {
return;
goto next;
}
if (!ht->nNumUsed) return;
if (!ht->nNumUsed) goto next;
p = ht->arData;
end = p + ht->nNumUsed;
while (1) {
@@ -944,7 +1057,7 @@ tail_call:
if (Z_REFCOUNTED_P(zv)) {
break;
}
if (p == end) return;
if (p == end) goto next;
}
while (p != end) {
zv = &p->val;
@@ -953,7 +1066,10 @@ tail_call:
}
if (Z_REFCOUNTED_P(zv)) {
ref = Z_COUNTED_P(zv);
gc_scan(ref);
if (GC_REF_CHECK_COLOR(ref, GC_GREY)) {
GC_REF_SET_COLOR(ref, GC_WHITE);
GC_STACK_PUSH(ref);
}
}
p++;
}
@@ -962,19 +1078,31 @@ tail_call:
zv = Z_INDIRECT_P(zv);
}
ref = Z_COUNTED_P(zv);
goto tail_call;
if (GC_REF_CHECK_COLOR(ref, GC_GREY)) {
GC_REF_SET_COLOR(ref, GC_WHITE);
goto tail_call;
}
}
}
next:
ref = GC_STACK_POP();
if (ref) {
goto tail_call;
}
}
static void gc_scan_roots(void)
static void gc_scan_roots(gc_stack *stack)
{
gc_root_buffer *current = GC_IDX2PTR(GC_FIRST_ROOT);
gc_root_buffer *last = GC_IDX2PTR(GC_G(first_unused));
while (current != last) {
if (GC_IS_ROOT(current->ref)) {
gc_scan(current->ref);
if (GC_REF_CHECK_COLOR(current->ref, GC_GREY)) {
GC_REF_SET_COLOR(current->ref, GC_WHITE);
gc_scan(current->ref, stack);
}
}
current++;
}
@@ -1005,18 +1133,15 @@ static void gc_add_garbage(zend_refcounted *ref)
GC_G(num_roots)++;
}
static int gc_collect_white(zend_refcounted *ref, uint32_t *flags)
static int gc_collect_white(zend_refcounted *ref, uint32_t *flags, gc_stack *stack)
{
int count = 0;
HashTable *ht;
HashTable *ht = NULL;
Bucket *p, *end;
zval *zv;
GC_STACK_DCL(stack);
tail_call:
if (GC_REF_CHECK_COLOR(ref, GC_WHITE)) {
ht = NULL;
GC_REF_SET_BLACK(ref);
do {
/* don't count references for compatibility ??? */
if (GC_TYPE(ref) != IS_REFERENCE) {
count++;
@@ -1027,7 +1152,7 @@ tail_call:
zend_object *obj = (zend_object*)ref;
if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
(get_gc = obj->handlers->get_gc) != NULL)) {
(get_gc = obj->handlers->get_gc) != NULL)) {
int n;
zval *zv, *end;
zval tmp;
@@ -1037,28 +1162,31 @@ tail_call:
gc_add_garbage(ref);
}
if (obj->handlers->dtor_obj &&
((obj->handlers->dtor_obj != zend_objects_destroy_object) ||
(obj->ce->destructor != NULL))) {
((obj->handlers->dtor_obj != zend_objects_destroy_object) ||
(obj->ce->destructor != NULL))) {
*flags |= GC_HAS_DESTRUCTORS;
}
ZVAL_OBJ(&tmp, obj);
ht = get_gc(&tmp, &zv, &n);
end = zv + n;
if (EXPECTED(!ht)) {
if (!n) return count;
if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
/* count non-refcounted for compatibility ??? */
if (Z_TYPE_P(zv) != IS_UNDEF) {
count++;
}
if (zv == end) return count;
if (zv == end) goto next;
}
}
while (zv != end) {
if (Z_REFCOUNTED_P(zv)) {
ref = Z_COUNTED_P(zv);
GC_ADDREF(ref);
count += gc_collect_white(ref, flags);
if (GC_REF_CHECK_COLOR(ref, GC_WHITE)) {
GC_REF_SET_BLACK(ref);
GC_STACK_PUSH(ref);
}
/* count non-refcounted for compatibility ??? */
} else if (Z_TYPE_P(zv) != IS_UNDEF) {
count++;
@@ -1068,10 +1196,14 @@ tail_call:
if (EXPECTED(!ht)) {
ref = Z_COUNTED_P(zv);
GC_ADDREF(ref);
goto tail_call;
if (GC_REF_CHECK_COLOR(ref, GC_WHITE)) {
GC_REF_SET_BLACK(ref);
continue;
}
goto next;
}
} else {
return count;
goto next;
}
} else if (GC_TYPE(ref) == IS_ARRAY) {
/* optimization: color is GC_BLACK (0) */
@@ -1083,14 +1215,17 @@ tail_call:
if (Z_REFCOUNTED(((zend_reference*)ref)->val)) {
ref = Z_COUNTED(((zend_reference*)ref)->val);
GC_ADDREF(ref);
goto tail_call;
if (GC_REF_CHECK_COLOR(ref, GC_WHITE)) {
GC_REF_SET_BLACK(ref);
continue;
}
}
return count;
goto next;
} else {
return count;
goto next;
}
if (!ht->nNumUsed) return count;
if (!ht->nNumUsed) goto next;
p = ht->arData;
end = p + ht->nNumUsed;
while (1) {
@@ -1106,7 +1241,7 @@ tail_call:
if (Z_TYPE_P(zv) != IS_UNDEF) {
count++;
}
if (p == end) return count;
if (p == end) goto next;
}
while (p != end) {
zv = &p->val;
@@ -1116,7 +1251,10 @@ tail_call:
if (Z_REFCOUNTED_P(zv)) {
ref = Z_COUNTED_P(zv);
GC_ADDREF(ref);
count += gc_collect_white(ref, flags);
if (GC_REF_CHECK_COLOR(ref, GC_WHITE)) {
GC_REF_SET_BLACK(ref);
GC_STACK_PUSH(ref);
}
/* count non-refcounted for compatibility ??? */
} else if (Z_TYPE_P(zv) != IS_UNDEF) {
count++;
@@ -1129,12 +1267,19 @@ tail_call:
}
ref = Z_COUNTED_P(zv);
GC_ADDREF(ref);
goto tail_call;
}
if (GC_REF_CHECK_COLOR(ref, GC_WHITE)) {
GC_REF_SET_BLACK(ref);
continue;
}
next:
ref = GC_STACK_POP();
} while (ref);
return count;
}
static int gc_collect_roots(uint32_t *flags)
static int gc_collect_roots(uint32_t *flags, gc_stack *stack)
{
uint32_t idx, end;
zend_refcounted *ref;
@@ -1165,7 +1310,8 @@ static int gc_collect_roots(uint32_t *flags)
ZEND_ASSERT(GC_IS_ROOT(ref));
current->ref = GC_MAKE_GARBAGE(ref);
if (GC_REF_CHECK_COLOR(ref, GC_WHITE)) {
count += gc_collect_white(ref, flags);
GC_REF_SET_BLACK(ref);
count += gc_collect_white(ref, flags, stack);
}
idx++;
}
@@ -1280,6 +1426,10 @@ ZEND_API int zend_gc_collect_cycles(void)
zend_refcounted *p;
uint32_t gc_flags = 0;
uint32_t idx, end;
gc_stack stack;
stack.prev = NULL;
stack.next = NULL;
if (GC_G(gc_active)) {
return 0;
@@ -1290,12 +1440,14 @@ ZEND_API int zend_gc_collect_cycles(void)
GC_G(gc_active) = 1;
GC_TRACE("Marking roots");
gc_mark_roots();
gc_mark_roots(&stack);
GC_TRACE("Scanning roots");
gc_scan_roots();
gc_scan_roots(&stack);
GC_TRACE("Collecting roots");
count = gc_collect_roots(&gc_flags);
count = gc_collect_roots(&gc_flags, &stack);
gc_stack_free(&stack);
if (!GC_G(num_roots)) {
/* nothing to free */
+1 -1
View File
@@ -13,7 +13,7 @@
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: David Wang <planetbeing@gmail.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+2 -4
View File
@@ -123,8 +123,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
/* always free the CV's, in the symtable are only not-free'd IS_INDIRECT's */
zend_free_compiled_variables(execute_data);
if ((EX_CALL_INFO() & ZEND_CALL_RELEASE_THIS) &&
EXPECTED(GC_TYPE(Z_OBJ(execute_data->This)) == IS_OBJECT)) {
if (EX_CALL_INFO() & ZEND_CALL_RELEASE_THIS) {
OBJ_RELEASE(Z_OBJ(execute_data->This));
}
@@ -144,8 +143,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
}
/* Free closure object */
if ((EX_CALL_INFO() & ZEND_CALL_CLOSURE) &&
EXPECTED(GC_TYPE(ZEND_CLOSURE_OBJECT(EX(func))) == IS_OBJECT)) {
if (EX_CALL_INFO() & ZEND_CALL_CLOSURE) {
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
}
+5 -4
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
@@ -233,8 +233,9 @@ struct _zend_executor_globals {
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
};
#define EG_FLAGS_INITIAL 0x00
#define EG_FLAGS_IN_SHUTDOWN 0x01
#define EG_FLAGS_INITIAL (0)
#define EG_FLAGS_IN_SHUTDOWN (1<<0)
#define EG_FLAGS_OBJECT_STORE_NO_REUSE (1<<1)
struct _zend_ini_scanner_globals {
zend_file_handle *yy_in;
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+30 -55
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
@@ -64,7 +64,7 @@ static void _zend_is_inconsistent(const HashTable *ht, const char *file, int lin
zend_output_debug_string(1, "%s(%d) : ht=%p is inconsistent", file, line, ht);
break;
}
zend_bailout();
ZEND_ASSERT(0);
}
#define IS_CONSISTENT(a) _zend_is_inconsistent(a, __FILE__, __LINE__);
#define SET_INCONSISTENT(n) do { \
@@ -377,10 +377,8 @@ ZEND_API uint32_t zend_array_count(HashTable *ht)
}
/* }}} */
static zend_always_inline HashPosition _zend_hash_get_first_pos(const HashTable *ht)
static zend_always_inline HashPosition _zend_hash_get_valid_pos(const HashTable *ht, HashPosition pos)
{
HashPosition pos = 0;
while (pos < ht->nNumUsed && Z_ISUNDEF(ht->arData[pos].val)) {
pos++;
}
@@ -389,12 +387,7 @@ static zend_always_inline HashPosition _zend_hash_get_first_pos(const HashTable
static zend_always_inline HashPosition _zend_hash_get_current_pos(const HashTable *ht)
{
HashPosition pos = ht->nInternalPointer;
if (pos == 0) {
pos = _zend_hash_get_first_pos(ht);
}
return pos;
return _zend_hash_get_valid_pos(ht, ht->nInternalPointer);
}
ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos(const HashTable *ht)
@@ -488,6 +481,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx)
if (EXPECTED(iter->ht) && EXPECTED(iter->ht != HT_POISONED_PTR)
&& EXPECTED(!HT_ITERATORS_OVERFLOW(iter->ht))) {
ZEND_ASSERT(HT_ITERATORS_COUNT(iter->ht) != 0);
HT_DEC_ITERATORS_COUNT(iter->ht);
}
iter->ht = NULL;
@@ -1077,6 +1071,7 @@ ZEND_API int ZEND_FASTCALL zend_hash_rehash(HashTable *ht)
p++;
} while (++i < ht->nNumUsed);
} else {
uint32_t old_num_used = ht->nNumUsed;
do {
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) {
uint32_t j = i;
@@ -1133,6 +1128,12 @@ ZEND_API int ZEND_FASTCALL zend_hash_rehash(HashTable *ht)
HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(i);
p++;
} while (++i < ht->nNumUsed);
/* Migrate pointer to one past the end of the array to the new one past the end, so that
* newly inserted elements are picked up correctly. */
if (UNEXPECTED(HT_HAS_ITERATORS(ht))) {
_zend_hash_iterators_update(ht, old_num_used, ht->nNumUsed);
}
}
return SUCCESS;
}
@@ -1928,7 +1929,8 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->pDestructor = ZVAL_PTR_DTOR;
if (source->nNumOfElements == 0) {
HT_FLAGS(target) = (HT_FLAGS(source) & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED)) | HASH_FLAG_STATIC_KEYS;
uint32_t mask = HASH_FLAG_MASK & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED);
HT_FLAGS(target) = (HT_FLAGS(source) & mask) | HASH_FLAG_STATIC_KEYS;
target->nTableMask = HT_MIN_MASK;
target->nNumUsed = 0;
target->nNumOfElements = 0;
@@ -1936,7 +1938,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->nInternalPointer = 0;
HT_SET_DATA_ADDR(target, &uninitialized_bucket);
} else if (GC_FLAGS(source) & IS_ARRAY_IMMUTABLE) {
HT_FLAGS(target) = HT_FLAGS(source);
HT_FLAGS(target) = HT_FLAGS(source) & HASH_FLAG_MASK;
target->nTableMask = source->nTableMask;
target->nNumUsed = source->nNumUsed;
target->nNumOfElements = source->nNumOfElements;
@@ -1945,7 +1947,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->nInternalPointer = source->nInternalPointer;
memcpy(HT_GET_DATA_ADDR(target), HT_GET_DATA_ADDR(source), HT_USED_SIZE(source));
} else if (HT_FLAGS(source) & HASH_FLAG_PACKED) {
HT_FLAGS(target) = HT_FLAGS(source);
HT_FLAGS(target) = HT_FLAGS(source) & HASH_FLAG_MASK;
target->nTableMask = HT_MIN_MASK;
target->nNumUsed = source->nNumUsed;
target->nNumOfElements = source->nNumOfElements;
@@ -1963,7 +1965,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
zend_array_dup_packed_elements(source, target, 1);
}
} else {
HT_FLAGS(target) = HT_FLAGS(source);
HT_FLAGS(target) = HT_FLAGS(source) & HASH_FLAG_MASK;
target->nTableMask = source->nTableMask;
target->nNextFreeElement = source->nNextFreeElement;
target->nInternalPointer =
@@ -2189,7 +2191,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_reset_ex(HashTable *ht, H
{
IS_CONSISTENT(ht);
HT_ASSERT(ht, &ht->nInternalPointer != pos || GC_REFCOUNT(ht) == 1);
*pos = _zend_hash_get_first_pos(ht);
*pos = _zend_hash_get_valid_pos(ht, 0);
}
@@ -2217,19 +2219,13 @@ ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_end_ex(HashTable *ht, Has
ZEND_API int ZEND_FASTCALL zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos)
{
uint32_t idx = *pos;
uint32_t idx;
IS_CONSISTENT(ht);
HT_ASSERT(ht, &ht->nInternalPointer != pos || GC_REFCOUNT(ht) == 1);
idx = _zend_hash_get_valid_pos(ht, *pos);
if (idx < ht->nNumUsed) {
if (idx == 0) {
idx = _zend_hash_get_first_pos(ht);
if (idx >= ht->nNumUsed) {
*pos = idx;
return SUCCESS;
}
}
while (1) {
idx++;
if (idx >= ht->nNumUsed) {
@@ -2272,17 +2268,12 @@ ZEND_API int ZEND_FASTCALL zend_hash_move_backwards_ex(HashTable *ht, HashPositi
/* This function should be made binary safe */
ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_index, zend_ulong *num_index, HashPosition *pos)
{
uint32_t idx = *pos;
uint32_t idx;
Bucket *p;
IS_CONSISTENT(ht);
idx = _zend_hash_get_valid_pos(ht, *pos);
if (idx < ht->nNumUsed) {
if (idx == 0) {
idx = _zend_hash_get_first_pos(ht);
if (idx >= ht->nNumUsed) {
return HASH_KEY_NON_EXISTENT;
}
}
p = ht->arData + idx;
if (p->key) {
*str_index = p->key;
@@ -2297,20 +2288,14 @@ ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_ex(const HashTable *ht, zen
ZEND_API void ZEND_FASTCALL zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos)
{
uint32_t idx = *pos;
uint32_t idx;
Bucket *p;
IS_CONSISTENT(ht);
idx = _zend_hash_get_valid_pos(ht, *pos);
if (idx >= ht->nNumUsed) {
ZVAL_NULL(key);
} else {
if (idx == 0) {
idx = _zend_hash_get_first_pos(ht);
if (idx >= ht->nNumUsed) {
ZVAL_NULL(key);
return;
}
}
p = ht->arData + idx;
if (p->key) {
ZVAL_STR_COPY(key, p->key);
@@ -2322,17 +2307,12 @@ ZEND_API void ZEND_FASTCALL zend_hash_get_current_key_zval_ex(const HashTable *h
ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos)
{
uint32_t idx = *pos;
uint32_t idx;
Bucket *p;
IS_CONSISTENT(ht);
idx = _zend_hash_get_valid_pos(ht, *pos);
if (idx < ht->nNumUsed) {
if (idx == 0) {
idx = _zend_hash_get_first_pos(ht);
if (idx >= ht->nNumUsed) {
return HASH_KEY_NON_EXISTENT;
}
}
p = ht->arData + idx;
if (p->key) {
return HASH_KEY_IS_STRING;
@@ -2346,17 +2326,12 @@ ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_type_ex(HashTable *ht, Hash
ZEND_API zval* ZEND_FASTCALL zend_hash_get_current_data_ex(HashTable *ht, HashPosition *pos)
{
uint32_t idx = *pos;
uint32_t idx;
Bucket *p;
IS_CONSISTENT(ht);
idx = _zend_hash_get_valid_pos(ht, *pos);
if (idx < ht->nNumUsed) {
if (idx == 0) {
idx = _zend_hash_get_first_pos(ht);
if (idx >= ht->nNumUsed) {
return NULL;
}
}
p = ht->arData + idx;
return &p->val;
} else {
+6 -3
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
@@ -40,6 +40,9 @@
#define HASH_FLAG_HAS_EMPTY_IND (1<<5)
#define HASH_FLAG_ALLOW_COW_VIOLATION (1<<6)
/* Only the low byte are real flags */
#define HASH_FLAG_MASK 0xff
#define HT_FLAGS(ht) (ht)->u.flags
#define HT_IS_PACKED(ht) \
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+19 -16
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
@@ -208,8 +208,8 @@ static int zend_do_perform_type_hint_check(const zend_function *fe, zend_arg_inf
fe_class_name = ZEND_TYPE_NAME(fe_arg_info->type);
class_name = ZSTR_VAL(fe_class_name);
class_name_len = ZSTR_LEN(fe_class_name);
if (class_name_len == sizeof("parent")-1 && !strcasecmp(class_name, "parent") && proto->common.scope) {
fe_class_name = zend_string_copy(proto->common.scope->name);
if (class_name_len == sizeof("parent")-1 && !strcasecmp(class_name, "parent") && fe->common.scope && fe->common.scope->parent) {
fe_class_name = zend_string_copy(fe->common.scope->parent->name);
} else if (class_name_len == sizeof("self")-1 && !strcasecmp(class_name, "self") && fe->common.scope) {
fe_class_name = zend_string_copy(fe->common.scope->name);
} else {
@@ -894,6 +894,9 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
}
if (UNEXPECTED(parent_ce->type != ce->type)) {
/* User class extends internal */
if (CE_STATIC_MEMBERS(parent_ce) == NULL) {
zend_class_init_statics(parent_ce);
}
if (UNEXPECTED(zend_update_class_constants(parent_ce) != SUCCESS)) {
ZEND_ASSERT(0);
}
@@ -1126,18 +1129,7 @@ static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_
static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zend_function* fe) /* {{{ */
{
if (ZSTR_LEN(ce->name) == ZSTR_LEN(mname)) {
zend_string *lowercase_name = zend_string_tolower(ce->name);
lowercase_name = zend_new_interned_string(lowercase_name);
if (!memcmp(ZSTR_VAL(mname), ZSTR_VAL(lowercase_name), ZSTR_LEN(mname))) {
if (ce->constructor && (!ce->parent || ce->constructor != ce->parent->constructor)) {
zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ZSTR_VAL(ce->name));
}
ce->constructor = fe;
fe->common.fn_flags |= ZEND_ACC_CTOR;
}
zend_string_release_ex(lowercase_name, 0);
} else if (ZSTR_VAL(mname)[0] != '_' || ZSTR_VAL(mname)[1] != '_') {
if (ZSTR_LEN(ce->name) != ZSTR_LEN(mname) && (ZSTR_VAL(mname)[0] != '_' || ZSTR_VAL(mname)[1] != '_')) {
/* pass */
} else if (zend_string_equals_literal(mname, ZEND_CLONE_FUNC_NAME)) {
ce->clone = fe;
@@ -1168,6 +1160,17 @@ static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zen
ce->__tostring = fe;
} else if (zend_string_equals_literal(mname, ZEND_DEBUGINFO_FUNC_NAME)) {
ce->__debugInfo = fe;
} else if (ZSTR_LEN(ce->name) == ZSTR_LEN(mname)) {
zend_string *lowercase_name = zend_string_tolower(ce->name);
lowercase_name = zend_new_interned_string(lowercase_name);
if (!memcmp(ZSTR_VAL(mname), ZSTR_VAL(lowercase_name), ZSTR_LEN(mname))) {
if (ce->constructor && (!ce->parent || ce->constructor != ce->parent->constructor)) {
zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ZSTR_VAL(ce->name));
}
ce->constructor = fe;
fe->common.fn_flags |= ZEND_ACC_CTOR;
}
zend_string_release_ex(lowercase_name, 0);
}
}
/* }}} */
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+1 -1
View File
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Zeev Suraski <zeev@zend.com> |
| Author: Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+1 -1
View File
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Zeev Suraski <zeev@zend.com> |
| Author: Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+19 -17
View File
@@ -13,7 +13,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Zeev Suraski <zeev@zend.com> |
| Authors: Zeev Suraski <zeev@php.net> |
| Jani Taskinen <jani@php.net> |
+----------------------------------------------------------------------+
*/
@@ -46,6 +46,22 @@ int ini_parse(void);
#define ZEND_SYSTEM_INI CG(ini_parser_unbuffered_errors)
static int get_int_val(zval *op) {
switch (Z_TYPE_P(op)) {
case IS_LONG:
return Z_LVAL_P(op);
case IS_DOUBLE:
return (int)Z_DVAL_P(op);
case IS_STRING:
{
int val = atoi(Z_STRVAL_P(op));
zend_string_free(Z_STR_P(op));
return val;
}
EMPTY_SWITCH_DEFAULT_CASE()
}
}
/* {{{ zend_ini_do_op()
*/
static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
@@ -55,22 +71,8 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
int str_len;
char str_result[MAX_LENGTH_OF_LONG+1];
if (IS_LONG == Z_TYPE_P(op1)) {
i_op1 = Z_LVAL_P(op1);
} else {
i_op1 = atoi(Z_STRVAL_P(op1));
zend_string_free(Z_STR_P(op1));
}
if (op2) {
if (IS_LONG == Z_TYPE_P(op2)) {
i_op2 = Z_LVAL_P(op2);
} else {
i_op2 = atoi(Z_STRVAL_P(op2));
zend_string_free(Z_STR_P(op2));
}
} else {
i_op2 = 0;
}
i_op1 = get_int_val(op1);
i_op2 = op2 ? get_int_val(op2) : 0;
switch (type) {
case '|':
+123 -122
View File
@@ -14,7 +14,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Zeev Suraski <zeev@zend.com> |
| Authors: Zeev Suraski <zeev@php.net> |
| Jani Taskinen <jani@php.net> |
| Marcus Boerger <helly@php.net> |
| Nuno Lopes <nlopess@php.net> |
@@ -143,13 +143,14 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
ZVAL_NEW_STR(retval, zend_string_init(str, len, ZEND_SYSTEM_INI))
#define RETURN_TOKEN(type, str, len) { \
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \
zend_ini_copy_typed_value(ini_lval, type, str, len); \
} else { \
zend_ini_copy_value(ini_lval, str, len); \
} \
return type; \
#define RETURN_TOKEN(type, str, len) { \
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED && \
(YYSTATE == STATE(ST_VALUE) || YYSTATE == STATE(ST_RAW))) {\
zend_ini_copy_typed_value(ini_lval, type, str, len); \
} else { \
zend_ini_copy_value(ini_lval, str, len); \
} \
return type; \
}
static inline int convert_to_number(zval *retval, const char *str, const int str_len)
@@ -382,7 +383,7 @@ restart:
}
}
#line 386 "Zend/zend_ini_scanner.c"
#line 387 "Zend/zend_ini_scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -504,7 +505,7 @@ yy4:
yy5:
YYDEBUG(5, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 481 "Zend/zend_ini_scanner.l"
#line 482 "Zend/zend_ini_scanner.l"
{ /* Get option name */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
@@ -514,7 +515,7 @@ yy5:
RETURN_TOKEN(TC_LABEL, yytext, yyleng);
}
#line 518 "Zend/zend_ini_scanner.c"
#line 519 "Zend/zend_ini_scanner.c"
yy6:
YYDEBUG(6, *YYCURSOR);
++YYCURSOR;
@@ -538,24 +539,24 @@ yy6:
yy8:
YYDEBUG(8, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 634 "Zend/zend_ini_scanner.l"
#line 635 "Zend/zend_ini_scanner.l"
{
/* eat whitespace */
goto restart;
}
#line 547 "Zend/zend_ini_scanner.c"
#line 548 "Zend/zend_ini_scanner.c"
yy9:
YYDEBUG(9, *YYCURSOR);
++YYCURSOR;
yy10:
YYDEBUG(10, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 639 "Zend/zend_ini_scanner.l"
#line 640 "Zend/zend_ini_scanner.l"
{
SCNG(lineno)++;
return END_OF_LINE;
}
#line 559 "Zend/zend_ini_scanner.c"
#line 560 "Zend/zend_ini_scanner.c"
yy11:
YYDEBUG(11, *YYCURSOR);
yych = *++YYCURSOR;
@@ -616,11 +617,11 @@ yy14:
++YYCURSOR;
YYDEBUG(15, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 562 "Zend/zend_ini_scanner.l"
#line 563 "Zend/zend_ini_scanner.l"
{ /* Disallow these chars outside option values */
return yytext[0];
}
#line 624 "Zend/zend_ini_scanner.c"
#line 625 "Zend/zend_ini_scanner.c"
yy16:
YYDEBUG(16, *YYCURSOR);
++YYCURSOR;
@@ -642,7 +643,7 @@ yy18:
if (yych == ' ') goto yy18;
YYDEBUG(20, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 491 "Zend/zend_ini_scanner.l"
#line 492 "Zend/zend_ini_scanner.l"
{ /* Start option value */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
BEGIN(ST_RAW);
@@ -651,7 +652,7 @@ yy18:
}
return '=';
}
#line 655 "Zend/zend_ini_scanner.c"
#line 656 "Zend/zend_ini_scanner.c"
yy21:
YYDEBUG(21, *YYCURSOR);
yych = *++YYCURSOR;
@@ -707,7 +708,7 @@ yy26:
++YYCURSOR;
YYDEBUG(27, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 406 "Zend/zend_ini_scanner.l"
#line 407 "Zend/zend_ini_scanner.l"
{ /* Section start */
/* Enter section data lookup state */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
@@ -717,7 +718,7 @@ yy26:
}
return TC_SECTION;
}
#line 721 "Zend/zend_ini_scanner.c"
#line 722 "Zend/zend_ini_scanner.c"
yy28:
YYDEBUG(28, *YYCURSOR);
++YYCURSOR;
@@ -728,7 +729,7 @@ yy28:
if (yych == ' ') goto yy28;
YYDEBUG(30, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 431 "Zend/zend_ini_scanner.l"
#line 432 "Zend/zend_ini_scanner.l"
{ /* Start of option with offset */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
@@ -741,20 +742,20 @@ yy28:
RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
}
#line 745 "Zend/zend_ini_scanner.c"
#line 746 "Zend/zend_ini_scanner.c"
yy31:
YYDEBUG(31, *YYCURSOR);
++YYCURSOR;
yy32:
YYDEBUG(32, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 644 "Zend/zend_ini_scanner.l"
#line 645 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 758 "Zend/zend_ini_scanner.c"
#line 759 "Zend/zend_ini_scanner.c"
yy33:
YYDEBUG(33, *YYCURSOR);
yych = *++YYCURSOR;
@@ -809,11 +810,11 @@ yy35:
yy36:
YYDEBUG(36, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 473 "Zend/zend_ini_scanner.l"
#line 474 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
#line 817 "Zend/zend_ini_scanner.c"
#line 818 "Zend/zend_ini_scanner.c"
yy37:
YYDEBUG(37, *YYCURSOR);
yych = *++YYCURSOR;
@@ -870,11 +871,11 @@ yy39:
yy41:
YYDEBUG(41, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 469 "Zend/zend_ini_scanner.l"
#line 470 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
#line 878 "Zend/zend_ini_scanner.c"
#line 879 "Zend/zend_ini_scanner.c"
yy42:
YYDEBUG(42, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1021,11 +1022,11 @@ yy54:
yy56:
YYDEBUG(56, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 477 "Zend/zend_ini_scanner.l"
#line 478 "Zend/zend_ini_scanner.l"
{
RETURN_TOKEN(NULL_NULL, "", 0);
}
#line 1029 "Zend/zend_ini_scanner.c"
#line 1030 "Zend/zend_ini_scanner.c"
yy57:
YYDEBUG(57, *YYCURSOR);
++YYCURSOR;
@@ -1134,11 +1135,11 @@ yy62:
yy63:
YYDEBUG(63, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 580 "Zend/zend_ini_scanner.l"
#line 581 "Zend/zend_ini_scanner.l"
{ /* Get rest as section/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
#line 1142 "Zend/zend_ini_scanner.c"
#line 1143 "Zend/zend_ini_scanner.c"
yy64:
YYDEBUG(64, *YYCURSOR);
yyaccept = 0;
@@ -1178,22 +1179,22 @@ yy66:
yy67:
YYDEBUG(67, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 655 "Zend/zend_ini_scanner.l"
#line 656 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 1186 "Zend/zend_ini_scanner.c"
#line 1187 "Zend/zend_ini_scanner.c"
yy68:
YYDEBUG(68, *YYCURSOR);
++YYCURSOR;
YYDEBUG(69, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 584 "Zend/zend_ini_scanner.l"
#line 585 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES);
return '"';
}
#line 1197 "Zend/zend_ini_scanner.c"
#line 1198 "Zend/zend_ini_scanner.c"
yy70:
YYDEBUG(70, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1258,11 +1259,11 @@ yy73:
yy75:
YYDEBUG(75, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 558 "Zend/zend_ini_scanner.l"
#line 559 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
#line 1266 "Zend/zend_ini_scanner.c"
#line 1267 "Zend/zend_ini_scanner.c"
yy76:
YYDEBUG(76, *YYCURSOR);
yyaccept = 2;
@@ -1295,11 +1296,11 @@ yy76:
yy78:
YYDEBUG(78, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 554 "Zend/zend_ini_scanner.l"
#line 555 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
#line 1303 "Zend/zend_ini_scanner.c"
#line 1304 "Zend/zend_ini_scanner.c"
yy79:
YYDEBUG(79, *YYCURSOR);
++YYCURSOR;
@@ -1311,12 +1312,12 @@ yy80:
++YYCURSOR;
YYDEBUG(81, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 444 "Zend/zend_ini_scanner.l"
#line 445 "Zend/zend_ini_scanner.l"
{ /* End of section or an option offset */
BEGIN(INITIAL);
return ']';
}
#line 1320 "Zend/zend_ini_scanner.c"
#line 1321 "Zend/zend_ini_scanner.c"
yy82:
YYDEBUG(82, *YYCURSOR);
++YYCURSOR;
@@ -1356,12 +1357,12 @@ yy86:
++YYCURSOR;
YYDEBUG(87, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 449 "Zend/zend_ini_scanner.l"
#line 450 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME);
return TC_DOLLAR_CURLY;
}
#line 1365 "Zend/zend_ini_scanner.c"
#line 1366 "Zend/zend_ini_scanner.c"
yy88:
YYDEBUG(88, *YYCURSOR);
++YYCURSOR;
@@ -1415,7 +1416,7 @@ yy92:
++YYCURSOR;
YYDEBUG(93, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 416 "Zend/zend_ini_scanner.l"
#line 417 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -1424,7 +1425,7 @@ yy92:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 1428 "Zend/zend_ini_scanner.c"
#line 1429 "Zend/zend_ini_scanner.c"
}
/* *********************************** */
yyc_ST_SECTION_VALUE:
@@ -1524,11 +1525,11 @@ yy97:
yy98:
YYDEBUG(98, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 580 "Zend/zend_ini_scanner.l"
#line 581 "Zend/zend_ini_scanner.l"
{ /* Get rest as section/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
#line 1532 "Zend/zend_ini_scanner.c"
#line 1533 "Zend/zend_ini_scanner.c"
yy99:
YYDEBUG(99, *YYCURSOR);
yyaccept = 0;
@@ -1568,22 +1569,22 @@ yy101:
yy102:
YYDEBUG(102, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 655 "Zend/zend_ini_scanner.l"
#line 656 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 1576 "Zend/zend_ini_scanner.c"
#line 1577 "Zend/zend_ini_scanner.c"
yy103:
YYDEBUG(103, *YYCURSOR);
++YYCURSOR;
YYDEBUG(104, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 584 "Zend/zend_ini_scanner.l"
#line 585 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES);
return '"';
}
#line 1587 "Zend/zend_ini_scanner.c"
#line 1588 "Zend/zend_ini_scanner.c"
yy105:
YYDEBUG(105, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1648,11 +1649,11 @@ yy108:
yy110:
YYDEBUG(110, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 558 "Zend/zend_ini_scanner.l"
#line 559 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
#line 1656 "Zend/zend_ini_scanner.c"
#line 1657 "Zend/zend_ini_scanner.c"
yy111:
YYDEBUG(111, *YYCURSOR);
yyaccept = 2;
@@ -1685,11 +1686,11 @@ yy111:
yy113:
YYDEBUG(113, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 554 "Zend/zend_ini_scanner.l"
#line 555 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
#line 1693 "Zend/zend_ini_scanner.c"
#line 1694 "Zend/zend_ini_scanner.c"
yy114:
YYDEBUG(114, *YYCURSOR);
++YYCURSOR;
@@ -1713,13 +1714,13 @@ yy115:
yy117:
YYDEBUG(117, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 425 "Zend/zend_ini_scanner.l"
#line 426 "Zend/zend_ini_scanner.l"
{ /* End of section */
BEGIN(INITIAL);
SCNG(lineno)++;
return ']';
}
#line 1723 "Zend/zend_ini_scanner.c"
#line 1724 "Zend/zend_ini_scanner.c"
yy118:
YYDEBUG(118, *YYCURSOR);
++YYCURSOR;
@@ -1759,12 +1760,12 @@ yy122:
++YYCURSOR;
YYDEBUG(123, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 449 "Zend/zend_ini_scanner.l"
#line 450 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME);
return TC_DOLLAR_CURLY;
}
#line 1768 "Zend/zend_ini_scanner.c"
#line 1769 "Zend/zend_ini_scanner.c"
yy124:
YYDEBUG(124, *YYCURSOR);
++YYCURSOR;
@@ -1827,7 +1828,7 @@ yy130:
++YYCURSOR;
YYDEBUG(131, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 416 "Zend/zend_ini_scanner.l"
#line 417 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -1836,7 +1837,7 @@ yy130:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 1840 "Zend/zend_ini_scanner.c"
#line 1841 "Zend/zend_ini_scanner.c"
}
/* *********************************** */
yyc_ST_VALUE:
@@ -1972,12 +1973,12 @@ yy134:
yy135:
YYDEBUG(135, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 650 "Zend/zend_ini_scanner.l"
#line 651 "Zend/zend_ini_scanner.l"
{ /* End of option value (if EOF is reached before EOL */
BEGIN(INITIAL);
return END_OF_LINE;
}
#line 1981 "Zend/zend_ini_scanner.c"
#line 1982 "Zend/zend_ini_scanner.c"
yy136:
YYDEBUG(136, *YYCURSOR);
yyaccept = 0;
@@ -1994,11 +1995,11 @@ yy137:
yy138:
YYDEBUG(138, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 576 "Zend/zend_ini_scanner.l"
#line 577 "Zend/zend_ini_scanner.l"
{ /* Get everything else as option/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
#line 2002 "Zend/zend_ini_scanner.c"
#line 2003 "Zend/zend_ini_scanner.c"
yy139:
YYDEBUG(139, *YYCURSOR);
++YYCURSOR;
@@ -2022,24 +2023,24 @@ yy139:
yy141:
YYDEBUG(141, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 630 "Zend/zend_ini_scanner.l"
#line 631 "Zend/zend_ini_scanner.l"
{
RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
}
#line 2030 "Zend/zend_ini_scanner.c"
#line 2031 "Zend/zend_ini_scanner.c"
yy142:
YYDEBUG(142, *YYCURSOR);
++YYCURSOR;
yy143:
YYDEBUG(143, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 548 "Zend/zend_ini_scanner.l"
#line 549 "Zend/zend_ini_scanner.l"
{ /* End of option value */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 2043 "Zend/zend_ini_scanner.c"
#line 2044 "Zend/zend_ini_scanner.c"
yy144:
YYDEBUG(144, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2055,22 +2056,22 @@ yy145:
if (yych == ' ') goto yy145;
YYDEBUG(147, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 566 "Zend/zend_ini_scanner.l"
#line 567 "Zend/zend_ini_scanner.l"
{ /* Boolean operators */
return yytext[0];
}
#line 2063 "Zend/zend_ini_scanner.c"
#line 2064 "Zend/zend_ini_scanner.c"
yy148:
YYDEBUG(148, *YYCURSOR);
++YYCURSOR;
YYDEBUG(149, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 584 "Zend/zend_ini_scanner.l"
#line 585 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES);
return '"';
}
#line 2074 "Zend/zend_ini_scanner.c"
#line 2075 "Zend/zend_ini_scanner.c"
yy150:
YYDEBUG(150, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2144,11 +2145,11 @@ yy153:
yy155:
YYDEBUG(155, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 558 "Zend/zend_ini_scanner.l"
#line 559 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
#line 2152 "Zend/zend_ini_scanner.c"
#line 2153 "Zend/zend_ini_scanner.c"
yy156:
YYDEBUG(156, *YYCURSOR);
++YYCURSOR;
@@ -2165,13 +2166,13 @@ yy158:
++YYCURSOR;
YYDEBUG(159, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 570 "Zend/zend_ini_scanner.l"
#line 571 "Zend/zend_ini_scanner.l"
{ /* Make = used in option value to trigger error */
yyless(0);
BEGIN(INITIAL);
return END_OF_LINE;
}
#line 2175 "Zend/zend_ini_scanner.c"
#line 2176 "Zend/zend_ini_scanner.c"
yy160:
YYDEBUG(160, *YYCURSOR);
yyaccept = 2;
@@ -2218,11 +2219,11 @@ yy160:
yy162:
YYDEBUG(162, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 554 "Zend/zend_ini_scanner.l"
#line 555 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
#line 2226 "Zend/zend_ini_scanner.c"
#line 2227 "Zend/zend_ini_scanner.c"
yy163:
YYDEBUG(163, *YYCURSOR);
yyaccept = 2;
@@ -2556,12 +2557,12 @@ yy171:
++YYCURSOR;
YYDEBUG(172, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 449 "Zend/zend_ini_scanner.l"
#line 450 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME);
return TC_DOLLAR_CURLY;
}
#line 2565 "Zend/zend_ini_scanner.c"
#line 2566 "Zend/zend_ini_scanner.c"
yy173:
YYDEBUG(173, *YYCURSOR);
++YYCURSOR;
@@ -2627,13 +2628,13 @@ yy177:
yy178:
YYDEBUG(178, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 644 "Zend/zend_ini_scanner.l"
#line 645 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 2637 "Zend/zend_ini_scanner.c"
#line 2638 "Zend/zend_ini_scanner.c"
yy179:
YYDEBUG(179, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2744,11 +2745,11 @@ yy181:
yy182:
YYDEBUG(182, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 473 "Zend/zend_ini_scanner.l"
#line 474 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
#line 2752 "Zend/zend_ini_scanner.c"
#line 2753 "Zend/zend_ini_scanner.c"
yy183:
YYDEBUG(183, *YYCURSOR);
yyaccept = 2;
@@ -2895,11 +2896,11 @@ yy185:
yy186:
YYDEBUG(186, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 469 "Zend/zend_ini_scanner.l"
#line 470 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
#line 2903 "Zend/zend_ini_scanner.c"
#line 2904 "Zend/zend_ini_scanner.c"
yy187:
YYDEBUG(187, *YYCURSOR);
yyaccept = 2;
@@ -3019,7 +3020,7 @@ yy191:
++YYCURSOR;
YYDEBUG(192, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 416 "Zend/zend_ini_scanner.l"
#line 417 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -3028,7 +3029,7 @@ yy191:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 3032 "Zend/zend_ini_scanner.c"
#line 3033 "Zend/zend_ini_scanner.c"
yy193:
YYDEBUG(193, *YYCURSOR);
yyaccept = 2;
@@ -3343,11 +3344,11 @@ yy202:
yy203:
YYDEBUG(203, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 477 "Zend/zend_ini_scanner.l"
#line 478 "Zend/zend_ini_scanner.l"
{
RETURN_TOKEN(NULL_NULL, "", 0);
}
#line 3351 "Zend/zend_ini_scanner.c"
#line 3352 "Zend/zend_ini_scanner.c"
yy204:
YYDEBUG(204, *YYCURSOR);
++YYCURSOR;
@@ -3414,21 +3415,21 @@ yy208:
}
YYDEBUG(210, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 544 "Zend/zend_ini_scanner.l"
#line 545 "Zend/zend_ini_scanner.l"
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 3422 "Zend/zend_ini_scanner.c"
#line 3423 "Zend/zend_ini_scanner.c"
yy211:
YYDEBUG(211, *YYCURSOR);
++YYCURSOR;
YYDEBUG(212, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 655 "Zend/zend_ini_scanner.l"
#line 656 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 3432 "Zend/zend_ini_scanner.c"
#line 3433 "Zend/zend_ini_scanner.c"
yy213:
YYDEBUG(213, *YYCURSOR);
++YYCURSOR;
@@ -3444,13 +3445,13 @@ yy213:
yy215:
YYDEBUG(215, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 425 "Zend/zend_ini_scanner.l"
#line 426 "Zend/zend_ini_scanner.l"
{ /* End of section */
BEGIN(INITIAL);
SCNG(lineno)++;
return ']';
}
#line 3454 "Zend/zend_ini_scanner.c"
#line 3455 "Zend/zend_ini_scanner.c"
yy216:
YYDEBUG(216, *YYCURSOR);
++YYCURSOR;
@@ -3508,7 +3509,7 @@ yyc_ST_DOUBLE_QUOTES:
yy221:
YYDEBUG(221, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 594 "Zend/zend_ini_scanner.l"
#line 595 "Zend/zend_ini_scanner.l"
{ /* Escape double quoted string contents */
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -3544,7 +3545,7 @@ yy221:
zend_ini_escape_string(ini_lval, yytext, yyleng, '"');
return TC_QUOTED_STRING;
}
#line 3548 "Zend/zend_ini_scanner.c"
#line 3549 "Zend/zend_ini_scanner.c"
yy222:
YYDEBUG(222, *YYCURSOR);
++YYCURSOR;
@@ -3556,12 +3557,12 @@ yy222:
}
YYDEBUG(224, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 589 "Zend/zend_ini_scanner.l"
#line 590 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string ends */
yy_pop_state();
return '"';
}
#line 3565 "Zend/zend_ini_scanner.c"
#line 3566 "Zend/zend_ini_scanner.c"
yy225:
YYDEBUG(225, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3570,12 +3571,12 @@ yy225:
++YYCURSOR;
YYDEBUG(227, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 449 "Zend/zend_ini_scanner.l"
#line 450 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME);
return TC_DOLLAR_CURLY;
}
#line 3579 "Zend/zend_ini_scanner.c"
#line 3580 "Zend/zend_ini_scanner.c"
}
/* *********************************** */
yyc_ST_VARNAME:
@@ -3633,7 +3634,7 @@ yy230:
}
YYDEBUG(232, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 454 "Zend/zend_ini_scanner.l"
#line 455 "Zend/zend_ini_scanner.l"
{ /* Variable name */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
@@ -3643,28 +3644,28 @@ yy230:
RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
}
#line 3647 "Zend/zend_ini_scanner.c"
#line 3648 "Zend/zend_ini_scanner.c"
yy233:
YYDEBUG(233, *YYCURSOR);
++YYCURSOR;
YYDEBUG(234, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 655 "Zend/zend_ini_scanner.l"
#line 656 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 3657 "Zend/zend_ini_scanner.c"
#line 3658 "Zend/zend_ini_scanner.c"
yy235:
YYDEBUG(235, *YYCURSOR);
++YYCURSOR;
YYDEBUG(236, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 464 "Zend/zend_ini_scanner.l"
#line 465 "Zend/zend_ini_scanner.l"
{ /* Variable end */
yy_pop_state();
return '}';
}
#line 3668 "Zend/zend_ini_scanner.c"
#line 3669 "Zend/zend_ini_scanner.c"
}
/* *********************************** */
yyc_ST_RAW:
@@ -3728,19 +3729,19 @@ yyc_ST_RAW:
++YYCURSOR;
YYDEBUG(240, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 650 "Zend/zend_ini_scanner.l"
#line 651 "Zend/zend_ini_scanner.l"
{ /* End of option value (if EOF is reached before EOL */
BEGIN(INITIAL);
return END_OF_LINE;
}
#line 3737 "Zend/zend_ini_scanner.c"
#line 3738 "Zend/zend_ini_scanner.c"
yy241:
YYDEBUG(241, *YYCURSOR);
++YYCURSOR;
yy242:
YYDEBUG(242, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 500 "Zend/zend_ini_scanner.l"
#line 501 "Zend/zend_ini_scanner.l"
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
unsigned char *sc = NULL;
EAT_LEADING_WHITESPACE();
@@ -3784,7 +3785,7 @@ end_raw_value_chars:
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 3788 "Zend/zend_ini_scanner.c"
#line 3789 "Zend/zend_ini_scanner.c"
yy243:
YYDEBUG(243, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3808,13 +3809,13 @@ yy244:
yy245:
YYDEBUG(245, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 548 "Zend/zend_ini_scanner.l"
#line 549 "Zend/zend_ini_scanner.l"
{ /* End of option value */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 3818 "Zend/zend_ini_scanner.c"
#line 3819 "Zend/zend_ini_scanner.c"
yy246:
YYDEBUG(246, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3851,25 +3852,25 @@ yy250:
yy251:
YYDEBUG(251, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 634 "Zend/zend_ini_scanner.l"
#line 635 "Zend/zend_ini_scanner.l"
{
/* eat whitespace */
goto restart;
}
#line 3860 "Zend/zend_ini_scanner.c"
#line 3861 "Zend/zend_ini_scanner.c"
yy252:
YYDEBUG(252, *YYCURSOR);
++YYCURSOR;
yy253:
YYDEBUG(253, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 644 "Zend/zend_ini_scanner.l"
#line 645 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 3873 "Zend/zend_ini_scanner.c"
#line 3874 "Zend/zend_ini_scanner.c"
yy254:
YYDEBUG(254, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3877,6 +3878,6 @@ yy254:
goto yy253;
}
}
#line 659 "Zend/zend_ini_scanner.l"
#line 660 "Zend/zend_ini_scanner.l"
}
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+9 -8
View File
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Zeev Suraski <zeev@zend.com> |
| Authors: Zeev Suraski <zeev@php.net> |
| Jani Taskinen <jani@php.net> |
| Marcus Boerger <helly@php.net> |
| Nuno Lopes <nlopess@php.net> |
@@ -140,13 +140,14 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
ZVAL_NEW_STR(retval, zend_string_init(str, len, ZEND_SYSTEM_INI))
#define RETURN_TOKEN(type, str, len) { \
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \
zend_ini_copy_typed_value(ini_lval, type, str, len); \
} else { \
zend_ini_copy_value(ini_lval, str, len); \
} \
return type; \
#define RETURN_TOKEN(type, str, len) { \
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED && \
(YYSTATE == STATE(ST_VALUE) || YYSTATE == STATE(ST_RAW))) {\
zend_ini_copy_typed_value(ini_lval, type, str, len); \
} else { \
zend_ini_copy_value(ini_lval, str, len); \
} \
return type; \
}
static inline int convert_to_number(zval *retval, const char *str, const int str_len)
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -13,8 +13,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Nikita Popov <nikic@php.net> |
+----------------------------------------------------------------------+
*/
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+4 -3
View File
@@ -16,8 +16,8 @@
| Nuno Lopes <nlopess@php.net> |
| Scott MacVicar <scottmac@php.net> |
| Flex version authors: |
| Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
@@ -1781,7 +1781,8 @@ NEWLINE ("\r"|"\n"|"\r\n")
char *end;
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
errno = 0;
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, &end, 0));
/* base must be passed explicitly for correct parse error on Windows */
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, &end, yytext[0] == '0' ? 8 : 10));
/* This isn't an assert, we need to ensure 019 isn't valid octal
* Because the lexing itself doesn't do that for us
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+6 -6
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
@@ -1374,14 +1374,14 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
}
/* }}} */
static void zend_intenal_class_init_statics(zend_class_entry *class_type) /* {{{ */
ZEND_API void zend_class_init_statics(zend_class_entry *class_type) /* {{{ */
{
int i;
zval *p;
if (!CE_STATIC_MEMBERS(class_type) && class_type->default_static_members_count) {
if (class_type->parent) {
zend_intenal_class_init_statics(class_type->parent);
zend_class_init_statics(class_type->parent);
}
#if ZTS
@@ -1431,7 +1431,7 @@ ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *p
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (ce->type == ZEND_INTERNAL_CLASS) {
zend_intenal_class_init_statics(ce);
zend_class_init_statics(ce);
} else {
undeclared_property:
if (!silent) {
+3 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
@@ -175,6 +175,7 @@ extern const ZEND_API zend_object_handlers std_object_handlers;
#define ZEND_PROPERTY_NOT_EMPTY ZEND_ISEMPTY /* Property is not empty */
#define ZEND_PROPERTY_EXISTS 0x2 /* Property exists */
ZEND_API void zend_class_init_statics(zend_class_entry *ce);
ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key);
ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent);
ZEND_API ZEND_COLD zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name);
+3 -3
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+15 -9
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
@@ -41,6 +41,7 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_destroy(zend_objects_store *objec
ZEND_API void ZEND_FASTCALL zend_objects_store_call_destructors(zend_objects_store *objects)
{
EG(flags) |= EG_FLAGS_OBJECT_STORE_NO_REUSE;
if (objects->top > 1) {
uint32_t i;
for (i = 1; i < objects->top; i++) {
@@ -131,10 +132,10 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_put(zend_object *object)
{
int handle;
/* When in shutdown sequesnce - do not reuse previously freed handles, to make sure
/* When in shutdown sequence - do not reuse previously freed handles, to make sure
* the dtors for newly created objects are called in zend_objects_store_call_destructors() loop
*/
if (!(EG(flags) & EG_FLAGS_IN_SHUTDOWN) && EG(objects_store).free_list_head != -1) {
if (EG(objects_store).free_list_head != -1 && EXPECTED(!(EG(flags) & EG_FLAGS_OBJECT_STORE_NO_REUSE))) {
handle = EG(objects_store).free_list_head;
EG(objects_store).free_list_head = GET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[handle]);
} else {
@@ -152,14 +153,17 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_put(zend_object *object)
ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object) /* {{{ */
{
ZEND_ASSERT(GC_REFCOUNT(object) == 0);
/* GC might have released this object already. */
if (UNEXPECTED(GC_TYPE(object) == IS_NULL)) {
return;
}
/* Make sure we hold a reference count during the destructor call
otherwise, when the destructor ends the storage might be freed
when the refcount reaches 0 a second time
*/
ZEND_ASSERT(EG(objects_store).object_buckets != NULL);
ZEND_ASSERT(IS_OBJ_VALID(EG(objects_store).object_buckets[object->handle]));
ZEND_ASSERT(GC_REFCOUNT(object) == 0);
if (!(OBJ_FLAGS(object) & IS_OBJ_DESTRUCTOR_CALLED)) {
GC_ADD_FLAGS(object, IS_OBJ_DESTRUCTOR_CALLED);
@@ -176,6 +180,8 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object) /* {{{ *
uint32_t handle = object->handle;
void *ptr;
ZEND_ASSERT(EG(objects_store).object_buckets != NULL);
ZEND_ASSERT(IS_OBJ_VALID(EG(objects_store).object_buckets[object->handle]));
EG(objects_store).object_buckets[handle] = SET_OBJ_INVALID(object);
if (!(OBJ_FLAGS(object) & IS_OBJ_FREE_CALLED)) {
GC_ADD_FLAGS(object, IS_OBJ_FREE_CALLED);
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+3 -3
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+3 -3
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+3 -3
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <dmitry@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <dmitry@php.net> |
+----------------------------------------------------------------------+
*/
+6 -10
View File
@@ -12,9 +12,9 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Dmitry Stogov <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
| Dmitry Stogov <zeev@php.net> |
+----------------------------------------------------------------------+
*/
@@ -440,12 +440,8 @@ char *alloca();
#define MAX(a, b) (((a)>(b))?(a):(b))
#define MIN(a, b) (((a)<(b))?(a):(b))
/* x86 instructions BT, SHL, SHR don't require masking */
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) || defined(ZEND_WIN32)
# define ZEND_BIT_TEST(bits, bit) (((bits)[(bit) / (sizeof((bits)[0])*8)] >> (bit)) & 1)
#else
# define ZEND_BIT_TEST(bits, bit) (((bits)[(bit) / (sizeof((bits)[0])*8)] >> ((bit) & (sizeof((bits)[0])*8-1))) & 1)
#endif
#define ZEND_BIT_TEST(bits, bit) \
(((bits)[(bit) / (sizeof((bits)[0])*8)] >> ((bit) & (sizeof((bits)[0])*8-1))) & 1)
/* We always define a function, even if there's a macro or expression we could
* alias, so that using it in contexts where we can't make function calls
@@ -577,7 +573,7 @@ static zend_always_inline double _zend_get_nan(void) /* {{{ */
# define ZEND_INTRIN_SSSE3_FUNC_DECL(func)
#endif
#ifdef __SSE4_2__
#if defined(HAVE_SSE4_2_DEF) || (defined(ZEND_WIN32) && defined(__SSE4_2__))
/* Instructions compiled directly. */
# define ZEND_INTRIN_SSE4_2_NATIVE 1
#elif (defined(HAVE_FUNC_ATTRIBUTE_TARGET) && defined(PHP_HAVE_SSE4_2)) || defined(ZEND_WIN32)
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
+2 -2
View File
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
*/
Loaded 100 of 730 files, more files were not shown because too many files have changed in this diff. Show more