Compare commits

...
495 Commits
Author SHA1 Message Date
Anatol Belski 038c63cdea sync NEWS 2016-01-06 06:34:06 +01:00
libnex c666a67a98 Patch for Heap Buffer Overflow in EscapeShell
Proposed patch for bug #71270
2016-01-06 06:33:04 +01:00
Anatol Belski bf76af30c7 set 7.0.2 date and version 2016-01-05 13:39:39 +01:00
Anatol Belski 9f4b5c1a94 bump versions 2016-01-05 13:38:44 +01:00
Anatol Belski 9b942229de sync NEWS 2016-01-05 13:37:18 +01:00
Anatol Belski 9696385481 re-apply the patch from 1785d2b805
too many conflicts to cherry-pick
2016-01-05 13:34:14 +01:00
Stanislav Malyshev 6328074de3 Improve fix for bug #70976 2016-01-05 13:34:02 +01:00
Stanislav Malyshev 4b8394dd78 Fix bug #70976: fix boundary check on gdImageRotateInterpolated 2016-01-05 13:33:50 +01:00
Stanislav Malyshev 2721a01486 Fixed bug #70755: fpm_log.c memory leak and buffer overflow 2016-01-05 13:33:36 +01:00
Anatol Belski 56839f5a76 fix merge mistake 2016-01-05 13:33:22 +01:00
Julien Pauli f3c1863aa2 Fixed #70728
Conflicts:
	ext/xmlrpc/xmlrpc-epi-php.c
2016-01-05 13:32:52 +01:00
Stanislav Malyshev 366f9505a4 Fixed bug #70661 (Use After Free Vulnerability in WDDX Packet Deserialization)
Conflicts:
	ext/wddx/wddx.c
2016-01-05 13:32:35 +01:00
Anatol Belski 8285f90d1d re-apply bump versions 2015-12-22 13:13:08 +01:00
Dmitry Stogov 0402f05ba3 Fixed possible crash on Zend/tests/bug71154.phpt 2015-12-21 15:57:53 +03:00
Anatol Belski 53bfb6618d Revert "Partially fix bug #71129"
This reverts commit 4c55669caa.

The way it is fixes doesn't satisfy every SAPI, so a better solution
is yet to work out.
2015-12-21 12:09:24 +01:00
Xinchen Hui 4531d2c591 Fixed typo 2015-12-21 18:12:57 +08:00
Xinchen Hui 817513af4e Fixed bug #71178 (preg_replace with arrays creates [0] in replace array if not already set) 2015-12-21 18:10:48 +08:00
Lior Kaplan c85f569e52 Align #71165 entry format 2015-12-20 23:48:25 +02:00
Anatol Belski 4c55669caa Partially fix bug #71129 2015-12-20 15:25:11 +01:00
Xinchen Hui cfe977a406 Typo 2015-12-19 05:44:29 -08:00
Lior Kaplan 05345f5ad4 Bug #71105 was fixed in 7.0.1 (commit 9374ba35) 2015-12-19 13:21:16 +02:00
Xinchen Hui baf7ad1555 Fixed NEWS 2015-12-18 21:54:57 -08:00
Xinchen Hui a21b0942fa Fixed bug #71165 (-DGC_BENCH=1 doesn't work on PHP7) 2015-12-18 21:52:05 -08:00
Xinchen Hui 1d79011fb9 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-12-18 21:40:48 -08:00
Xinchen Hui eb4ce3f1a8 Fixed bug #71163 (Segmentation Fault: cleanup_unfinished_calls) 2015-12-18 21:40:20 -08:00
Andrea Faulds 42c8f5e91d Fix bug #70804
This follows on from a4648ded43 and
4e01269082.
Both -(+0.0) and +(-0.0) behaved incorrectly for the same reason.
2015-12-19 02:25:44 +00:00
Andrea Faulds 8d217db369 Fix bug #66179
This also fixes ext/standard/tests/general_functions/var_export-locale.phpt
to actually run the floating-point section.
2015-12-18 19:31:21 +00:00
Xinchen Hui 8f9af36da3 Fixed bug #71144 (Sementation fault when using cURL with ZTS) 2015-12-19 00:29:19 +08:00
Xinchen Hui 916f10ac31 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-12-19 00:20:18 +08:00
Xinchen Hui 512498d083 Fixed test skip 2015-12-19 00:19:21 +08:00
Xinchen Hui b715845650 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
2015-12-18 17:44:05 +08:00
Xinchen Hui 361b5814de Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6
* 'PHP-5.6' of git.php.net:/php-src:
  Align news entry format: Implement FR -> Implemented FR
2015-12-18 17:43:25 +08:00
Xinchen Hui 2f47e9872e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Improved fix for #71127

Conflicts:
	ext/opcache/Optimizer/pass1_5.c
2015-12-18 17:41:42 +08:00
Xinchen Hui 40702799b5 Improved fix for #71127 2015-12-18 17:37:40 +08:00
Andrea Faulds 4e01269082 Fix tests broken by 'Fix bug #52355'
a4648ded43 broke some tests
2015-12-17 23:33:24 +00:00
Andrea Faulds a4648ded43 Fix bug #52355 2015-12-17 22:39:29 +00:00
Nikita Popov a917840f38 Fixed iter leak on by-ref foreach over const/tmp array
FE_FREE does not unregister the iter for plain arrays. So always
wrap into a REF wrapper, even if not strictly necessary, in
RESET_RW. Alternatively we could use a flag to distinguish plain
positions and interators.

Also added a check for leaked iterators in shutdown_executor.
2015-12-17 23:21:48 +01:00
Nikita Popov 6a4c02e107 Fixed bug #71154 2015-12-17 22:20:29 +01:00
George Wang 0a1a4dc033 Fixed a bug in apache_request_headers() that adds an extra \0 to header name. 2015-12-17 15:20:08 -05:00
Nikita Popov a3e1952700 Fixed bug #71153 2015-12-17 20:59:57 +01:00
Dmitry Stogov 9e44b6a61e Fixed incorrect exception handling 2015-12-17 14:16:19 +03:00
Lior Kaplan 860ef0e2d7 Align NEWS entry format 2015-12-17 11:39:09 +02:00
Lior Kaplan 38e16154dd Align news entry format: Implement FR -> Implemented FR 2015-12-17 11:38:07 +02:00
Lior Kaplan c537039fcb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Align news entry format: Implement FR -> Implemented FR
2015-12-17 11:29:47 +02:00
Lior Kaplan e61bb3fbf9 Align news entry format: Implement FR -> Implemented FR 2015-12-17 11:27:41 +02:00
Xinchen Hui 1b4e224c98 Update NEWs 2015-12-17 14:30:41 +08:00
Xinchen Hui 9374977d21 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/opcache/Optimizer/pass1_5.c
2015-12-17 14:30:00 +08:00
Xinchen Hui 940c68b55d Fixed bug #71127 (Define in auto_prepend_file is overwrite) 2015-12-17 14:27:33 +08:00
Dmitry Stogov c7c3b967a5 Removed invalid efree() (arguments are allocated on VM stack and used without copying) 2015-12-16 15:25:49 +03:00
Lior Kaplan 96fe1dfe53 Add entry for session.lazy_write 2015-12-16 11:37:43 +02:00
Lior Kaplan ef9ddd0d82 Remove sqlite extension leftover references (was removed in PHP 5.4) 2015-12-16 09:40:02 +02:00
Yasuo Ohgaki 57be57ac94 Fix ZTS build 2015-12-16 11:10:39 +09:00
Yasuo Ohgaki 707e1c4710 Fixed test 2015-12-16 09:35:45 +09:00
Yasuo Ohgaki 714f28d8e4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #71122 Session GC may not remove obsolete session data
2015-12-16 09:34:41 +09:00
Yasuo Ohgaki e8f1c29cc9 Fixed bug #71122 Session GC may not remove obsolete session data 2015-12-16 09:15:05 +09:00
Lior Kaplan 838e4039d7 Remove extra line 2015-12-15 11:15:30 +02:00
Lior Kaplan 66d1d10917 NEWS entry for #55651 2015-12-15 11:13:54 +02:00
Avi Brender 90a26a4844 Implement FR #55651 (Option to ignore the returned FTP PASV address) 2015-12-15 11:07:40 +02:00
Yasuo Ohgaki 071616026f Update NEWS 2015-12-15 10:40:07 +09:00
Yasuo Ohgaki 8161230505 Fixed Bug #71122 Session GC may not remove obsolete session data 2015-12-15 10:27:28 +09:00
Xinchen Hui 3d3782c328 Unused vars 2015-12-14 09:23:01 -08:00
Lior Kaplan 94f3887152 NEWS entry for #55651 2015-12-15 11:52:33 +02:00
Avi Brender 71e468e141 Implement FR #55651 (Option to ignore the returned FTP PASV address) 2015-12-15 11:51:32 +02:00
Yasuo Ohgaki e048b3fc6b Update NEWS 2015-12-15 10:41:39 +09:00
Yasuo Ohgaki 1e042ae4a7 Fix merge conflict 2015-12-15 10:30:16 +09:00
Rasmus Lerdorf 56bf10f0bd Support uwsgi sapi in opcache 2015-12-14 06:10:26 -08:00
Rasmus Lerdorf 9a31d70845 Support uwsgi sapi in opcache 2015-12-14 06:09:17 -08:00
Anthony Ferrara 02e85045dc Refactor password_hash to use random_bytes internally to generate salts 2015-12-14 09:05:16 +01:00
Xinchen Hui 6a35e3b383 Added NEWS 2015-12-14 10:54:10 +08:00
Nikita Popov 7dc5bc5063 Do not swap operands in array addition
As we support constant array operands nowadays, the original check
didn't work anymore.
2015-12-14 00:29:05 +01:00
Xinchen Hui 07b33992a2 Fixed bug #71109 (ZEND_MOD_CONFLICTS("xdebug") doesn't work) 2015-12-13 05:06:08 -08:00
Xinchen Hui 4171a8f6c6 Internal function argumensts cleanup (strict_types) 2015-12-12 22:52:37 -08:00
Xinchen Hui a9026070b6 Fixed test 2015-12-12 22:37:50 -08:00
Xinchen Hui b101a6bbd4 Use format string 2015-12-12 18:45:11 -08:00
Christopher Jones e0691d27d5 Merge branch 'PHP-5.6' into PHP-7.0 2015-12-13 08:22:14 +11:00
Christopher Jones 82d58e6cbc Update README 2015-12-13 08:21:41 +11:00
Reeze Xia 95ad414658 Unused value casting should be void 2015-12-12 23:25:30 +08:00
Christopher Jones e4a48ab6b3 Prepare for a PECL release 2015-12-12 16:07:57 +11:00
Christopher Jones 915a00cd8b Merge branch 'PHP-5.6' into PHP-7.0 2015-12-12 16:06:44 +11:00
Christopher Jones 8f7e98ac4a Prepare for a PECL release 2015-12-12 16:06:08 +11:00
Xinchen Hui 1358743f9c Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-12-11 09:13:00 -08:00
Xinchen Hui 778e5f3da5 Fixed bug #71092 (Segmentation fault with return type hinting) 2015-12-11 09:11:28 -08:00
Anatol Belski 050e21beed Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  backported 7c981192eb from 7.0
2015-12-11 17:43:36 +01:00
Anatol Belski 57eecd4e29 update NEWS 2015-12-11 17:42:01 +01:00
Anatol Belski 157d0372e0 backported 7c981192eb from 7.0
the way it doesn't hurt BC
2015-12-11 17:39:57 +01:00
Nikita Popov 04407b79df Fixed bug #71094
I didn't see any non-dummy readline tests to work off, so this
change is tested manually only.

While at it also fix other zval_dtors and use ZVAL_COPY.
2015-12-11 16:33:07 +01:00
Nikita Popov fd3ece8578 Fix bug #71086 2015-12-11 16:05:49 +01:00
Remi Collet 7a5c7e00cd NEWS 2015-12-11 13:23:21 +01:00
Remi Collet 66398757fc Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  NEWS
  Fix Bug #71089 No check to duplicate zend_extension
2015-12-11 13:22:55 +01:00
Remi Collet d403a91c6f NEWS 2015-12-11 13:22:13 +01:00
Remi Collet 410eacc1a9 Fix Bug #71089 No check to duplicate zend_extension 2015-12-11 13:21:24 +01:00
Xinchen Hui b5adfee320 Fixed bug memleak in header_register_callback 2015-12-11 17:26:31 +08:00
Nikita Popov 5c5209d676 Fix cleanup in bug70748.phpt
git add Zend/tests usable again...
2015-12-10 19:14:49 +01:00
Nikita Popov 798d168d73 Make update_opN_const implementation symmetric
So the main structure is the same...
2015-12-10 18:18:10 +01:00
Nikita Popov 37f3425263 Fix Foo::${42} and similar
Fixes segfault on direct use, segfault on opcache evaluated use,
leak on temporary use.

Fixes analogeous segfault for ${42} on opcache eval as well.
2015-12-10 18:14:40 +01:00
Lior Kaplan a19f511345 Align NEWS entry format for bug #71024 2015-12-10 15:31:06 +02:00
Xinchen Hui c096a281be The first arg is optional 2015-12-10 19:36:41 +08:00
Xinchen Hui e4ad9ed8ad Return -1 seems bug here 2015-12-10 17:35:35 +08:00
Anatol Belski e2e39f3bfc set release date 2015-12-10 08:11:23 +01:00
Xinchen Hui 29b615cfcf iFixed key leak with invalid resource 2015-12-10 15:02:01 +08:00
Xinchen Hui 7c1ddcc67f Fixed bug #71077 (ReflectionMethod for ArrayObject constructor returns wrong number of parameters) 2015-12-10 08:58:28 +08:00
Ferenc Kovacs 91adffb4d1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  5.6.18 will be next
2015-12-10 01:31:51 +01:00
Ferenc Kovacs 7d5dbaed76 5.6.18 will be next 2015-12-10 01:30:27 +01:00
Anatol Belski 6f9819db38 fixed NEWS 2015-12-09 14:48:44 +01:00
Xinchen Hui 8ba6fea7b1 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-12-09 21:08:57 +08:00
Xinchen Hui 4c379392b2 Fixed bug #71067 (Local object in class method stays in memory for each call) 2015-12-09 21:07:59 +08:00
Anatol Belski f444c7619e update NEWS 2015-12-09 13:39:07 +01:00
Anatol Belski 3d487fb8d1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2015-12-09 13:38:41 +01:00
Anatol Belski e4238f4bf5 update NEWS 2015-12-09 13:37:37 +01:00
Anatol Belski 906670b817 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  ext/imap/config.m4: fix conftest segfault in utf8_to_mutf7 check, bug #66909.
  ext/dba/config.m4: Autodetect Berkeley DB v5.3.
  fix path separator in test
  Bumped SAPI version to 6.9
  Added "mod_auth_basic" to apache module list.
  Add sanitizing checks for request data.
  Clear secret after use.
  Fixed __DIR__ in CLI mode.
  Add PDO_Firebird fix in NEWS
2015-12-09 12:05:01 +01:00
Michael Orlitzky 24f21a3012 ext/imap/config.m4: fix conftest segfault in utf8_to_mutf7 check, bug #66909.
The test program for utf8_to_mutf7 attempts to call it without
arguments. The function expects one argument, however, and this leads
to a segfault as reported in PHP bug #66909.

The test program is using the PHP_IMAP_TEST_BUILD macro which
complicates things a little. To keep this diff small, the
PHP_IMAP_TEST_BUILD macro was modified to pass a fifth argument
"extra-source" to the PHP_TEST_BUILD macro. The check for
utf8_to_mutf7 was then modified to check for a dummy function,
utf8_to_mutf7_php, which passes the correct number of arguments to
utf8_to_mutf7.

PHP-Bug: https://bugs.php.net/bug.php?id=66909
Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=376735
2015-12-09 12:04:16 +01:00
Anatol Belski 843341954e update NEWS 2015-12-09 11:57:03 +01:00
Michael Orlitzky 05f00e5060 ext/dba/config.m4: Autodetect Berkeley DB v5.3.
When the user passes --with-db4=DIR to ./configure, the directory DIR
is searched for a number of paths in order of preference. These paths
contain possible locations for Berkeley DB (BDB) to be installed, and
since PHP only supports BDB-4.x and BDB-5.x, it's important that (for
example) version 5.1 be autodetected before falling back to
/usr/include/db.h which can point to BDB-6.x.

The newer BDB-5.3 works with PHP, and if only BDB-5.3 is installed on
the user's system, the current ./configure script is fine. However, if
both BDB-5.3 and BDB-6.0 are installed, version 5.3 is not
autodetected, causing BDB-6.0 to be used. The ./configure step then fails.

This commit adds autodetection for BDB-5.3, and fixes a bug reported
on Gentoo at https://bugs.gentoo.org/show_bug.cgi?id=564824.
2015-12-09 11:37:50 +01:00
George Wang 6d933b463e Bumped SAPI version to 6.9 2015-12-09 11:37:46 +01:00
George Wang b3458eddfd Added "mod_auth_basic" to apache module list. 2015-12-09 11:37:45 +01:00
George Wang 5a319a02d8 Add sanitizing checks for request data. 2015-12-09 11:37:43 +01:00
George Wang af1ac753fe Clear secret after use. 2015-12-09 11:37:42 +01:00
George Wang 42789e2b8a Fixed __DIR__ in CLI mode. 2015-12-09 11:37:40 +01:00
Dmitry Stogov 4b16082e94 More verbose error messages 2015-12-09 13:34:45 +03:00
Michael Orlitzky 38b68fc042 ext/dba/config.m4: Autodetect Berkeley DB v5.3.
When the user passes --with-db4=DIR to ./configure, the directory DIR
is searched for a number of paths in order of preference. These paths
contain possible locations for Berkeley DB (BDB) to be installed, and
since PHP only supports BDB-4.x and BDB-5.x, it's important that (for
example) version 5.1 be autodetected before falling back to
/usr/include/db.h which can point to BDB-6.x.

The newer BDB-5.3 works with PHP, and if only BDB-5.3 is installed on
the user's system, the current ./configure script is fine. However, if
both BDB-5.3 and BDB-6.0 are installed, version 5.3 is not
autodetected, causing BDB-6.0 to be used. The ./configure step then fails.

This commit adds autodetection for BDB-5.3, and fixes a bug reported
on Gentoo at https://bugs.gentoo.org/show_bug.cgi?id=564824.
2015-12-09 11:20:36 +01:00
Anatol Belski 56e7903131 fix path separator in test 2015-12-09 11:18:25 +01:00
Francois Laupretre 25abf2f028 Fix bug #70781 (Extension tests fail on dynamic ext dependency) 2015-12-09 11:05:34 +01:00
George Wang 00ed55005a Bumped SAPI version to 6.9 2015-12-09 00:28:08 -05:00
George Wang 0d84097d44 Added "mod_auth_basic" to apache module list. 2015-12-09 00:27:55 -05:00
George Wang 08080c18f5 Add sanitizing checks for request data. 2015-12-09 00:26:41 -05:00
George Wang c60d4b9770 Clear secret after use. 2015-12-09 00:26:24 -05:00
George Wang 84fd8ffa2a Fixed __DIR__ in CLI mode. 2015-12-09 00:25:48 -05:00
Xinchen Hui f248309b74 Revert "Fixed bug #71053 (Type Hint about DateTime::diff does not match with informed)"
THis is bc break, which will break $date1->diff($date2 , 1), which is
common used

please do not do bc break without a asking

This reverts commit 943b23dcf6.
2015-12-09 12:00:23 +08:00
Reeze Xia 943b23dcf6 Fixed bug #71053 (Type Hint about DateTime::diff does not match with informed) 2015-12-09 11:40:47 +08:00
Xinchen Hui 0adbf6de77 Remove useless check 2015-12-09 11:37:40 +08:00
Xinchen Hui 84b997020e Fixed bug #71066 (mb_send_mail: Program terminated with signal SIGSEGV, Segmentation fault) 2015-12-08 17:47:16 -08:00
Anatol Belski adb9522767 move the entry into the correct NEWS block 2015-12-08 18:20:55 +01:00
Reeze Xia 10800b8ca2 Update NEWS 2015-12-09 00:41:18 +08:00
Xinchen Hui c47b49c9b5 Fixed test if PATH is not set 2015-12-08 08:26:04 -08:00
Reeze Xia 3427c122bf Fixed bug #71063 (filter_input(INPUT_ENV, ..) does not work) 2015-12-09 00:04:12 +08:00
Anatol Belski e26b605c21 prepare 7.0.1RC1 2015-12-08 15:54:44 +01:00
Bob Weinand a11805a4d9 PHP_MD5_CTX is now always used due to fix for #71204 2015-12-08 15:23:14 +01:00
Scott c0ce2281bc Update random.c
Supersedes #1589
2015-12-08 13:16:48 +01:00
Anthony Ferrara 908f67b1d4 Expose php_random_bytes as a first-class API within internals
This also defines two macros: php_random_bytes_throw and php_random_bytes_silent depending on use case which will throw exceptions or not respectively
2015-12-08 13:12:45 +01:00
Xinchen Hui 0495bf5650 Revert "fix typos "paramer" -> "parameters""
ABI BC break

This reverts commit 6ac12f1337.
2015-12-08 10:52:50 +08:00
Anatol Belski 920c088082 update NEWS 2015-12-07 22:54:44 +01:00
Anatol Belski 7c981192eb Fixed bug #71024 Unable to use PHP 7.0 x64 side-by-side with PHP 5.6 x32 on the same server 2015-12-07 22:53:35 +01:00
Xinchen Hui 250430acdc Fixed Bug #71049 (SQLite3Stmt::execute() releases bound parameter instead of internal buffer) 2015-12-07 07:43:09 -08:00
Márcio Almada 6ac12f1337 fix typos "paramer" -> "parameters" 2015-12-07 14:48:26 +08:00
Xinchen Hui e48988311d Fixed bug #71020 (Use after free in Collator::sortWithSortKeys) 2015-12-07 10:58:26 +08:00
Joe Watkins 03a43d50e1 standard tsrm usage for seven 2015-12-06 14:06:07 +01:00
Anatol Belski 713ad54fec update NEWS with fixed bug #70831 2015-12-06 12:41:51 +01:00
Daniel Axtens 2ea924fffc Fix #70831: Compile fails on system with 160 CPUs
This fixes the following build issue on 160-CPU POWER8 machines

ext/tokenizer/tokenizer_data.c:28:34: fatal error: zend_language_parser.h: No such file or directory
 #include <zend_language_parser.h>

It is fixed by introducing an explicit dependency on the header file.

Signed-off-by: Daniel Axtens <dja@axtens.net>
2015-12-06 12:37:08 +01:00
Bob Weinand aa8cac578e Fix double free in formatted_print.c 2015-12-06 02:54:28 +01:00
Bob Weinand 559ede17e1 Fixed bug #71013 (Incorrect exception handler with yield from) 2015-12-06 02:45:19 +01:00
Nikita Popov 1d5744027e Disable PEAR in Travis build 2015-12-05 22:48:29 +01:00
Xinchen Hui 311eb2b11e Missed one place 2015-12-04 06:51:16 -08:00
Xinchen Hui 7ac24aa661 Fixed bug #71028 (Undefined index with ArrayIterator) 2015-12-04 06:45:26 -08:00
Xinchen Hui 3ae3341533 Fixed bug #71018 (ReflectionProperty::setValue() behavior changed) 2015-12-04 11:52:08 +08:00
Lior Kaplan 5b9267c4c0 Align NEWS entries format 2015-12-03 17:53:48 +02:00
Popa Adrian Marius a154410597 Add PDO_Firebird fix in NEWS 2015-12-03 17:28:51 +02:00
Popa Adrian Marius a90ce6de31 Add PDO_Firebird fix in NEWS 2015-12-03 17:23:56 +02:00
Popa Adrian Marius 9ddfd49063 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Use LL_MASK for SQL_INT64 data formatting
2015-12-03 17:13:45 +02:00
Popa Adrian Marius 8da5752311 Use LL_MASK for SQL_INT64 data formatting 2015-12-03 17:12:02 +02:00
Popa Adrian Marius 337fd3ad64 Merge branch 'PHP-7.0' of https://git.php.net/push/php-src into PHP-7.0
* 'PHP-7.0' of https://git.php.net/push/php-src:
  NEWS for 8907da99b8
  Fixed bug #71006 (symbol referencing errors on Sparc/Solaris)
  remove PHP 5 NEWS entries
2015-12-03 16:24:24 +02:00
Popa Adrian Marius 1745ead668 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix Bug #60052	Integer returned as a 64bit integer on X64_86 for pdo_firebird
2015-12-03 16:15:18 +02:00
Popa Adrian Marius 4173a667fa Fix Bug #60052 Integer returned as a 64bit integer on X64_86 for pdo_firebird 2015-12-03 16:14:17 +02:00
Andrea Faulds 3d6dd2a27b NEWS for 8907da99b8 2015-12-03 12:16:15 +00:00
Dmitry Stogov 59424bb7bd Fixed bug #71006 (symbol referencing errors on Sparc/Solaris) 2015-12-03 13:28:41 +03:00
Anatol Belski 2fabcbfedb remove PHP 5 NEWS entries 2015-12-03 10:55:58 +01:00
Lior Kaplan e322fb0015 SIZEOF_SIZE_T doesn't exist on AIX, keep using SIZEOF_LONG
Follow up for 3689b444
2015-12-02 19:30:05 +02:00
Anatol Belski 2f62ad16a4 remove older UPGRADING entry, bug #38409 is already fixed in 5.6 2015-12-01 11:32:52 +01:00
Adam Harvey 91bad929aa Fix bug #71005 (Segfault in php_cli_server_dispatch_router()).
We didn't initialise the retval variable in
php_cli_server_dispatch_router(); let's now initialise it to be
IS_UNDEF, as the following if condition expects.
2015-12-01 03:09:36 +00:00
Xinchen Hui ed4b887cf6 Fixed bug #70991 (zend_file_cache.c:710: error: array type has incomplete element type) 2015-12-01 10:35:32 +08:00
Scott 00e3b7614e Update random.c
Ref: https://github.com/jedisct1/libsodium/commit/beb826f6fd173cff4473c8b7614033dbd4803500
2015-12-01 10:33:33 +08:00
Anatol Belski 1b27754888 arrange NEWS for final and fix one NEWS mistake 2015-12-01 02:03:49 +01:00
Dmitry Stogov 25c5d185fc Fixed bug #70997 (When using parentClass:: instead of parent::, static context changed) 2015-11-30 16:52:57 +03:00
Xinchen Hui 5df6f9f20e Fixed bug #70993 (Array key references break argument processing) 2015-11-30 10:50:23 +08:00
Jakub Zelenka e6e77d9e27 Fix typo in php_stream_from_res_no_verify
This macro is not used but it's wrong as zend_fetch_resource
accepts only 3 args and just one res index. So obviously
we need to use zend_fetch_resource2 here.
2015-11-29 19:28:25 +00:00
Xinchen Hui 4424cbf757 Order the NEWS 2015-11-28 23:48:12 -08:00
Xinchen Hui 1f65006fce Fixed bug #70931 (Two errors messages are in conflict) 2015-11-28 23:43:41 -08:00
Xinchen Hui 9397f52724 Fixed Bug #70967 (Weird error handling for __toString when Error is thrown) 2015-11-28 23:38:19 -08:00
Xinchen Hui 5af61aa1cc Space 2015-11-27 19:12:26 -08:00
Xinchen Hui 58fbe7a838 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-11-27 07:32:21 -08:00
Xinchen Hui e9a8d7ff1d Fixed bug #70977, #70973 (Segmentation fault with opcache.huge_code_pages=1) 2015-11-27 07:30:37 -08:00
Andrea Faulds 8907da99b8 Set called_scope in Closure::call (fixes bug #70987) 2015-11-27 15:06:13 +00:00
Xinchen Hui a347b0be48 Fixed bug #70949 (SQL Result Sets With NULL Can Cause Fatal Memory Errors) 2015-11-27 15:52:55 +08:00
Xinchen Hui b0f472b3b2 Fixed test 2015-11-27 11:42:30 +08:00
Xinchen Hui 6cb6c04499 Fixed bug #70982 (setStaticPropertyValue behaviors inconsistently with 5.6) 2015-11-27 11:32:38 +08:00
Nikita Popov 99dd7ee80b Forbid namespace\int type hint as well 2015-11-26 16:56:08 +01:00
Xinchen Hui 0e91e5fb90 Fixed test 2015-11-26 12:00:25 +08:00
Bob Weinand 2de8915dea Fixed bug causing exception not being thrown immediately into a generator yielding from an array 2015-11-25 23:09:44 +01:00
Christopher Jones 071247713f Change line endings: Windows to Unix 2015-11-26 06:51:46 +11:00
Xinchen Hui f96175750a Fixed NEWs again (not sure why this is messd up twice today) 2015-11-25 08:04:36 -08:00
Xinchen Hui 4a7e83f54a Fixed bug #70970 (Segfault when combining error handler with output buffering)
of course we can try to refactor the current flow to make this error can
be catched safly.

but as 7.0.0 is releasing,  I don't think a refactor is safe now. and
actually I don't see any gain to make this catchable.

so let's keep this be consistent with 5.6 and safe for now
2015-11-25 08:00:20 -08:00
Xinchen Hui 0394c04144 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-11-25 06:34:40 -08:00
Xinchen Hui 9376e8213c ZEND_SPACESHIP supports 2015-11-25 20:20:05 +08:00
Xinchen Hui 1b6873b4e6 Fixed NEWS 2015-11-25 19:15:33 +08:00
Xinchen Hui d6f39a1011 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-11-25 19:12:40 +08:00
Xinchen Hui 3cdbe347ae Always lower name 2015-11-25 19:11:22 +08:00
Xinchen Hui 05738eb71a Revert "Improved fix for Fully qualified (leading backslash) type names must fail"
This reverts commit 00865ae22f.
2015-11-25 19:06:42 +08:00
Bob Weinand 73a92964ff Fixed bug #70965 (yield from with a common iterator primes too much) 2015-11-25 09:54:24 +01:00
Anatol Belski 2bae178b35 fix NEWS 2015-11-25 05:03:15 +01:00
Xinchen Hui 0134de7cff Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-11-25 11:46:14 +08:00
Xinchen Hui 00865ae22f Improved fix for Fully qualified (leading backslash) type names must fail
it now all fails with COMPILE_ERROR instead of syntax error for T_ARRAY
but COMPILE_ERROR for int
2015-11-25 11:27:32 +08:00
Anatol Belski 541631253a rearrange NEWS for RC8 2015-11-25 03:39:28 +01:00
Christopher Jones 7be30eb78c Improve test portability 2015-11-25 12:43:05 +11:00
Christopher Jones d10ee1eef1 Fix remaining gcov valgrind issues 2015-11-25 12:42:27 +11:00
Bob Weinand 80d9dcafe0 Fixed bug #70904 (yield from incorrectly marks valid generator as finished) 2015-11-24 23:43:34 +01:00
Bob Weinand 569763cb1a Fix scalar type names with leading backslash 2015-11-24 21:39:06 +01:00
Xinchen Hui d978e92d3d Update NEWS 2015-11-24 13:45:56 +08:00
Xinchen Hui e637ead6ed Merge branch 'PHP-5.6' into PHP-7.0 2015-11-24 13:45:32 +08:00
Xinchen Hui e6b46dc2ff Fixed bug #70960 (ReflectionFunction for array_unique returns wrong number of parameters) 2015-11-24 13:45:16 +08:00
Xinchen Hui fd545f4f44 Also fixed 'r' 2015-11-24 11:48:03 +08:00
Xinchen Hui 3e0b2ba5d8 Indent (not sure why it was messed) 2015-11-24 11:08:30 +08:00
Xinchen Hui 31b4581c45 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-11-24 11:05:56 +08:00
Xinchen Hui 91fb1edbbf Fixed bug #70963 (Unserialize shows UNKNOW in result)
Thanks to ryat for reportinig
2015-11-24 11:04:42 +08:00
Côme Bernigaud e6759644ec Revert "Added back support for undocummented host:port syntax"
This reverts commit 15876e85e5.
2015-11-24 03:45:21 +01:00
Côme Bernigaud 5a8bcf73ba Revert "Using default port in ldap_connect when NULL is passed (this was the behavior prior to 5.6.11)"
This reverts commit 391087ed28.
2015-11-24 03:45:17 +01:00
Lior Kaplan a8bd182ccd Align NEWS entries format 2015-11-23 19:00:42 +02:00
Lior Kaplan 818bffc534 Add NEWS entry for #61751 2015-11-23 18:58:03 +02:00
Lior Kaplan 9642710a09 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #61751 (SAPI build problem on AIX: Undefined symbol: php_register_internal_extensions)

 Conflicts:
	sapi/cgi/config9.m4
	sapi/fpm/config.m4
2015-11-23 18:56:13 +02:00
Lior Kaplan 1c72e5b299 Align NEWS entries format 2015-11-23 18:46:19 +02:00
Bob Weinand c1189eccae Output stderr on real stderr in phpdbg 2015-11-23 17:46:07 +01:00
Lior Kaplan 532912d8ab Add NEWS entry for #61751 2015-11-23 18:42:21 +02:00
Lior Kaplan d6b78a3511 Fixed bug #61751 (SAPI build problem on AIX: Undefined symbol: php_register_internal_extensions) 2015-11-23 18:40:47 +02:00
Xinchen Hui 7e9f416218 Fixed bug #70959 (ArrayObject unserialize does not restore protected fields) 2015-11-23 23:15:33 +08:00
Xinchen Hui f8bf1f33a5 Fixed bug #70959 (ArrayObject unserialize does not restore protected fields) 2015-11-23 07:08:47 -08:00
Xinchen Hui 801e46d8c0 Add test for bug (count on symbol table)
I should have do this ....
2015-11-23 06:21:30 -08:00
Xinchen Hui 6313e16a04 Improved fix for bug (count on symbol table) 2015-11-23 06:12:03 -08:00
Xinchen Hui 8c51578c81 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-23 18:48:51 +08:00
Xinchen Hui b9845e5006 Add bug #70957 and #70958 releated test in refection 2015-11-23 18:48:21 +08:00
Xinchen Hui 45c5e27183 Fixed test 2015-11-23 18:33:14 +08:00
Xinchen Hui 51ccc88b87 Port fix to 7.0 2015-11-23 18:31:56 +08:00
Xinchen Hui 397be4ff54 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_compile.c
2015-11-23 18:30:41 +08:00
Xinchen Hui a2b85ddecf Fixed bug #70958 (Invalid opcode while using ::class as trait method paramater default value) 2015-11-23 18:29:59 +08:00
Xinchen Hui 1b16c2f41c Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_compile.c
2015-11-23 12:22:17 +08:00
Xinchen Hui ab17840d33 Fixed bug #70957 (self::class can not be resolved with reflection for abstract class) 2015-11-23 12:20:44 +08:00
Xinchen Hui eada2aa91a Fixed bug (count on symbol tables) 2015-11-21 20:58:29 -08:00
Xinchen Hui 31d93fcf4b Port the fix of 5.6 to 7.0 2015-11-21 05:41:53 -08:00
Xinchen Hui c6961cb41b Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/tests/bug70944.phpt
	Zend/zend_exceptions.c
2015-11-21 05:03:20 -08:00
Xinchen Hui 205e0ba81d Update test script 2015-11-21 05:01:51 -08:00
Xinchen Hui cbc71995a8 Unused var 2015-11-21 04:54:48 -08:00
Xinchen Hui 7b195c9875 Improved fix for bug #70944 2015-11-21 00:27:56 -08:00
Xinchen Hui 4674f18a4b Improved previously fix a little 2015-11-20 06:54:57 -08:00
Xinchen Hui 519f9bc675 Fixed bug #70947 (INI parser segfault with INI_SCANNER_TYPED) 2015-11-20 06:37:38 -08:00
Xinchen Hui 2a9fc35e51 Update NEWS 2015-11-20 16:38:24 +08:00
Xinchen Hui a2e4e64682 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_exceptions.c
2015-11-20 16:38:00 +08:00
Xinchen Hui a1c887964e Fixed bug #70944 (try{ } finally{} can create infinite chains of exceptions) 2015-11-20 16:24:53 +08:00
Xinchen Hui 64a90a6b98 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-20 15:36:26 +08:00
Xinchen Hui b42eb16cf4 This seems better 2015-11-20 15:36:13 +08:00
Xinchen Hui 7e68d6e735 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-20 15:22:45 +08:00
Xinchen Hui c8d6673b59 Fixed build error "undefined symbol gdJpegGetVersionString" 2015-11-20 15:22:05 +08:00
Christopher Jones f66e25a82b Fixed LOB implementation size_t/zend_long mismatch reported by gcov 2015-11-20 09:14:05 +11:00
Christopher Jones 8b32fe80ae Stablize test on Windows 2015-11-20 09:13:47 +11:00
Remi Collet 77e9f2d6b1 typo 2015-11-19 09:20:13 +01:00
Remi Collet 1bd22e8e65 NEWS 2015-11-19 08:19:04 +01:00
Remi Collet 6680c2b22e Fixed bug #70940 Segfault in soep / type_to_string 2015-11-19 08:18:13 +01:00
Bob Weinand 4dee0c4a14 Fixed bug #70899 (buildconf failure in extensions) 2015-11-17 21:07:29 +01:00
Xinchen Hui 4f0a05ab3e Merge branch 'PHP-5.6' into PHP-7.0 2015-11-17 20:14:11 +08:00
Xinchen Hui 66c1f966f0 Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6 2015-11-17 20:13:22 +08:00
Xinchen Hui fba3985f23 Improve the test 2015-11-17 20:12:50 +08:00
Andrey Hristov 96406f0842 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-16 12:39:04 +01:00
Andrey Hristov 822400ef3b News for fixed bug #68344 2015-11-16 12:38:25 +01:00
Xinchen Hui 9134f9e98f Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/mysql/php_mysql.c
2015-11-16 17:59:46 +08:00
Xinchen Hui 25439e939e Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6 2015-11-16 17:00:16 +08:00
Xinchen Hui be6fd4ba89 Fixed bug #68077 (LOAD DATA LOCAL INFILE / open_basedir restriction)
Actually, this only be fixed if php uses mysqlnd
2015-11-16 16:59:55 +08:00
Côme Bernigaud 15876e85e5 Added back support for undocummented host:port syntax 2015-11-16 04:50:12 +01:00
Christopher Jones 0dce4bef79 Fixed LOB mem leak reported on gcov. Also fixed unsigend comparison compile warning; and remove direct field access 2015-11-16 08:15:22 +11:00
Jakub Zelenka 3c32019989 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-15 19:13:49 +00:00
Jakub Zelenka e5abc53701 Use the same CS for all json tests 2015-11-15 19:06:09 +00:00
Anatol Belski 7819fef345 Fixed bug #70917 install-pear-nozlib.phar missing
The actual bug is caused by some network error while packaged. An
error check added to interrupt the packaging process if phar package
download failed.
2015-11-15 19:01:22 +01:00
Reeze Xia c856b6e0ff Update mime type generator script to keep track of additional mime-types 2015-11-15 20:25:47 +08:00
Thorsten Rinne 04c3fbac37 Added support for CSS/JavaScript source maps
Source maps (http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/) are basically a way to map a combined/minified file back to an unbuilt state. To avoid error messages in Browser DevTools, source map files should be served with the MIME type "application/json"
2015-11-15 20:25:39 +08:00
Anatol Belski 1934d6d9ab fix test title
c/p mistake :)
2015-11-15 00:03:40 +01:00
Anatol Belski e3d19e81a2 update NEWS 2015-11-14 23:48:40 +01:00
Taoguang Chen 617698dfe0 Fixed bug #70914 zend_throw_or_error() format string vulnerability 2015-11-14 23:44:59 +01:00
Xinchen Hui c2773ea02f Update NEWs 2015-11-14 01:14:36 -08:00
Xinchen Hui fce44a5a13 Fixed bug #70910 (extract() breaks variable references) 2015-11-13 19:39:59 -08:00
Xinchen Hui 25de928df7 Fixed bug #70912 (Null ptr dereference instantiating class with invalid array property) 2015-11-13 21:24:42 +08:00
Yasuo Ohgaki a03786f773 Use distinguishable error messages. 2015-11-13 21:25:10 +09:00
Xinchen Hui 310fc87c2d SKIP on slow debug version PHP 2015-11-13 14:00:01 +08:00
Dmitry Stogov 04526093e4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #70900 (SoapClient systematic out of memory error)
2015-11-12 20:36:39 +03:00
Dmitry Stogov f8bf9bd86b Fixed bug #70900 (SoapClient systematic out of memory error) 2015-11-12 20:31:52 +03:00
Anatol Belski cc10da474d fixed typo 2015-11-12 13:37:45 +01:00
Anatol Belski 9c4fd36783 add test for bug #70898 2015-11-12 09:28:10 +01:00
Xinchen Hui c2de445f79 Also protects this one 2015-11-12 14:51:19 +08:00
Xinchen Hui 2b494ecc9c Update NEWS 2015-11-12 14:38:44 +08:00
Xinchen Hui 53c03115cf Re-fixed #70895 2015-11-12 14:35:34 +08:00
Xinchen Hui 2bed2152e6 Revert "Fixed bug Bug #70895 null ptr deref and segfault"
This reverts commit 8eef11d317.
2015-11-12 14:34:00 +08:00
Xinchen Hui c245fd7d91 Revert "refix bug #70895"
This reverts commit 93240102e0.
2015-11-12 14:33:14 +08:00
Xinchen Hui 75f85288f4 Revert "Fixed bug #70898 (SIGBUS/GPF zend_mm_alloc_small (zend_alloc.c:1291))"
This reverts commit e4e54f33ce.
2015-11-12 14:32:35 +08:00
Xinchen Hui fc611a134b Merge branch 'PHP-5.6' into PHP-7.0 2015-11-12 14:20:03 +08:00
Xinchen Hui e4e54f33ce Fixed bug #70898 (SIGBUS/GPF zend_mm_alloc_small (zend_alloc.c:1291))
Include tail \0
2015-11-12 14:18:02 +08:00
Côme Bernigaud 391087ed28 Using default port in ldap_connect when NULL is passed (this was the behavior prior to 5.6.11)
Note that passing 0 will also result in default port.
2015-11-12 07:06:05 +01:00
Anatol Belski a1e8b74827 update NEWS 2015-11-12 01:41:59 +01:00
Anatol Belski 93240102e0 refix bug #70895
move this code to where it belongs, no behavior change to actual
throwing function, thus retaining compat with old ZPP
2015-11-12 01:39:02 +01:00
Anatol Belski 8eef11d317 Fixed bug Bug #70895 null ptr deref and segfault 2015-11-12 00:52:36 +01:00
Anatol Belski a2e59e72bc fix format macro names in UPGRADING.INTERNALS 2015-11-11 16:33:34 +01:00
Ferenc Kovacs 2777d0a1d9 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Ensure the test fails
2015-11-11 14:59:31 +01:00
Xinchen Hui f72c7edfa4 Ensure the test fails 2015-11-11 14:55:33 +01:00
Xinchen Hui 88fb6d90c4 Ensure the test fails 2015-11-11 19:51:33 +08:00
Anatol Belski 3517f85e47 update NEWS, patch for #70249 pulled into RC7 2015-11-11 12:20:18 +01:00
Anatol Belski b89f451694 adjust test expectation 2015-11-11 09:47:29 +01:00
Anatol Belski 3cdc438e53 fix test filename and title 2015-11-11 09:47:24 +01:00
Ferenc Kovacs 1f39665083 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  propare for 5.6.16RC1
2015-11-11 09:21:32 +01:00
Ferenc Kovacs b22636c838 propare for 5.6.16RC1 2015-11-11 09:20:16 +01:00
Xinchen Hui 82f503f587 Re-Fixed bug #70249 (Segmentation fault while running PHPUnit tests on phpBB 3.2-dev)
Let's fixed this in the root instead
2015-11-11 12:32:46 +08:00
Xinchen Hui c3260b66c9 Revert "Fixed bug #70249 (Segmentation fault while running PHPUnit tests on phpBB 3.2-dev)"
This reverts commit d6c527830e.
2015-11-11 12:06:38 +08:00
Xinchen Hui d6c527830e Fixed bug #70249 (Segmentation fault while running PHPUnit tests on phpBB 3.2-dev)
Maybe we should introduce a new zend_hash_safe_apply which always reload
the ht->arData to make sure won't segfault the ht is grew?
2015-11-11 11:34:11 +08:00
Bob Weinand ccf8b54b89 Use --vex-iropt-precise-memory-exns=yes for valgrind < 3.8.0 2015-11-10 09:27:49 +01:00
Matteo Beccati 3cb3979de3 Split shmop/tests/002.phpt in two (all + non-root)
One of the conditions tested was expected to fail with "Permission denied",
but it doesn't when running as root. The memory segment was also leaked, hence
the split.
2015-11-10 09:10:10 +01:00
Matteo Beccati 6fa9b76342 Fix bug #70886 in shmop/tests/002.phpt 2015-11-10 09:10:10 +01:00
Xinchen Hui 4803914ae6 Unused var 2015-11-10 15:54:32 +08:00
Dmitry Stogov d66d1b97aa Fixed incorrect order of free/finally on exception 2015-11-10 10:10:39 +03:00
Anatol Belski 795af791b0 Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0 2015-11-10 00:41:40 +01:00
Andrea Faulds 37b64de20f Merge branch 'use_ZEND_STRL_for_builtin_types' into PHP-7.0 2015-11-09 23:40:49 +00:00
Anatol Belski a3f1154b3d additional catch to bug #70863 2015-11-10 00:38:11 +01:00
Anatol Belski 2e38918ba4 add test for eb32da13 2015-11-09 22:45:22 +01:00
Dmitry Stogov c9eacb181c Added tests 2015-11-09 23:54:09 +03:00
Anatol Belski e029a86aad prepare news for next 2015-11-09 19:39:02 +01:00
Jakub Zelenka 570cdc05d7 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-09 18:23:29 +00:00
Jakub Zelenka 1a12403002 Remove SNI test that trigger request to sni.velox.ch
This has been requested by Kaspar Brand who provides
sni.velox.ch. That site is only for interactive
testing and not for unit/integration/regression testing.
Although this test is run only in special cases (when
SNI_TESTS is defined) it should still be removed.

Also this test is not reliable as it depends on external
resources.
2015-11-09 18:11:18 +00:00
Andrea Faulds dae37661d9 Use ZEND_STRL macro for builtin_types 2015-11-09 11:15:58 +00:00
Xinchen Hui d70aa14f2c Fixed bug #70323 (Regression in zend_fetch_debug_backtrace() can cause segfaults) 2015-11-09 17:14:15 +08:00
Xinchen Hui 0a1e199682 Fixed bug #70624 opcache.huge_code_pages 2015-11-09 12:21:45 +08:00
Xinchen Hui 12f1cfa86a Update NEWS 2015-11-09 12:02:27 +08:00
Caleb Champlin 6ff014b31c Make sure context is set to null to prevent use after free 2015-11-09 11:58:34 +08:00
Xinchen Hui fe12492480 Merge branch 'patch-1' of https://github.com/colinodell/php-src into PHP-7.0 2015-11-07 23:06:41 -08:00
Xinchen Hui 83de5364b7 manually apply the typo fix in master 2015-11-07 23:03:25 -08:00
Lynn 269674f79d rm duplicate include 2015-11-07 23:01:23 -08:00
James Titcumb bb55ac6279 Fixed typo in reflection phpt 2015-11-07 22:58:56 -08:00
Colin O'Dell 55abf6dfb2 Fix description of a BC break 2015-11-07 17:48:02 -05:00
Nikita Popov bc3512c1d6 Fix various update_opN_const issues 2015-11-07 17:45:26 +01:00
Nikita Popov 9da456655c Refactor update_op2_const
Combines both switches into one, to avoid having to maintain the same
opcode list twice. This also makes most of the bugs fixed by the next
commit pretty obvious.

No functional change here.
2015-11-07 17:31:09 +01:00
Xinchen Hui de8bfb32bd Use defined macro 2015-11-07 07:43:18 -08:00
Xinchen Hui e9fd8ad446 Fixed bug #70876 (Segmentation fault when regenerating session id with strict mode) 2015-11-07 07:30:31 -08:00
Xinchen Hui 148bb622fa Revert "Fixed bug #70876 Segmentation fault when regenerating session id with strict mode"
This reverts commit 0bf3ebb4ba.
2015-11-07 07:17:43 -08:00
Xinchen Hui 2d8d97cee2 Fixed bug #70873 (Regression on private static properties access) 2015-11-07 06:50:36 -08:00
Reeze Xia c524f43e4f C99 complain fix 2015-11-07 22:15:19 +08:00
Reeze Xia e4c1e90536 Update NEWS 2015-11-07 22:10:56 +08:00
Reeze Xia 0bf3ebb4ba Fixed bug #70876 Segmentation fault when regenerating session id with strict mode
The comment *mod_data always be non-NULL is not true.
The same as this FIXME: https://github.com/php/php-src/blob/master/ext/session/mod_files.c#L676
2015-11-07 21:46:21 +08:00
Nikita Popov 99d818f1e9 Don't propagate into ops that error on non-string
To properly support this make update_opN_const fallible -- they
are not always called through replace_with_const.
2015-11-07 12:04:51 +01:00
Nikita Popov 00b37e718d Strip leading backslash in update_opN_const 2015-11-07 12:04:51 +01:00
Nikita Popov 632bee4abb Fix update_opX_const lowercasing
It was lowering in-place.
2015-11-07 12:04:51 +01:00
Matteo Beccati c263dcee2f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #70875 Segmentation fault if wsdl has no targetNamespace attribute
2015-11-07 11:05:36 +01:00
Matteo Beccati fd61666d96 Fix bug #70875 Segmentation fault if wsdl has no targetNamespace attribute 2015-11-07 11:00:33 +01:00
Matteo Beccati f2853386b1 Merge remote-tracking branch 'origin/PHP-5.6' into PHP-7.0
* origin/PHP-5.6:
  Always remember NEWS....
  Fix compile warnings about comparison of unsigned expression always being true
  Bump OCI8 version
  Fix bug 68298 (PHP OCI8 OCI int overflow) (Senthil)
2015-11-07 10:46:17 +01:00
Anatol Belski 0cbf3afe17 update NEWS 2015-11-06 23:08:18 +01:00
Anatol Belski d59eb9fcc3 fix decrement_function regarding bug #70863 2015-11-06 23:07:21 +01:00
Anatol Belski 8155ecba61 Fixed bug #70863 Incorect logic to increment_function for proxy objects 2015-11-06 23:07:16 +01:00
Anatol Belski 6897c1116a no more dev ZEND_VERSION 2015-11-06 23:07:10 +01:00
Bob Weinand 855bb36fd0 Add support for IPV6_V6ONLY on sockets 2015-11-06 21:45:31 +01:00
Christopher Jones 049325ca96 Fix bug 68298 (PHP OCI8 OCI int overflow) (Senthil) 2015-11-07 02:24:17 +11:00
Christopher Jones 089ca134fb Always remember NEWS.... 2015-11-07 02:15:24 +11:00
Christopher Jones a57b205383 Fix compile warnings about comparison of unsigned expression always being true 2015-11-07 02:14:18 +11:00
Christopher Jones f88a9a9643 Bump OCI8 version 2015-11-07 02:10:57 +11:00
Christopher Jones 3060dfd92e Fix bug 68298 (PHP OCI8 OCI int overflow) (Senthil) 2015-11-07 01:56:50 +11:00
Xinchen Hui 27aef97f65 Fixed bug #70868 (PCRE JIT and pattern reuse segfault) 2015-11-06 11:37:17 +08:00
Márcio Almada 283b6275df add failing test for bug #70868 2015-11-06 11:34:45 +08:00
Anatol Belski aa0d441ede update NEWS 2015-11-05 22:51:25 +01:00
Anatol Belski 01c844a01d use Z* macro name 2015-11-05 22:39:10 +01:00
Anatol Belski 2283551cfa fix NULL deref in mbstring post handler 2015-11-05 22:24:47 +01:00
Anatol Belski c1f893d894 fix NULL deref in pdo_firebird
ref #70862
2015-11-05 22:11:00 +01:00
Anatol Belski cff9e16a12 fix pdo_sqlite crash with empty bound stream 2015-11-05 21:50:34 +01:00
Anatol Belski 1406f80135 fix leak 2015-11-05 21:49:21 +01:00
Anatol Belski 7b32b8f4e1 fix pdo_mysql crash with empty bound stream param
rel #70862
2015-11-05 21:32:31 +01:00
Anatol Belski 1184f0aca5 add test for bug #70861 2015-11-05 19:48:08 +01:00
Fabian Franz 1fcadf67e6 Fix setting of empty string resource. 2015-11-05 19:47:12 +01:00
Anatol Belski f189353178 fix possible NULL deref in image functions 2015-11-05 18:16:32 +01:00
Anatol Belski 5ac288bcc6 fix crash in sqlite when executing with bound stream param
rel #70862
2015-11-05 18:08:08 +01:00
Anatol Belski 9385eb6ff8 re-update NEWS 2015-11-05 14:48:30 +01:00
Anatol Belski a80545992b update the actual sql parser file for #70861 2015-11-05 14:46:40 +01:00
Anatol Belski 5c96a91d77 Fix bug #70861 Segmentation fault in pdo_parse_params() during Drupal 8 test suite 2015-11-05 14:46:28 +01:00
Anatol Belski 9968129831 don't get invalid chmod mode through 2015-11-05 14:46:23 +01:00
Anatol Belski dea14fc707 zero cwd buffer before passing to chmod 2015-11-05 14:46:18 +01:00
Reeze Xia 435565a54f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Make test for bug #70852 to cover all cases
  Fixed bug #70852 Segfault getting NULL offset of an ArrayObject.
2015-11-05 14:28:49 +08:00
Reeze Xia 1c0622a472 Make test for bug #70852 to cover all cases 2015-11-05 14:09:24 +08:00
Reeze Xia 51218b3b9d Fixed bug #70852 Segfault getting NULL offset of an ArrayObject. 2015-11-05 13:46:03 +08:00
Xinchen Hui e4ac4e75b5 Fixed bug #70853 (SplFixedArray throws exception when using ref variable as index) 2015-11-04 06:44:29 -08:00
Xinchen Hui fe0af271c6 Fixed bug #70843 (Segmentation fault on MacOSX with opcache.file_cache_only=1) 2015-11-04 18:59:30 +08:00
Xinchen Hui 2f2653aa77 Fixed bug #70805 (Segmentation faults whilst running Drupal 8 test suite) 2015-11-03 17:53:56 -08:00
Xinchen Hui d7ff107654 Fixed bug #70540 (sapi/fpm/tests/008.phpt and 016.phpt should be skipped on some platforms) 2015-11-02 16:43:28 +08:00
Xinchen Hui 8dd5e1c2b5 Add test_fpm_conf to skip some tests ranth than mark --xfail-- 2015-11-02 16:42:11 +08:00
Xinchen Hui 8d443d4626 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-02 10:59:07 +08:00
Xinchen Hui 227c898cd9 Fixed test 2015-11-02 10:58:55 +08:00
Xinchen Hui 63c601b631 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-02 10:55:05 +08:00
Xinchen Hui a23a88b3e7 Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6 2015-11-02 10:47:32 +08:00
Xinchen Hui 37ed0dafe4 Fixed bug #70828 (php-fpm 5.6 with opcache crashes when referencing a non-existent constant) 2015-11-02 10:47:02 +08:00
Jakub Zelenka e62db72111 Use standard title for new openssl tests 2015-10-29 19:11:57 +00:00
root 06c6b51e7d new tests to openssl module, don't covered yet. 2015-10-29 19:06:40 +00:00
Andrey Hristov 6d51b7b2e3 Another Fix for Bug #68344 MySQLi does not provide way to disable peer certificate validation
Added the possibility to explicitly state that the peer certificate should not be checked.
Back to the default - checking the certificate.
Exported MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT
Usage : mysqli_real_connect( , , , , , MYSQLI_CLIENT_SSL | MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT)

If mysqli_ssl_set() is not called, but only MYSQLI_CLIENT_SSL is passed, without the (don't) very flag,
then no verification takes place.
2015-10-27 12:59:09 +01:00
Xinchen Hui 008d8b6789 Fixed bug #70656 (require() statement broken after opcache_reset() or a few hours of use) 2015-10-26 17:28:19 -07:00
Xinchen Hui 31553f07f2 Revert "Fixed bug #70656 (require() statement broken after opcache_reset() or a few hours of use)"
This reverts commit 3ef96c2cc6.
2015-10-26 17:26:30 -07:00
Xinchen Hui 3ef96c2cc6 Fixed bug #70656 (require() statement broken after opcache_reset() or a few hours of use) 2015-10-26 17:09:42 -07:00
Leigh faf835be2b Use arc4random on OpenBSD 5.5+ and NetBSD 7+
As discussed with @weltling, keeping arc4random on the condition that the OS has a solid implementation of it
2015-10-30 19:08:20 +00:00
Reeze Xia c4297a5a29 This couldn't be false as it has been checked before 2015-10-30 19:50:54 +08:00
Reeze Xia 68b431e37d Use h parameter to avoid duplicate ht access of array_combine() 2015-10-30 19:49:04 +08:00
Dmitry Stogov 3c5a3e77d4 Fixed incomplete initialization. 2015-10-30 07:15:56 +03:00
Jakub Zelenka 41de89f61b Merge branch 'PHP-5.6' into PHP-7.0 2015-10-29 19:14:25 +00:00
Dmitry Stogov c67fc6bb09 Fixed memory leak in php_stream_context_set_option() 2015-10-29 20:06:55 +03:00
Xinchen Hui 241e340f78 Make these tests fail faster, Thanks to GFW 2015-10-29 15:01:43 +08:00
Xinchen Hui 661798ad34 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-10-29 14:35:31 +08:00
Xinchen Hui 179fba3f38 Fixed bug #70808 (array_merge_recursive corrupts memory of unset items)
I knew, this fix seems ugly
2015-10-29 14:33:58 +08:00
Julien Pauli eb59dd7d81 Don't remap .text segment if huge pages are not available. 2015-10-29 08:44:19 +03:00
Andrey Hristov 2b23ba97f3 Fix mysqli tests 2015-10-28 12:56:12 +01:00
Anatol Belski 5dd59cc90d sync NEWS 2015-10-27 20:10:06 +01:00
Anatol Belski ac4601eadd 7.0.1 is next 2015-10-27 20:08:54 +01:00
Dmitry Stogov eb32da13cd Fix frequent reallocations with many small strings 2015-10-27 17:07:58 +01:00
Anatol Belski 0e50a4c008 correct snprintf usage 2015-10-27 17:07:51 +01:00
Andrey Hristov c133515811 Merge branch 'PHP-5.6' into PHP-7.0 2015-10-27 13:32:45 +01:00
Leigh a53510239f Remove arc4random
There has been a lot of discussion around whether arc4random should be included. Given how many different impementations of it are in the wild, we can't guarantee a secure implementation on all platforms.
2015-10-26 20:40:28 +00:00
Anatol Belski fff11a1e07 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Fixed bug #70718 stream_select() when OpenSSL extension is loaded on PHP Win64
  unbreak coverage data: fix #line directives in phpdbg parser
  exclude datelib from coverage report as asked by Derick
2015-10-26 15:57:26 +01:00
Anatol Belski 2f7a8515ca update NEWS 2015-10-26 15:56:34 +01:00
Anatol Belski 83bfefeccb Fixed bug #70718 stream_select() when OpenSSL extension is loaded on PHP Win64 2015-10-26 15:54:29 +01:00
Dmitry Stogov 0172f198e3 Fixed inconsistent exception handling (uopz/tests/006.phpt was failed when PHP build with --disable-gcc-global-regs). 2015-10-26 16:01:20 +03:00
Xinchen Hui 5767f2b648 Fixed bug #70785 (Infinite loop due to exception during identical comparison) 2015-10-26 11:15:17 +08:00
Jakub Zelenka 2ee99f8954 Check EVP_SealFinal return code
This can be done since we no longer support OpenSSL 0.9.6
2015-10-25 17:53:39 +00:00
Bob Weinand ac58d21aa3 Fix refcount reaching 2^32 - 1 for resources
Happens e.g. in proc_close() when nothing is referencing the file handles, e.g. they have refcount 0 when passed to zend_list_close() and then zend_list_delete() which decrements it to (uint32_t) -1
2015-10-25 18:47:50 +01:00
Nuno Lopes 36311ee4fd unbreak coverage data: fix #line directives in phpdbg parser 2015-10-24 18:12:24 -04:00
Nuno Lopes a0665f3a18 unbreak coverage data: fix #line directives in phpdbg parser 2015-10-24 17:45:53 -04:00
Nuno Lopes 0e069fa57d exclude datelib from coverage report as asked by Derick 2015-10-24 17:38:20 -04:00
Nuno Lopes 87498c5c39 exclude datelib from coverage report as asked by Derick 2015-10-24 17:37:00 -04:00
Nikita Popov b9cc3176eb Fix bug #70782 2015-10-24 23:19:02 +02:00
Anatol Belski aae108c1ce Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix globals initialization in sapi/cgi
2015-10-23 13:59:27 +02:00
Anatol Belski 22af88274b Fix globals initialization in sapi/cgi
Basically backport 8430ec17
2015-10-23 13:56:40 +02:00
Anatol Belski 448d1ce428 rather use the supplied inttypes.h with vc14 2015-10-23 09:47:00 +02:00
Anatol Belski 5ba763413b fix test redirection when run not from source root 2015-10-23 09:42:19 +02:00
Xinchen Hui 95446b4416 Indents 2015-10-23 11:19:30 +08:00
c9s bbaf6daa9d Fix boolean conversion warnings
Summary:

The compiler complains and raised some warnings about boolean
conversion:

    warning: address of 'ce->constants_table' will always evaluate to
    'true' [-Wpointer-bool-conversion]

Since the address of 'HashTable' will always evaluate to true. the
condition should be removed. The scope is kept for local variables.

Platform:

    OS X 10.11

Compiler:

    Apple LLVM version 7.0.0 (clang-700.0.72)
    Target: x86_64-apple-darwin15.0.0
    Thread model: posix
2015-10-23 11:19:19 +08:00
Andrey Hristov 3dc0bf7428 Merge branch 'PHP-5.6' into PHP-7.0 2015-10-22 11:50:12 +02:00
Andrey Hristov afd31489d0 Improve fix for Bug #68344 MySQLi does not provide way to disable peer certificate validation 2015-10-22 11:48:53 +02:00
Andrey Hristov 8f9b2b68ee Merge branch 'PHP-5.6' into PHP-7.0 2015-10-21 15:52:38 +02:00
Andrey Hristov 8292260515 Fix for Bug #68344 MySQLi does not provide way to disable peer certificate validation 2015-10-21 15:10:24 +02:00
Andrey Hristov efd2b3f5f2 Update the certificates needed for the mysqli tests 2015-10-21 10:42:51 +02:00
Bob Weinand 2ef327caed Exempt paging from -qrr mode 2015-10-20 21:56:00 +02:00
Anatol Belski 1149833a58 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  backport 262160e and 2d55e8c into 5.6
2015-10-20 20:07:14 +02:00
Anatol Belski ccc95bf9df backport 262160e and 2d55e8c into 5.6 2015-10-20 20:05:44 +02:00
Xinchen Hui 6ad2c3eb33 Revert "Ensure proper exception handling and EX(opline) state in USER_OPCODE handler"
read: http://news.php.net/php.internals/88887

This reverts commit 808f62bb4d.
2015-10-20 08:12:04 -07:00
Xinchen Hui 673ad62eed Regenerate zend_ini_scanner.c 2015-10-20 16:58:30 +08:00
Xinchen Hui a5a5c3e09a Update NEWS 2015-10-20 13:26:40 +08:00
Xinchen Hui c7cb40353c Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_ini_scanner.c
2015-10-20 13:26:02 +08:00
Xinchen Hui d5f76caf6c Fixed bug #70748 (Segfault in ini_lex () at Zend/zend_ini_scanner.l) 2015-10-20 13:20:56 +08:00
Ferenc Kovacs 131a348d37 remove imap tests for now until I finish the sudoless dovecot config 2015-10-19 23:57:43 +02:00
Ferenc Kovacs fa0ffa4777 remove imap tests for now until I finish the sudoless dovecot config 2015-10-19 23:43:26 +02:00
Ferenc Kovacs 03e1e88db1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fixup, both catched by nikic
  use another character device in this test as /dev/console seems that it is different for lxc containers
  the de_DE(iso-8859-1) locale is not available on ubuntu by default, but there is no reason to require that over the utf-8 one
  let's try running our testsuite without sudo
2015-10-19 23:02:52 +02:00
Ferenc Kovacs 395ef4efb7 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixup, both catched by nikic
  use another character device in this test as /dev/console seems that it is different for lxc containers
  the de_DE(iso-8859-1) locale is not available on ubuntu by default, but there is no reason to require that over the utf-8 one
  let's try running our testsuite without sudo
2015-10-19 22:47:23 +02:00
Ferenc Kovacs f3838a9c35 Merge branch 'pr-1483' into PHP-5.5
* pr-1483:
  fixup, both catched by nikic
  use another character device in this test as /dev/console seems that it is different for lxc containers
  the de_DE(iso-8859-1) locale is not available on ubuntu by default, but there is no reason to require that over the utf-8 one
  let's try running our testsuite without sudo
2015-10-19 22:44:19 +02:00
Stanislav Malyshev 26e5429f72 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #64172
  Bug #70561: Fix DirectoryIterator to throw OutOfBoundsException

Conflicts:
	ext/pdo/pdo_dbh.c
2015-10-18 17:20:00 -07:00
Stanislav Malyshev 0b35e0c5a1 Merge branch 'pull-request/1535' into PHP-5.6
* pull-request/1535:
  Bug #70561: Fix DirectoryIterator to throw OutOfBoundsException
2015-10-18 17:17:55 -07:00
Daniel Persson 73384728ca Fix bug #64172
Check if the SQLSTATE error code is equal to PDO_ERR_NONE before we ask the driver.
And if no error is reported skip the extra call to the driver.
2015-10-18 17:06:54 -07:00
Daniel Persson 307c1f6bf0 Fix bug #64172
Check if the SQLSTATE error code is equal to PDO_ERR_NONE before we ask the driver.
And if no error is reported skip the extra call to the driver.
2015-10-18 17:03:39 -07:00
Stanislav Malyshev c7c6df6cec Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Skip some tests for platforms different than x86
2015-10-18 15:45:40 -07:00
Fábio Perez c76fd640e6 Skip some tests for platforms different than x86
These tests are verifying undefined behaviour such as shifting by more than 63
bits and by negative numbers.
2015-10-18 15:45:25 -07:00
Stanislav Malyshev 5f759b04b8 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Skip serialize test if ext/session is not loaded

Conflicts:
	ext/standard/tests/serialize/bug70219_1.phpt
2015-10-18 15:44:59 -07:00
Stanislav Malyshev b94f67885c Skip serialize test if ext/session is not loaded 2015-10-18 15:43:03 -07:00
Stanislav Malyshev 6a4803026d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Remove wrong argument $session from SNMP::setSecurity()
  Fix SNMP::setSecurity() arginfo (Fixes bug #70476)
2015-10-18 14:51:13 -07:00
jubianchi 718445b096 Remove wrong argument $session from SNMP::setSecurity() 2015-10-18 14:48:39 -07:00
jubianchi 39a2514643 Fix SNMP::setSecurity() arginfo (Fixes bug #70476) 2015-10-18 14:48:25 -07:00
Felipe Pena f231ddddaf - Implemented output paging 2015-10-18 12:08:04 -02:00
Anatol Belski daddb7a832 updated NEWS 2015-10-18 11:36:04 +02:00
Anatol Belski dc241566aa Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2015-10-18 11:35:25 +02:00
Anatol Belski 9501293de7 update NEWS 2015-10-18 11:34:42 +02:00
Anatol Belski af8937c056 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  C89 compat
  use spprintf instead (no need to estrdup afterwards).
  dblib's dbcolname can return null in some cases
  testcase fot bug #69757
  Segmentation fault on pdo_dblib::nextRowset (bug #69757)

Conflicts:
	ext/pdo_dblib/dblib_stmt.c
2015-10-18 11:28:57 +02:00
Anatol Belski 7f33ab834d C89 compat 2015-10-18 11:14:30 +02:00
MiRacLe.RPZ 2b5af600e3 use spprintf instead (no need to estrdup afterwards). 2015-10-18 11:10:50 +02:00
MiRacLe.RPZ 5c19355095 dblib's dbcolname can return null in some cases 2015-10-18 11:10:45 +02:00
MiRacLe.RPZ 4c8f064d7d testcase fot bug #69757 2015-10-18 11:10:39 +02:00
MiRacLe.RPZ acb2368976 Segmentation fault on pdo_dblib::nextRowset (bug #69757) 2015-10-18 11:10:34 +02:00
Aaron Piotrowski c100a742dc Fix missed assertion tests 2015-10-18 02:23:43 -05:00
Aaron Piotrowski 49d6336fae Always return boolean from assert
Matches docs prototype
2015-10-18 01:42:15 -05:00
Aaron Piotrowski 51953423ee Fix assert() implementation to match docs 2015-10-17 14:30:41 -05:00
Xinchen Hui e2d6090043 Fixed bug #70730 (Incorrect ArrayObject serialization if unset is called in serialize())
It's possible to fixed this in SPL side, but it will be ugly, and we
should make serialize more robust, so I prefer fix it in serialize side.
2015-10-17 05:28:49 -07:00
Xinchen Hui d4df6641c8 Fixed bug #70724 (Undefined Symbols from opcache.so on Mac OS X 10.10) 2015-10-17 01:52:32 -07:00
Felipe Pena 20a384dfa9 Fixed bug #70678 (PHP7 returns true when false is expected)
Cherry-pick from master.
2015-10-16 17:44:17 +02:00
Nikita Popov e3e92e96c1 Fixed bug #70430 2015-10-15 22:14:23 +02:00
Nikita Popov 06f38d36a8 Reindent zend_yytnamerr
Separating this whitespace change from the next diff.
2015-10-15 22:13:14 +02:00
Xinchen Hui 88a69ffa58 Fixed bug #70715 (Segmentation fault inside soap client) 2015-10-15 18:46:57 +08:00
Sara Golemon a2005cec5c Scan through a range of ports in case 31338 is busy
ext/standard/tests/network/ud4loop.phpt hardcodes port 31338.
If that fails to bind, try a few more (up to 31499) before giving up.
2015-10-14 22:44:27 -07:00
Xinchen Hui a2cfcdfbe9 Fixed bug #70709 (SOAP Client generates Segfault) 2015-10-15 10:19:43 +08:00
Ferenc Kovacs b610d740fd Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  prepare for 5.6.15RC1
2015-10-15 00:54:59 +02:00
Ferenc Kovacs 22cbf68344 prepare for 5.6.15RC1 2015-10-15 00:22:12 +02:00
Bob Weinand 60b4355168 Do not create a fake Closure for real Closures
That is solved by just returning the Closure as is, which is safe due to Closures being immutable objects
2015-10-14 12:07:33 +02:00
Xinchen Hui 5649b0ccba Merge branch 'patch-1' of https://github.com/glensc/php-src into PHP-7.0 2015-10-14 10:31:07 +08:00
Xinchen Hui 534856c98a Move the tests to proper place 2015-10-14 10:26:02 +08:00
Xinchen Hui 010509355d Fixed Conditional jump or move depends on uninitialised value 2015-10-14 10:19:57 +08:00
Bob Weinand d398cc9d10 Prevent memcmp() result truncation
This fixes reported issues with sapi/phpdbg/tests/watch_001.phpt
2015-10-13 15:51:23 +02:00
Bob Weinand 6efbfc4caf phpdbg test info_001.phpt was dependent on auto_globals_jit 2015-10-13 14:40:42 +02:00
Dmitry Stogov d949c3b6e5 Fixed incorrect "peak" memory consumption calculation. 2015-10-13 15:20:17 +03:00
Anatol Belski d1b67af3ab update UPGRADING 2015-10-13 11:47:30 +02:00
Xinchen Hui a8ae88162f Fixed bug #70689 (Exception handler does not work as expected) 2015-10-13 17:40:58 +08:00
Bob Weinand e85a0aba9b Fix on/off values in phpdbg lexer 2015-10-13 11:29:51 +02:00
Anatol Belski 4d8e284cce prepare NEWS for next 2015-10-13 10:34:30 +02:00
Anatol Belski afdbd8f95b update libs_versions.txt 2015-10-13 09:41:34 +02:00
Elan Ruusamäe 62c74ac634 Update UPGRADING.INTERNALS
typo fix
2015-10-03 22:10:47 +03:00
Bishop Bettini 368d3ff0d9 Bug #70561: Fix DirectoryIterator to throw OutOfBoundsException
-------------------------------------------------------------------------------
DirectoryIterator implements SeekableIterator, which "should throw an
OutOfBoundsException if the position is not seekable". As is, seek just returns
and one must call valid(). This approach is different than most (all?) other
SeekableIterator implementations and leads to developer confusion. See the
bug report for a specific example.
2015-09-23 11:14:52 -04:00
Ferenc Kovacs 95a0b11d0a fixup, both catched by nikic 2015-08-24 17:02:25 +02:00
Ferenc Kovacs e93d7953df use another character device in this test as /dev/console seems that it is different for lxc containers 2015-08-24 14:40:21 +02:00
Ferenc Kovacs 941bbf2067 the de_DE(iso-8859-1) locale is not available on ubuntu by default, but there is no reason to require that over the utf-8 one 2015-08-24 14:40:06 +02:00
Ferenc Kovacs 85d34c3264 let's try running our testsuite without sudo 2015-08-23 22:47:51 +02:00
369 changed files with 7537 additions and 3972 deletions

No files matched your search

-4
View File
@@ -245,10 +245,6 @@ ext/reflection/spl.chm
ext/simplexml/examples/security.new.xml
ext/spl/examples/.htaccess
ext/spl/examples/*.phps
ext/sqlite/weztest.sqlite
ext/sqlite/libsqlite/src/sqlite.h
ext/sqlite/libsqlite/src/parse.out
ext/sqlite/libsqlite/src/libsqlite.dsw
ext/sqlite3/tests/phpsql*
ext/sqlite3/tests/*.db
ext/sqlite3/tests/*.tmp
+18 -8
View File
@@ -1,4 +1,22 @@
language: c
sudo: false
addons:
apt:
packages:
- locales
- language-pack-de
- re2c
- libgmp-dev
- libicu-dev
- libmcrypt-dev
- libtidy-dev
- libenchant-dev
- libaspell-dev
- libpspell-dev
- librecode-dev
- libsasl2-dev
- libxpm-dev
- libt1-dev
notifications:
email:
@@ -27,13 +45,6 @@ env:
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y libenchant-dev libaspell-dev libpspell-dev librecode-dev libsasl2-dev libxpm-dev libt1-dev libc-client2007e-dev
- sudo cp ./travis/de /var/lib/locales/supported.d/de
- sudo dpkg-reconfigure locales
- ./travis/install.sh
before_script:
# Compile PHP
- ./travis/compile.sh
@@ -43,7 +54,6 @@ before_script:
- . ./travis/ext/pdo_mysql/setup.sh
- . ./travis/ext/pgsql/setup.sh
- . ./travis/ext/pdo_pgsql/setup.sh
- . ./travis/ext/imap/setup.sh
# Run PHPs run-tests.php
script:
+1 -1
View File
@@ -57,7 +57,7 @@ php_lcov.info: lcov-test
cp $$x.bbg lcov_data/$$y.bbg ; \
fi; \
done; \
for dir in ext/bcmath/libbcmath ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
for dir in ext/bcmath/libbcmath ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
if test -d lcov_data/$$dir; then \
rm -rf lcov_data/$$dir ; \
fi; \
+493 -441
View File
File diff suppressed because it is too large. Load diff
+2 -4
View File
@@ -599,10 +599,8 @@ TSRM_API int shmget(int key, int size, int flags)
return -1;
}
snprintf(shm_segment, sizeof(shm_segment)-1, "TSRM_SHM_SEGMENT:%d", key);
snprintf(shm_info, sizeof(shm_info)-1, "TSRM_SHM_DESCRIPTOR:%d", key);
shm_segment[sizeof(shm_segment)-1] = '\0';
shm_info[sizeof(shm_info)-1] = '\0';
snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key);
snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key);
shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment);
info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info);
+5 -4
View File
@@ -352,7 +352,7 @@ Relevant RFCs:
Other language changes
----------------------
* Removed support for static calls to non-static calls form an incompatible
* Removed support for static calls to non-static methods from an incompatible
$this context. In this case $this will not be defined, but the call will be
allowed with a deprecation notice. An example:
@@ -556,6 +556,10 @@ Other
. Added ability to move PHP code pages (PHP TEXT segment) into HUGE pages.
It's possible to enable/disable this feature in php.ini through
opcache.huge_code_pages=0/1. OS should be configured to provide huge pages.
. Added Windows only opcache.file_cache_fallback=1 ini option, which implies
the implemented fallback mechanism. When OPcache was not able to reattach
the shared memory segment to the desired address and opcache.file_cache
is on, opcache.file_cache_only=1 will be automatically enforced.
- OpenSSL
. Added "alpn_protocols" SSL context option allowing encrypted client/server
@@ -604,9 +608,6 @@ Other
5. Changed Functions
========================================
- parse_ini_file():
- parse_ini_string():
. Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
- unserialize():
. Added second parameter for unserialize function
(RFC: https://wiki.php.net/rfc/secure_unserialize) allowing to specify
+2 -2
View File
@@ -90,7 +90,7 @@ changes. See: https://wiki.php.net/phpng-upgrading
The only exceptions are the snprintf and zend_sprintf functions yet, because in some cases
they can use the implemenations available on the system, not the PHP one. With snprintf the
macros ZEND_INT_FMT and ZEND_UINT_FMT should be used.
macros ZEND_LONG_FMT and ZEND_ULONG_FMT should be used.
h. HashTable API
@@ -248,7 +248,7 @@ changes. See: https://wiki.php.net/phpng-upgrading
w. Tick functions internal API change
Tick functions have different declaration now. They expect a single
single parameter while before they were parameterless. When registering the
parameter while before they were parameterless. When registering the
tick function a value for this parameter must be passed. This value will be
provided to the tick function on every execution.
@@ -0,0 +1,19 @@
--TEST--
Array addition is not commutative -- do not swap operands
--FILE--
<?php
$array = [1, 2, 3];
$array = [4, 5, 6] + $array;
var_dump($array);
?>
--EXPECT--
array(3) {
[0]=>
int(4)
[1]=>
int(5)
[2]=>
int(6)
}
+1 -1
View File
@@ -18,7 +18,7 @@ bool(true)
bool(true)
Warning: assert(): assert(false) failed in %sexpect_016.php on line 6
NULL
bool(false)
bool(true)
Warning: zend.assertions may be completely enabled or disabled only in php.ini in %sexpect_016.php on line 8
+2 -2
View File
@@ -25,9 +25,9 @@ bool(true)
bool(true)
Warning: assert(): assert(false) failed in %sexpect_018.php on line 10
NULL
bool(false)
bool(true)
Warning: assert(): assert(false) failed in %sexpect_018.php on line 12
NULL
bool(false)
bool(true)
+2 -2
View File
@@ -68,7 +68,7 @@ catch (Exception $e) {
--EXPECTF--
Hello World!
===NONE===
string(56) "Method NoneTest::__toString() must return a string value"
string(%d) "Method NoneTest::__toString() must return a string value"
===THROW===
Fatal error: Method ErrorTest::__toString() must not throw an exception in %sbug26166.php on line %d
Fatal error: Method ErrorTest::__toString() must not throw an exception, caught Exception: This is an error! in %sbug26166.php on line %d
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #52355 (Negating zero does not produce negative zero)
--FILE--
<?php
var_dump(-0.0);
var_dump(-(float)"0");
$foo = -sin(0);
var_dump($foo);
var_dump(@(1.0 / -0.0));
?>
--EXPECT--
float(-0)
float(-0)
float(-0)
float(-INF)
+1 -1
View File
@@ -14,7 +14,7 @@ class Bad {
$bad = new Bad();
echo "$bad";
--EXPECTF--
Fatal error: Method Bad::__toString() must not throw an exception in %sbug60909_2.php on line 0
Fatal error: Method Bad::__toString() must not throw an exception, caught Exception: Oops, I cannot do this in %sbug60909_2.php on line %d
!!!shutdown!!!
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #70430: Stack buffer overflow in zend_language_parser()
--FILE--
<?php
$"*** Testing function() : ***\n";
?>
--EXPECTF--
Parse error: syntax error, unexpected '"*** Testing function() : ***' (T_CONSTANT_ENCAPSED_STRING), expecting variable (T_VARIABLE) or '{' or '$' in %s on line %d
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #70689 (Exception handler does not work as expected)
--FILE--
<?php
function foo($foo) {
echo "Executing foo\n";
}
set_error_handler(function($errno, $errstr) {
throw new Exception($errstr);
});
try {
foo();
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
Missing argument 1 for foo(), called in %sbug70689.php on line %d and defined
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #70748 (Segfault in ini_lex () at Zend/zend_ini_scanner.l)
--FILE--
<?php
$ini = '[${ ';
$ini_file = __DIR__ . "/bug70748.ini";
file_put_contents($ini_file, $ini);
var_dump(parse_ini_file($ini_file));
?>
--CLEAN--
<?php
unlink(__DIR__ . "/bug70748.ini");
?>
--EXPECTF--
Warning: syntax error, unexpected $end, expecting '}' in %sbug70748.ini on line %d
in %sbug70748.php on line %d
bool(false)
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #70782: null ptr deref and segfault (zend_get_class_fetch_type)
--FILE--
<?php
(-0)::$prop;
?>
--EXPECTF--
Fatal error: Illegal class name in %s on line %d
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #70785 (Infinite loop due to exception during identical comparison)
--FILE--
<?php
set_error_handler(function($no, $msg) {
throw new Exception($msg);
});
try {
if ($a === null) { // ZEND_VM_SMART_BRANCH
undefined_function('Null');
}
} catch (Exception $e) {
}
try {
$c === 3; // ZEND_VM_NEXT_OPCODE
undefined_function();
} catch (Exception $e) {
}
?>
okey
--EXPECT--
okey
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #70804 (Unary add on negative zero produces positive zero)
--FILE--
<?php
var_dump(+(-0.0));
var_dump(+(float)"-0");
$foo = +(-sin(0));
var_dump($foo);
?>
--EXPECT--
float(-0)
float(-0)
float(-0)
+46
View File
@@ -0,0 +1,46 @@
--TEST--
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite)
--FILE--
<?php
class A {
}
class B {
}
class C {
public function __destruct() {
if (isset($GLOBALS["a"])) {
unset($GLOBALS["array"]);
unset($GLOBALS["a"]); // this will be called in gc_colloct_roots and put $a into gc roots buf
}
}
}
$a = new A;
$a->b = new B;
$a->b->a = $a;
$i = 0;
$c = new A;
$array = array($c); //This is used to leave a room for $GLOBALS["a"]
unset($c);
while ($i++ < 9997) {
$t = [];
$t[] = &$t;
unset($t);
}
$t = [new C];
$t[] = &$t;
unset($t); // This is used to trigger C::__destruct while doing gc_colloct_roots
$e = $a;
unset($a); // This one can not be putted into roots buf because it's full, thus gc_colloct_roots will be called,
// but C::__destructor which is called in gc_colloct_roots will put $a into buf
// which will make $a be putted into gc roots buf twice
var_dump(gc_collect_cycles());
?>
--EXPECT--
int(0)
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Crash)
--FILE--
<?php
class A {
}
class B {
}
class C {
public function __destruct() {
if (isset($GLOBALS["a"])) {
unset($GLOBALS["array"]);
unset($GLOBALS["a"]);
}
}
}
$a = new A;
$a->b = new B;
$a->b->a = $a;
$i = 0;
$c = new A;
$array = array($c);
unset($c);
while ($i++ < 9997) {
$t = [];
$t[] = &$t;
unset($t);
}
$t = [new C];
$t[] = &$t;
unset($t);
unset($a);
var_dump(gc_collect_cycles());
?>
--EXPECT--
int(2)
+37
View File
@@ -0,0 +1,37 @@
--TEST--
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Memleak)
--FILE--
<?php
class A {
}
class B {
}
class C {
public function __destruct() {
if (isset($GLOBALS["a"])) {
unset($GLOBALS["a"]);
}
}
}
$a = new A;
$a->b = new B;
$a->b->a = $a;
$i = 0;
while ($i++ < 9998) {
$t = [];
$t[] = &$t;
unset($t);
}
$t = [new C];
$t[] = &$t;
unset($t);
unset($a);
var_dump(gc_collect_cycles());
--EXPECT--
int(2)
+34
View File
@@ -0,0 +1,34 @@
--TEST--
Bug #70873 (Regression on private static properties access)
--FILE--
<?php
class A {
private static $x = 1;
}
class B extends A {
function bar() {
var_dump(self::$x);
}
};
class C extends A {
function bar() {
var_dump(A::$x);
}
};
$a = new B;
$a->bar();
$b = new C;
$b->bar();
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot access property B::$x in %sbug70873.php:%d
Stack trace:
#0 %sbug70873.php(%d): B->bar()
#1 {main}
thrown in %sbug70873.php on line %d
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #70895 null ptr deref and segfault with crafted callable
--FILE--
<?php
array_map("%n", 0);
array_map("%n %i", 0);
array_map("%n %i aoeu %f aoeu %p", 0);
?>
--EXPECTREGEX--
Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n' not found or invalid function name in .+
Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n %i' not found or invalid function name in .+
Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n %i aoeu %f aoeu %p' not found or invalid function name in .+bug70895.php on line \d+
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #70895 null ptr deref and segfault with crafted callable
--FILE--
<?php
function m($f,$a){
return array_map($f,0);
}
echo implode(m("",m("",m("",m("",m("0000000000000000000000000000000000",("")))))));
?>
--EXPECTF--
Warning: array_map() expects parameter 1 to be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name in %sbug70898.php on line %d
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
Warning: implode(): Argument must be an array in %sbug70898.php on line %d
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #70912 (Null ptr dereference when class property is initialised to a dereferenced value)
--FILE--
<?php
class A {
public $a=[][];
}
?>
--EXPECTF--
Fatal error: Cannot use [] for reading in %sbug70912.php on line %d
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #70914 zend_throw_or_error() format string vulnerability
--SKIPIF--
<?php
if (!extension_loaded("pdo_sqlite")) {
die("skip pdo_sqlite required");
}
?>
--FILE--
<?php
$db = new PDO('sqlite::memory:');
$st = $db->query('SELECT 1');
$re = $st->fetchObject('%Z');
?>
--EXPECTREGEX--
Fatal error: Class '%Z' not found in .+bug70914.php on line \d+
+37
View File
@@ -0,0 +1,37 @@
--TEST--
Bug #70944 (try{ } finally{} can create infinite chains of exceptions)
--FILE--
<?php
try {
$e = new Exception("Foo");
try {
throw new Exception("Bar", 0, $e);
} finally {
throw $e;
}
} catch (Exception $e) {
var_dump((string)$e);
}
try {
$e = new Exception("Foo");
try {
throw new Exception("Bar", 0, $e);
} finally {
throw new Exception("Dummy", 0, $e);
}
} catch (Exception $e) {
var_dump((string)$e);
}
?>
--EXPECTF--
string(%d) "Exception: Foo in %sbug70944.php:%d
Stack trace:
#0 {main}"
string(%d) "Exception: Foo in %sbug70944.php:%d
Stack trace:
#0 {main}
Next Exception: Dummy in %sbug70944.php:%d
Stack trace:
#0 {main}"
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #70957 (self::class can not be resolved with reflection for abstract class)
--FILE--
<?php
abstract class Foo
{
function bar($a = self::class) {}
}
trait T {
public function bar() {
}
}
class B extends Foo
{
use T;
}
?>
--EXPECTF--
Warning: Declaration of T::bar() should be compatible with Foo::bar($a = 'Foo') in %sbug70957.php on line %d
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #70958 (Invalid opcode while using ::class as trait method paramater default value)
--FILE--
<?php
trait Foo
{
function bar($a = self::class) {
var_dump($a);
}
}
class B {
use Foo;
}
$b = new B;
$b->bar();
?>
--EXPECT--
string(1) "B"
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #70967 (Weird error handling for __toString when Error is thrown)
--FILE--
<?php
class A {
public function __toString() {
undefined_function();
}
}
echo (new A);
?>
--EXPECTF--
Fatal error: Method A::__toString() must not throw an exception, caught Error: Call to undefined function undefined_function() in %sbug70967.php on line %d
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #70987 (static::class within Closure::call() causes segfault)
--FILE--
<?php
class foo {}
$bar = function () {
return static::class;
};
var_dump($bar->call(new foo));
?>
--EXPECTF--
string(3) "foo"
+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #70997 (When using parentClass:: instead of parent::, static context changed)
--FILE--
<?php
class A {
const TEST = false;
public function test()
{
var_dump(static::TEST);
}
}
class B extends A {
const TEST = true;
public function test()
{
A::test();
}
}
$b = new B;
$b->test();
--EXPECT--
bool(true)
+31
View File
@@ -0,0 +1,31 @@
--TEST--
Bug #71067 (Local object in class method stays in memory for each call)
--INI--
opcache.enable=0
error_reporting=0
--FILE--
<?php
class Test {
public function test(){
$arr = (object) [
'children' => []
];
$arr->children[] = 1;
return $arr;
}
}
$o = new Test();
$o->test();
print_r($o->test());
?>
--EXPECT--
stdClass Object
(
[children] => Array
(
[0] => 1
)
)
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #71086: Invalid numeric literal parse error within highlight_string() function
--FILE--
<?php
$highlightedString = highlight_string("<?php \n 09 09 09;", true);
var_dump($highlightedString);
?>
--EXPECT--
string(169) "<code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php&nbsp;<br />&nbsp;</span><span style="color: #007700">09&nbsp;09&nbsp;09;</span>
</span>
</code>"
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #71154: Incorrect HT iterator invalidation causes iterator reuse
--FILE--
<?php
$array = [1, 2, 3];
foreach ($array as &$ref) {
/* Free array, causing free of iterator */
$array = [];
/* Reuse the iterator.
* However it will also be reused on next foreach iteration */
$it = new ArrayIterator([1, 2, 3]);
$it->rewind();
}
var_dump($it->current());
?>
--EXPECT--
int(1)
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #71163 (Segmentation Fault (cleanup_unfinished_calls))
--FILE--
<?php
function __autoload($name) {
eval ("class $name extends Exception { public static function foo() {}}");
throw new Exception("boom");
}
function test2() {
try {
Test::foo();
} catch (Exception $e) {
echo "okey";
}
}
function test() {
test2();
}
test();
?>
--EXPECT--
okey
+33
View File
@@ -64,6 +64,15 @@ $tests = [
[new DLL, null],
[new DLL, ClsUnrelated::class],
]],
[function() {}, [
[null, null],
[new Cls, null],
[new Cls, 'Cls'],
[null, 'Cls'],
[null, 'stdClass'],
[new stdClass, null],
]],
];
set_error_handler(function($errno, $errstr) {
@@ -79,6 +88,9 @@ foreach ($tests as list($fn, $bindings)) {
$c = (new ReflectionFunction($fn))->getClosure();
$fnStr = $fn;
}
if ($fn instanceof Closure) {
$fnStr = "(function() {})";
}
echo "$fnStr()\n" . str_repeat('-', strlen($fnStr) + 2), "\n\n";
@@ -206,3 +218,24 @@ Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure
bindTo(new SplDoublyLinkedList, ClsUnrelated::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
(function() {})()
-----------------
bindTo(null, null):
Success!
bindTo(new Cls, null):
Success!
bindTo(new Cls, Cls::class):
Success!
bindTo(null, Cls::class):
Success!
bindTo(null, stdClass::class):
Cannot bind closure to scope of internal class stdClass
bindTo(new stdClass, null):
Success!
+52
View File
@@ -0,0 +1,52 @@
--TEST--
Concatenating many small strings should not slowdown allocations
--SKIPIF--
<?php if (PHP_DEBUG) { die ("skip debug version is slow"); } ?>
--INI--
memory_limit=256m
--FILE--
<?php
/* To note is that memory usage can vary depending on whether opcache is on. The actual
measuring that matters is timing here. */
$time = microtime(TRUE);
/* This might vary on Linux/Windows, so the worst case and also count in slow machines. */
$t0_max = 0.1;
$t1_max = 0.4;
$datas = [];
for ($i = 0; $i < 220000; $i++)
{
$datas[] = [
'000.000.000.000',
'000.255.255.255',
'保留地址',
'保留地址',
'保留地址',
'保留地址',
'保留地址',
'保留地址',
];
}
$t0 = microtime(TRUE) - $time;
var_dump($t0 < $t0_max);
$texts = '';
foreach ($datas AS $data)
{
$texts .= implode("\t", $data) . "\r\n";
}
$t1 = microtime(TRUE) - $time;
var_dump($t1 < $t1_max);
?>
+++DONE+++
--EXPECT--
bool(true)
bool(true)
+++DONE+++
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #70904 (yield from incorrectly marks valid generator as finished)
--FILE--
<?php
function g1() {
yield 1;
}
function g2($g1) {
yield from $g1;
echo "reached!\n";
yield 2;
}
$g1 = g1();
$g2 = g2($g1);
var_dump($g2->valid());
var_dump($g2->current());
$g1->next();
var_dump($g1->valid());
var_dump($g2->valid());
var_dump($g2->current());
$g2->next();
var_dump($g2->valid());
var_dump($g2->current());
$g2->next();
var_dump($g2->valid());
var_dump($g2->current());
?>
--EXPECT--
bool(true)
int(1)
bool(false)
bool(true)
int(1)
reached!
bool(true)
int(2)
bool(false)
NULL
+32
View File
@@ -0,0 +1,32 @@
--TEST--
Bug #70965 (yield from with a common iterator primes too much)
--FILE--
<?php
function it() {
yield from [1, 2, 3, 4, 5];
}
function bar($g) {
yield from $g;
}
$gen = it();
$gens[] = bar($gen);
$gens[] = bar($gen);
do {
foreach($gens as $g) {
var_dump($g->current());
$gen->next();
}
} while ($gen->valid());
?>
--EXPECT--
int(1)
int(2)
int(3)
int(4)
int(5)
int(5)
+49
View File
@@ -0,0 +1,49 @@
--TEST--
Bug #71013 (Incorrect exception handler with yield from)
--FILE--
<?php
class FooBar implements Iterator {
function __construct() { echo "Constructing new FooBar\n"; }
function __destruct() { echo "Destructing FooBar\n"; }
function current () { throw new Exception; }
function key () { return 0; }
function next () {}
function rewind () {}
function valid () { return true; }
}
function foo() {
try {
$f = new FooBar;
yield from $f;
} catch (Exception $e) {
echo "[foo()] Caught Exception\n";
}
}
function bar() {
echo "Starting bar()\n";
$x = foo();
try {
var_dump($x->current());
} catch (Exception $e) {
echo "[bar()] Caught Exception\n";
}
echo "Unsetting \$x\n";
unset($x);
echo "Finishing bar()\n";
}
bar();
?>
--EXPECT--
Starting bar()
Constructing new FooBar
[foo()] Caught Exception
Destructing FooBar
NULL
Unsetting $x
Finishing bar()
@@ -37,5 +37,8 @@ int(4)
int(6)
int(3)
int(5)
int(3)
int(5)
NULL
bool(false)
@@ -0,0 +1,43 @@
--TEST--
Throwing into a generator yielding from an array/iterator
--FILE--
<?php
$data = [1, 2, 3];
function yielditer($arr) {
foreach($arr as $val) {
yield $val;
}
}
function yf($in) {
yield from $in;
}
function test($g) {
var_dump($g->current());
try {
$g->throw(new Exception("Exception!"));
} catch (Exception $e) {
echo "{$e->getMessage()}\n";
}
var_dump($g->current());
}
$yfiter = yf($data);
$yfgen = yf(yielditer($data));
test(yf($data));
echo "\n";
test(yf(yielditer($data)));
?>
--EXPECT--
int(1)
Exception!
NULL
int(1)
Exception!
NULL
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Using an integer as a static property name
--FILE--
<?php
class Foo {
public static $bar = 42;
}
$n = 42;
${42} = 24;
var_dump(${42});
var_dump(${(int) 42});
var_dump(${(int) $n});
try {
var_dump(Foo::${42});
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(Foo::${(int) 42});
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(Foo::${(int) $n});
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
int(24)
int(24)
int(24)
Access to undeclared static property: Foo::$42
Access to undeclared static property: Foo::$42
Access to undeclared static property: Foo::$42
+1 -1
View File
@@ -11,4 +11,4 @@ echo __NAMESPACE__ . "\n";
===DONE===
--EXPECTF--
Fatal error: Namespace declaration statement has to be the very first statement in the script in %sns_068.php on line %d
Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in %sns_068.php on line %d
+1 -1
View File
@@ -11,4 +11,4 @@ echo "ok\n";
}
?>
--EXPECTF--
Fatal error: Namespace declaration statement has to be the very first statement in the script in %s on line %d
Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in %sns_083.php on line %d
+23
View File
@@ -0,0 +1,23 @@
--TEST--
return type with finally
--INI--
opcache.enable=0
--FILE--
<?php
function foo() : array {
try {
throw new Exception("xxxx");
} finally {
return ;
}
}
foo();
?>
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of foo() must be of the type array, none returned in %s29.php:%d
Stack trace:
#0 %s(%d): foo()
#1 {main}
thrown in %s029.php on line %d
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #71092 (Segmentation fault with return type hinting)
--INI--
opcache.enable=0
--FILE--
<?php
function boom(): array {
$data = [['id']];
switch ($data[0]) {
case ['id']:
return;
}
}
boom();
?>
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of boom() must be of the type array, none returned in %sbug71092.php:%d
Stack trace:
#0 %s(%d): boom()
#1 {main}
thrown in %sbug71092.php on line %d
+40
View File
@@ -0,0 +1,40 @@
--TEST--
Combination of foreach, finally and goto (call order)
--FILE--
<?php
class A {
public $n = 0;
function __construct($n) {
$this->n = $n;
}
function __destruct() {
echo "destruct" . $this->n . "\n";
}
}
foreach ([new A(1)] as $a) {
$a = null;
try {
foreach ([new A(2)] as $a) {
$a = null;
try {
foreach ([new A(3)] as $a) {
$a = null;
goto out;
}
} finally {
echo "finally1\n";
}
out: ;
}
} finally {
echo "finally2\n";
}
}
?>
--EXPECT--
destruct3
finally1
destruct2
finally2
destruct1
+42
View File
@@ -0,0 +1,42 @@
--TEST--
Combination of foreach, finally and exception (call order)
--FILE--
<?php
class A {
public $n = 0;
function __construct($n) {
$this->n = $n;
}
function __destruct() {
echo "destruct" . $this->n . "\n";
}
}
foreach ([new A(1)] as $a) {
$a = null;
try {
foreach ([new A(2)] as $a) {
$a = null;
try {
foreach ([new A(3)] as $a) {
$a = null;
throw new Exception();
}
} finally {
echo "finally1\n";
}
}
} catch (Exception $e) {
echo "catch\n";
} finally {
echo "finally2\n";
}
}
?>
--EXPECT--
destruct3
finally1
destruct2
catch
finally2
destruct1
@@ -0,0 +1,13 @@
--TEST--
Fully qualified (leading backslash) type names must fail
--FILE--
<?php
function foo(\int $foo) {
var_dump($foo);
}
foo(1);
?>
--EXPECTF--
Fatal error: Scalar type declaration 'int' must be unqualified in %s on line %d
@@ -0,0 +1,11 @@
--TEST--
namespace\int is not a valid type hint
--FILE--
<?php
function test(namespace\int $i) {}
test(0);
?>
--EXPECTF--
Fatal error: Scalar type declaration 'int' must be unqualified in %s on line %d
@@ -0,0 +1,13 @@
--TEST--
Accessing a static property on a statically evaluable class expression
--FILE--
<?php
class A {
public static $b = 42;
}
var_dump(('A' . (string) '')::$b);
?>
--EXPECT--
int(42)
@@ -0,0 +1,13 @@
--TEST--
Static property on constexpr class with leading backslash
--FILE--
<?php
class A {
public static $b = 42;
}
var_dump(('\A' . (string) '')::$b);
?>
--EXPECT--
int(42)
@@ -0,0 +1,11 @@
--TEST--
Static property access on constexpr class evaluating to integer
--FILE--
<?php
((int)1)::$b;
?>
--EXPECTF--
Fatal error: Uncaught Error: Class name must be a valid object or a string in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
+2 -3
View File
@@ -983,7 +983,6 @@ ZEND_API void zend_deactivate(void) /* {{{ */
fprintf(stderr, " Root Buffered buffer grey\n");
fprintf(stderr, " -------- -------- ----------- ------\n");
fprintf(stderr, "ZVAL %8d %8d %9d %8d\n", GC_G(zval_possible_root), GC_G(zval_buffered), GC_G(zval_remove_from_buffer), GC_G(zval_marked_grey));
fprintf(stderr, "ZOBJ %8d %8d %9d %8d\n", GC_G(zobj_possible_root), GC_G(zobj_buffered), GC_G(zobj_remove_from_buffer), GC_G(zobj_marked_grey));
#endif
zend_try {
@@ -1316,7 +1315,7 @@ ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const c
if (EG(current_execute_data) && !CG(in_compilation)) {
zend_throw_exception(exception_ce, message, 0);
} else {
zend_error(E_ERROR, message);
zend_error(E_ERROR, "%s", message);
}
efree(message);
@@ -1346,7 +1345,7 @@ ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, cons
if (throw_exception) {
zend_throw_exception(zend_ce_type_error, message, 0);
} else {
zend_error(E_WARNING, message);
zend_error(E_WARNING, "%s", message);
}
efree(message);
+1 -1
View File
@@ -22,7 +22,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "3.0.0-dev"
#define ZEND_VERSION "3.0.0"
#define ZEND_ENGINE_3
+16 -3
View File
@@ -25,6 +25,7 @@
#include "zend_execute.h"
#include "zend_API.h"
#include "zend_modules.h"
#include "zend_extensions.h"
#include "zend_constants.h"
#include "zend_exceptions.h"
#include "zend_closures.h"
@@ -1219,8 +1220,20 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties)
zend_property_info *property_info;
ZEND_HASH_FOREACH_KEY_VAL(properties, h, key, prop) {
if(key) {
property_info = zend_get_property_info(object->ce, key, 1);
if (key) {
if (ZSTR_VAL(key)[0] == '\0') {
const char *class_name, *prop_name;
size_t prop_name_len;
if (zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len) == SUCCESS) {
zend_string *pname = zend_string_init(prop_name, prop_name_len, 0);
property_info = zend_get_property_info(object->ce, pname, 1);
zend_string_release(pname);
} else {
property_info = ZEND_WRONG_PROPERTY_INFO;
}
} else {
property_info = zend_get_property_info(object->ce, key, 1);
}
if (property_info != ZEND_WRONG_PROPERTY_INFO &&
property_info &&
(property_info->flags & ZEND_ACC_STATIC) == 0) {
@@ -1989,7 +2002,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /
lcname = zend_string_alloc(name_len, 0);
zend_str_tolower_copy(ZSTR_VAL(lcname), dep->name, name_len);
if (zend_hash_exists(&module_registry, lcname)) {
if (zend_hash_exists(&module_registry, lcname) || zend_get_extension(dep->name)) {
zend_string_free(lcname);
/* TODO: Check version relationship */
zend_error(E_CORE_WARNING, "Cannot load module '%s' because conflicting module '%s' is already loaded", module->name, dep->name);
+33 -5
View File
@@ -506,9 +506,9 @@ static void zend_mm_munmap(void *addr, size_t size)
/* number of trailing set (1) bits */
static zend_always_inline int zend_mm_bitset_nts(zend_mm_bitset bitset)
{
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL)
return __builtin_ctzl(~bitset);
#elif defined(__GNUC__) || __has_builtin(__builtin_ctzll)
#elif (defined(__GNUC__) || __has_builtin(__builtin_ctzll)) && defined(PHP_HAVE_BUILTIN_CTZLL)
return __builtin_ctzll(~bitset);
#elif defined(_WIN32)
unsigned long index;
@@ -545,9 +545,9 @@ static zend_always_inline int zend_mm_bitset_nts(zend_mm_bitset bitset)
/* number of trailing zero bits (0x01 -> 1; 0x40 -> 6; 0x00 -> LEN) */
static zend_always_inline int zend_mm_bitset_ntz(zend_mm_bitset bitset)
{
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL)
return __builtin_ctzl(bitset);
#elif defined(__GNUC__) || __has_builtin(__builtin_ctzll)
#elif (defined(__GNUC__) || __has_builtin(__builtin_ctzll)) && defined(PHP_HAVE_BUILTIN_CTZLL)
return __builtin_ctzll(bitset);
#elif defined(_WIN32)
unsigned long index;
@@ -1161,7 +1161,7 @@ static zend_always_inline void zend_mm_free_large(zend_mm_heap *heap, zend_mm_ch
/* higher set bit number (0->N/A, 1->1, 2->2, 4->3, 8->4, 127->7, 128->8 etc) */
static zend_always_inline int zend_mm_small_size_to_bit(int size)
{
#if defined(__GNUC__) || __has_builtin(__builtin_clz)
#if (defined(__GNUC__) || __has_builtin(__builtin_clz)) && defined(PHP_HAVE_BUILTIN_CLZ)
return (__builtin_clz(size) ^ 0x1f) + 1;
#elif defined(_WIN32)
unsigned long index;
@@ -1462,7 +1462,15 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
#if ZEND_DEBUG
size = real_size;
#endif
#ifdef ZEND_WIN32
/* On Windows we don't have ability to extend huge blocks in-place.
* We allocate them with 2MB size granularity, to avoid many
* reallocations when they are extended by small pieces
*/
new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
#else
new_size = ZEND_MM_ALIGNED_SIZE_EX(size, REAL_PAGE_SIZE);
#endif
if (new_size == old_size) {
#if ZEND_DEBUG
zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
@@ -1507,7 +1515,9 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
heap->real_size += new_size - old_size;
#endif
#if ZEND_MM_STAT
heap->real_peak = MAX(heap->real_peak, heap->real_size);
heap->size += new_size - old_size;
heap->peak = MAX(heap->peak, heap->size);
#endif
#if ZEND_DEBUG
zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
@@ -1618,9 +1628,19 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
}
/* Naive reallocation */
#if ZEND_MM_STAT
do {
size_t orig_peak = heap->peak;
size_t orig_real_peak = heap->real_peak;
#endif
ret = zend_mm_alloc_heap(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
memcpy(ret, ptr, MIN(old_size, copy_size));
zend_mm_free_heap(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
#if ZEND_MM_STAT
heap->peak = MAX(orig_peak, heap->size);
heap->real_peak = MAX(orig_real_peak, heap->real_size);
} while (0);
#endif
return ret;
}
@@ -1710,7 +1730,15 @@ static void zend_mm_change_huge_block_size(zend_mm_heap *heap, void *ptr, size_t
static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
#ifdef ZEND_WIN32
/* On Windows we don't have ability to extend huge blocks in-place.
* We allocate them with 2MB size granularity, to avoid many
* reallocations when they are extended by small pieces
*/
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
#else
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, REAL_PAGE_SIZE);
#endif
void *ptr;
#if ZEND_MM_LIMIT
+11 -9
View File
@@ -2481,7 +2481,7 @@ ZEND_FUNCTION(debug_print_backtrace)
ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit) /* {{{ */
{
zend_execute_data *call, *ptr, *skip;
zend_execute_data *ptr, *skip, *call = NULL;
zend_object *object;
int lineno, frameno = 0;
zend_function *func;
@@ -2490,8 +2490,12 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
zend_string *include_filename = NULL;
zval stack_frame;
call = NULL;
ptr = EG(current_execute_data);
array_init(return_value);
if (!(ptr = EG(current_execute_data))) {
return;
}
if (!ptr->func || !ZEND_USER_CODE(ptr->func->common.type)) {
call = ptr;
ptr = ptr->prev_execute_data;
@@ -2509,13 +2513,11 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
ptr = ptr->prev_execute_data;
}
}
if (!call) {
call = ptr;
ptr = ptr->prev_execute_data;
}
}
if (!call) {
call = ptr;
ptr = ptr->prev_execute_data;
}
array_init(return_value);
while (ptr && (limit == 0 || frameno < limit)) {
frameno++;
+1
View File
@@ -150,6 +150,7 @@ ZEND_METHOD(Closure, call)
fci.param_count = my_param_count;
fci.object = fci_cache.object = newobj;
fci_cache.initialized = 1;
fci_cache.called_scope = Z_OBJCE_P(newthis);
if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_GENERATOR) {
zval new_closure;
+40 -24
View File
@@ -190,10 +190,10 @@ typedef struct _builtin_type_info {
} builtin_type_info;
static const builtin_type_info builtin_types[] = {
{"int", sizeof("int") - 1, IS_LONG},
{"float", sizeof("float") - 1, IS_DOUBLE},
{"string", sizeof("string") - 1, IS_STRING},
{"bool", sizeof("bool") - 1, _IS_BOOL},
{ZEND_STRL("int"), IS_LONG},
{ZEND_STRL("float"), IS_DOUBLE},
{ZEND_STRL("string"), IS_STRING},
{ZEND_STRL("bool"), _IS_BOOL},
{NULL, 0, IS_UNDEF}
};
@@ -2126,8 +2126,15 @@ static zend_op *zend_compile_class_ref(znode *result, zend_ast *name_ast, int th
zend_compile_expr(&name_node, name_ast);
if (name_node.op_type == IS_CONST) {
zend_string *name = Z_STR(name_node.u.constant);
uint32_t fetch_type = zend_get_class_fetch_type(name);
zend_string *name;
uint32_t fetch_type;
if (Z_TYPE(name_node.u.constant) != IS_STRING) {
zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name");
}
name = Z_STR(name_node.u.constant);
fetch_type = zend_get_class_fetch_type(name);
opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, NULL);
opline->extended_value = fetch_type | (throw_exception ? ZEND_FETCH_CLASS_EXCEPTION : 0);
@@ -2372,6 +2379,7 @@ zend_op *zend_compile_static_prop_common(znode *result, zend_ast *ast, uint32_t
opline = zend_emit_op(result, ZEND_FETCH_R, &prop_node, NULL);
}
if (opline->op1_type == IS_CONST) {
convert_to_string(CT_CONSTANT(opline->op1));
zend_alloc_polymorphic_cache_slot(opline->op1.constant);
}
if (class_node.op_type == IS_CONST) {
@@ -3575,8 +3583,6 @@ void zend_compile_return(zend_ast *ast) /* {{{ */
zend_compile_expr(&expr_node, expr_ast);
}
zend_handle_loops_and_finally();
if (CG(context).in_finally) {
opline = zend_emit_op(NULL, ZEND_DISCARD_EXCEPTION, NULL, NULL);
opline->op1_type = IS_TMP_VAR;
@@ -3587,6 +3593,9 @@ void zend_compile_return(zend_ast *ast) /* {{{ */
if (!(CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) && CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
zend_emit_return_type_check(expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1);
}
zend_handle_loops_and_finally();
opline = zend_emit_op(NULL, by_ref ? ZEND_RETURN_BY_REF : ZEND_RETURN,
&expr_node, NULL);
@@ -4376,6 +4385,11 @@ static void zend_compile_typename(zend_ast *ast, zend_arg_info *arg_info) /* {{{
zend_uchar type = zend_lookup_builtin_type_by_name(class_name);
if (type != 0) {
if (ast->attr != ZEND_NAME_NOT_FQ) {
zend_error_noreturn(E_COMPILE_ERROR,
"Scalar type declaration '%s' must be unqualified",
ZSTR_VAL(zend_string_tolower(class_name)));
}
arg_info->type_hint = type;
} else {
uint32_t fetch_type = zend_get_class_fetch_type_ast(ast);
@@ -5623,7 +5637,7 @@ void zend_compile_namespace(zend_ast *ast) /* {{{ */
}
if (num > 0) {
zend_error_noreturn(E_COMPILE_ERROR, "Namespace declaration statement has to be "
"the very first statement in the script");
"the very first statement or after any declare call in the script");
}
}
@@ -5792,12 +5806,9 @@ static inline void zend_ct_eval_unary_op(zval *result, uint32_t opcode, zval *op
static inline void zend_ct_eval_unary_pm(zval *result, zend_ast_kind kind, zval *op) /* {{{ */
{
binary_op_type fn = kind == ZEND_AST_UNARY_PLUS
? add_function : sub_function;
zval left;
ZVAL_LONG(&left, 0);
fn(result, &left, op);
ZVAL_LONG(&left, (kind == ZEND_AST_UNARY_PLUS) ? 1 : -1);
mul_function(result, &left, op);
}
/* }}} */
@@ -5987,7 +5998,8 @@ void zend_compile_unary_op(znode *result, zend_ast *ast) /* {{{ */
void zend_compile_unary_pm(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
znode zero_node, expr_node;
znode expr_node;
znode lefthand_node;
ZEND_ASSERT(ast->kind == ZEND_AST_UNARY_PLUS || ast->kind == ZEND_AST_UNARY_MINUS);
@@ -6000,11 +6012,9 @@ void zend_compile_unary_pm(znode *result, zend_ast *ast) /* {{{ */
return;
}
zero_node.op_type = IS_CONST;
ZVAL_LONG(&zero_node.u.constant, 0);
zend_emit_op_tmp(result, ast->kind == ZEND_AST_UNARY_PLUS ? ZEND_ADD : ZEND_SUB,
&zero_node, &expr_node);
lefthand_node.op_type = IS_CONST;
ZVAL_LONG(&lefthand_node.u.constant, (ast->kind == ZEND_AST_UNARY_PLUS) ? 1 : -1);
zend_emit_op_tmp(result, ZEND_MUL, &lefthand_node, &expr_node);
}
/* }}} */
@@ -7374,12 +7384,15 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
case ZEND_AST_DIM:
{
/* constant expression should be always read context ... */
zval *container, *dim;
if (ast->child[1] == NULL) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
}
zend_eval_const_expr(&ast->child[0]);
zend_eval_const_expr(&ast->child[1]);
if (!ast->child[0] || !ast->child[1] || ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
return;
}
@@ -7462,10 +7475,13 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
if (zend_try_compile_const_expr_resolve_class_name(&result, class_ast, name_ast, 0)) {
if (Z_TYPE(result) == IS_NULL) {
if (zend_get_class_fetch_type(zend_ast_get_str(class_ast)) == ZEND_FETCH_CLASS_SELF) {
zend_ast_destroy(ast);
*ast_ptr = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C);
}
return;
} else {
break;
}
break;
}
zend_eval_const_expr(&class_ast);
+18 -9
View File
@@ -70,29 +70,38 @@ ZEND_API zend_class_entry *zend_get_exception_base(zval *object)
void zend_exception_set_previous(zend_object *exception, zend_object *add_previous)
{
zval tmp, *previous, zv, *pzv, rv;
zval *previous, *ancestor, *ex;
zval pv, zv, rv;
zend_class_entry *base_ce;
if (exception == add_previous || !add_previous || !exception) {
return;
}
ZVAL_OBJ(&tmp, add_previous);
if (!instanceof_function(Z_OBJCE(tmp), zend_ce_throwable)) {
ZVAL_OBJ(&pv, add_previous);
if (!instanceof_function(Z_OBJCE(pv), zend_ce_throwable)) {
zend_error_noreturn(E_CORE_ERROR, "Previous exception must implement Throwable");
return;
}
ZVAL_OBJ(&zv, exception);
pzv = &zv;
ex = &zv;
do {
base_ce = i_get_exception_base(pzv);
previous = zend_read_property(base_ce, pzv, "previous", sizeof("previous")-1, 1, &rv);
ancestor = zend_read_property(i_get_exception_base(&pv), &pv, "previous", sizeof("previous")-1, 1, &rv);
while (Z_TYPE_P(ancestor) == IS_OBJECT) {
if (Z_OBJ_P(ancestor) == Z_OBJ_P(ex)) {
OBJ_RELEASE(add_previous);
return;
}
ancestor = zend_read_property(i_get_exception_base(ancestor), ancestor, "previous", sizeof("previous")-1, 1, &rv);
}
base_ce = i_get_exception_base(ex);
previous = zend_read_property(base_ce, ex, "previous", sizeof("previous")-1, 1, &rv);
if (Z_TYPE_P(previous) == IS_NULL) {
zend_update_property(base_ce, pzv, "previous", sizeof("previous")-1, &tmp);
zend_update_property(base_ce, ex, "previous", sizeof("previous")-1, &pv);
GC_REFCOUNT(add_previous)--;
return;
}
pzv = previous;
} while (pzv && Z_OBJ_P(pzv) != add_previous);
ex = previous;
} while (Z_OBJ_P(ex) != add_previous);
}
void zend_exception_save(void) /* {{{ */
+18 -8
View File
@@ -893,7 +893,7 @@ static zend_always_inline int zend_verify_missing_arg_type(zend_function *zf, ui
return 1;
}
static ZEND_COLD int zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
static ZEND_COLD void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
{
if (EXPECTED(!(EX(func)->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) ||
UNEXPECTED(zend_verify_missing_arg_type(EX(func), arg_num, cache_slot))) {
@@ -907,9 +907,7 @@ static ZEND_COLD int zend_verify_missing_arg(zend_execute_data *execute_data, ui
} else {
zend_error(E_WARNING, "Missing argument %u for %s%s%s()", arg_num, class_name, space, func_name);
}
return 1;
}
return 0;
}
static ZEND_COLD void zend_verify_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)
@@ -1956,6 +1954,12 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
return;
}
} else if (EXPECTED(zobj->properties != NULL)) {
if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) {
if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) {
GC_REFCOUNT(zobj->properties)--;
}
zobj->properties = zend_array_dup(zobj->properties);
}
retval = zend_hash_find(zobj->properties, Z_STR_P(prop_ptr));
if (EXPECTED(retval)) {
ZVAL_INDIRECT(result, retval);
@@ -2420,9 +2424,8 @@ static zend_always_inline zend_generator *zend_get_running_generator(zend_execut
}
/* }}} */
static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) /* {{{ */
static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t op_num) /* {{{ */
{
int i;
if (UNEXPECTED(EX(call))) {
zend_execute_data *call = EX(call);
zend_op *opline = EX(func)->op_array.opcodes + op_num;
@@ -2545,6 +2548,12 @@ static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data
call = EX(call);
} while (call);
}
}
/* }}} */
static void cleanup_live_vars(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) /* {{{ */
{
int i;
for (i = 0; i < EX(func)->op_array.last_brk_cont; i++) {
const zend_brk_cont_element *brk_cont = &EX(func)->op_array.brk_cont_array[i];
@@ -2594,7 +2603,8 @@ static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data
/* }}} */
void zend_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) {
i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
cleanup_unfinished_calls(execute_data, op_num);
cleanup_live_vars(execute_data, op_num, catch_op_num);
}
#ifdef HAVE_GCC_GLOBAL_REGS
@@ -2736,9 +2746,9 @@ ZEND_API int ZEND_FASTCALL zend_check_arg_type(zend_function *zf, uint32_t arg_n
return zend_verify_arg_type(zf, arg_num, arg, default_value, cache_slot);
}
ZEND_API int ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
ZEND_API void ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
{
return zend_verify_missing_arg(execute_data, arg_num, cache_slot);
zend_verify_missing_arg(execute_data, arg_num, cache_slot);
}
/*
+1 -1
View File
@@ -52,7 +52,7 @@ ZEND_API int zend_eval_stringl_ex(char *str, size_t str_len, zval *retval_ptr, c
ZEND_API void ZEND_FASTCALL zend_check_internal_arg_type(zend_function *zf, uint32_t arg_num, zval *arg);
ZEND_API int ZEND_FASTCALL zend_check_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value, void **cache_slot);
ZEND_API int ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot);
ZEND_API void ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot);
static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type)
{
+11 -7
View File
@@ -218,9 +218,9 @@ static void zend_throw_or_error(int fetch_type, zend_class_entry *exception_ce,
zend_vspprintf(&message, 0, format, va);
if (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) {
zend_throw_error(exception_ce, message);
zend_throw_error(exception_ce, "%s", message);
} else {
zend_error(E_ERROR, message);
zend_error(E_ERROR, "%s", message);
}
efree(message);
@@ -397,6 +397,12 @@ void shutdown_executor(void) /* {{{ */
zend_shutdown_fpu();
#ifdef ZEND_DEBUG
if (EG(ht_iterators_used)) {
zend_error(E_WARNING, "Leaked %" PRIu32 " hashtable iterators", EG(ht_iterators_used));
}
#endif
EG(ht_iterators_used) = 0;
if (EG(ht_iterators) != EG(ht_iterators_slots)) {
efree(EG(ht_iterators));
@@ -937,7 +943,6 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
zend_class_entry *ce = NULL;
zval args[1];
zval local_retval;
int retval;
zend_string *lc_name;
zend_fcall_info fcall_info;
zend_fcall_info_cache fcall_cache;
@@ -1033,7 +1038,9 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
fcall_cache.object = NULL;
zend_exception_save();
retval = zend_call_function(&fcall_info, &fcall_cache);
if ((zend_call_function(&fcall_info, &fcall_cache) == SUCCESS) && !EG(exception)) {
ce = zend_hash_find_ptr(EG(class_table), lc_name);
}
zend_exception_restore();
zval_ptr_dtor(&args[0]);
@@ -1043,9 +1050,6 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
zval_ptr_dtor(&local_retval);
if (retval == SUCCESS) {
ce = zend_hash_find_ptr(EG(class_table), lc_name);
}
if (!key) {
zend_string_release(lc_name);
}
+8
View File
@@ -109,6 +109,14 @@ int zend_load_extension(const char *path)
/* See http://support.microsoft.com/kb/190351 */
#ifdef ZEND_WIN32
fflush(stderr);
#endif
DL_UNLOAD(handle);
return FAILURE;
} else if (zend_get_extension(new_extension->name)) {
fprintf(stderr, "Cannot load %s - extension already loaded\n", new_extension->name);
/* See http://support.microsoft.com/kb/190351 */
#ifdef PHP_WIN32
fflush(stderr);
#endif
DL_UNLOAD(handle);
return FAILURE;
+7
View File
@@ -242,6 +242,13 @@ ZEND_API void ZEND_FASTCALL gc_possible_root(zend_refcounted *ref)
GC_REFCOUNT(ref)++;
gc_collect_cycles();
GC_REFCOUNT(ref)--;
if (UNEXPECTED(GC_REFCOUNT(ref)) == 0) {
zval_dtor_func_for_ptr(ref);
return;
}
if (UNEXPECTED(GC_INFO(ref))) {
return;
}
newRoot = GC_G(unused);
if (!newRoot) {
#if ZEND_GC_DEBUG
+35 -25
View File
@@ -65,12 +65,6 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato
ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution) /* {{{ */
{
zval_ptr_dtor(&generator->value);
ZVAL_UNDEF(&generator->value);
zval_ptr_dtor(&generator->key);
ZVAL_UNDEF(&generator->key);
if (UNEXPECTED(Z_TYPE(generator->values) != IS_UNDEF)) {
zval_ptr_dtor(&generator->values);
ZVAL_UNDEF(&generator->values);
@@ -170,6 +164,10 @@ static void zend_generator_free_storage(zend_object *object) /* {{{ */
zend_generator_close(generator, 0);
/* we can't immediately free them in zend_generator_close() else yield from won't be able to fetch it */
zval_ptr_dtor(&generator->value);
zval_ptr_dtor(&generator->key);
if (EXPECTED(!Z_ISUNDEF(generator->retval))) {
zval_ptr_dtor(&generator->retval);
}
@@ -289,6 +287,12 @@ ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_
static void zend_generator_throw_exception(zend_generator *generator, zval *exception)
{
/* if we don't stop an array/iterator yield from, the exception will only reach the generator after the values were all iterated over */
if (UNEXPECTED(Z_TYPE(generator->values) != IS_UNDEF)) {
zval_ptr_dtor(&generator->values);
ZVAL_UNDEF(&generator->values);
}
/* Throw the exception in the context of the generator. Decrementing the opline
* to pretend the exception happened during the YIELD opcode. */
zend_execute_data *original_execute_data = EG(current_execute_data);
@@ -508,6 +512,7 @@ ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator
EG(current_execute_data) = original_execute_data;
} else {
ZVAL_COPY(&root->value, &root->node.parent->value);
ZVAL_COPY(ZEND_CALL_VAR(root->execute_data, yield_from->result.var), &root->node.parent->retval);
}
}
@@ -568,7 +573,7 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
if (iter->index++ > 0) {
iter->funcs->move_forward(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
goto failure;
goto exception;
}
}
@@ -578,7 +583,9 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
}
value = iter->funcs->get_current_data(iter);
if (UNEXPECTED(EG(exception) != NULL || !value)) {
if (UNEXPECTED(EG(exception) != NULL)) {
goto exception;
} else if (UNEXPECTED(!value)) {
goto failure;
}
@@ -590,7 +597,7 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
iter->funcs->get_current_key(iter, &generator->key);
if (UNEXPECTED(EG(exception) != NULL)) {
ZVAL_UNDEF(&generator->key);
goto failure;
goto exception;
}
} else {
ZVAL_LONG(&generator->key, iter->index);
@@ -598,6 +605,13 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
}
return SUCCESS;
exception: {
zend_execute_data *ex = EG(current_execute_data);
EG(current_execute_data) = generator->execute_data;
zend_throw_exception_internal(NULL);
EG(current_execute_data) = ex;
}
failure:
zval_ptr_dtor(&generator->values);
ZVAL_UNDEF(&generator->values);
@@ -622,6 +636,11 @@ try_again:
return;
}
if (UNEXPECTED((orig_generator->flags & ZEND_GENERATOR_DO_INIT) != 0 && !Z_ISUNDEF(generator->value))) {
/* We must not advance Generator if we yield from a Generator being currently run */
return;
}
if (UNEXPECTED(!Z_ISUNDEF(generator->values))) {
if (EXPECTED(zend_generator_get_next_delegated_value(generator) == SUCCESS)) {
return;
@@ -630,11 +649,6 @@ try_again:
* after the "yield from" expression. */
}
if (UNEXPECTED((orig_generator->flags & ZEND_GENERATOR_DO_INIT) != 0) && !Z_ISUNDEF(generator->value)) {
/* We must not advance Generator if we yield from a Generator being currently run */
return;
}
/* Drop the AT_FIRST_YIELD flag */
orig_generator->flags &= ~ZEND_GENERATOR_AT_FIRST_YIELD;
@@ -708,7 +722,7 @@ try_again:
static void inline zend_generator_ensure_initialized(zend_generator *generator) /* {{{ */
{
if (EXPECTED(generator->execute_data) && UNEXPECTED(Z_TYPE(generator->value) == IS_UNDEF) && EXPECTED(generator->node.parent == NULL)) {
if (UNEXPECTED(Z_TYPE(generator->value) == IS_UNDEF) && EXPECTED(generator->execute_data) && EXPECTED(generator->node.parent == NULL)) {
generator->flags |= ZEND_GENERATOR_DO_INIT;
zend_generator_resume(generator);
generator->flags &= ~ZEND_GENERATOR_DO_INIT;
@@ -759,7 +773,7 @@ ZEND_METHOD(Generator, valid)
zend_generator_get_current(generator);
RETURN_BOOL(EXPECTED(Z_TYPE(generator->value) != IS_UNDEF || generator->node.parent != NULL));
RETURN_BOOL(EXPECTED(generator->execute_data != NULL));
}
/* }}} */
@@ -778,7 +792,7 @@ ZEND_METHOD(Generator, current)
zend_generator_ensure_initialized(generator);
root = zend_generator_get_current(generator);
if (EXPECTED(Z_TYPE(root->value) != IS_UNDEF)) {
if (EXPECTED(generator->execute_data != NULL && Z_TYPE(root->value) != IS_UNDEF)) {
zval *value = &root->value;
ZVAL_DEREF(value);
@@ -802,7 +816,7 @@ ZEND_METHOD(Generator, key)
zend_generator_ensure_initialized(generator);
root = zend_generator_get_current(generator);
if (EXPECTED(Z_TYPE(root->key) != IS_UNDEF)) {
if (EXPECTED(generator->execute_data != NULL && Z_TYPE(root->key) != IS_UNDEF)) {
zval *key = &root->key;
ZVAL_DEREF(key);
@@ -865,7 +879,7 @@ ZEND_METHOD(Generator, send)
zend_generator_resume(generator);
root = zend_generator_get_current(generator);
if (EXPECTED(Z_TYPE(root->value) != IS_UNDEF)) {
if (EXPECTED(generator->execute_data)) {
zval *value = &root->value;
ZVAL_DEREF(value);
@@ -905,7 +919,7 @@ ZEND_METHOD(Generator, throw)
zend_generator_resume(generator);
root = zend_generator_get_current(generator);
if (Z_TYPE(root->value) != IS_UNDEF) {
if (generator->execute_data) {
zval *value = &root->value;
ZVAL_DEREF(value);
@@ -982,11 +996,7 @@ static int zend_generator_iterator_valid(zend_object_iterator *iterator) /* {{{
zend_generator_get_current(generator);
if (EXPECTED(Z_TYPE(generator->value) != IS_UNDEF || generator->node.parent != NULL)) {
return SUCCESS;
} else {
return FAILURE;
}
return generator->execute_data ? SUCCESS : FAILURE;
}
/* }}} */
+81 -21
View File
@@ -31,6 +31,8 @@
# define HT_ASSERT(c)
#endif
#define HT_POISONED_PTR ((HashTable *) (intptr_t) -1)
#if ZEND_DEBUG
/*
#define HASH_MASK_CONSISTENCY 0xc0
@@ -112,7 +114,7 @@ static uint32_t zend_always_inline zend_hash_check_size(uint32_t nSize)
rather than using an undefined bis scan result. */
return nSize;
}
#elif defined(__GNUC__) || __has_builtin(__builtin_clz)
#elif (defined(__GNUC__) || __has_builtin(__builtin_clz)) && defined(PHP_HAVE_BUILTIN_CLZ)
return 0x2 << (__builtin_clz(nSize - 1) ^ 0x1f);
#else
nSize -= 1;
@@ -283,6 +285,40 @@ ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, zend
}
}
static uint32_t zend_array_recalc_elements(HashTable *ht)
{
zval *val;
uint32_t num = ht->nNumOfElements;
ZEND_HASH_FOREACH_VAL(ht, val) {
if (Z_TYPE_P(val) == IS_UNDEF) continue;
if (Z_TYPE_P(val) == IS_INDIRECT) {
if (UNEXPECTED(Z_TYPE_P(Z_INDIRECT_P(val)) == IS_UNDEF)) {
num--;
}
}
} ZEND_HASH_FOREACH_END();
return num;
}
/* }}} */
ZEND_API uint32_t zend_array_count(HashTable *ht)
{
uint32_t num;
if (UNEXPECTED(ht->u.v.flags & HASH_FLAG_HAS_EMPTY_IND)) {
num = zend_array_recalc_elements(ht);
if (UNEXPECTED(ht->nNumOfElements == num)) {
ht->u.v.flags &= ~HASH_FLAG_HAS_EMPTY_IND;
}
} else if (UNEXPECTED(ht == &EG(symbol_table))) {
num = zend_array_recalc_elements(ht);
} else {
num = zend_hash_num_elements(ht);
}
return num;
}
/* }}} */
ZEND_API void ZEND_FASTCALL zend_hash_set_apply_protection(HashTable *ht, zend_bool bApplyProtection)
{
if (bApplyProtection) {
@@ -337,7 +373,8 @@ ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTab
if (iter->pos == HT_INVALID_IDX) {
return HT_INVALID_IDX;
} else if (UNEXPECTED(iter->ht != ht)) {
if (EXPECTED(iter->ht) && EXPECTED(iter->ht->u.v.nIteratorsCount != 255)) {
if (EXPECTED(iter->ht) && EXPECTED(iter->ht != HT_POISONED_PTR)
&& EXPECTED(iter->ht->u.v.nIteratorsCount != 255)) {
iter->ht->u.v.nIteratorsCount--;
}
if (EXPECTED(ht->u.v.nIteratorsCount != 255)) {
@@ -349,13 +386,38 @@ ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTab
return iter->pos;
}
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos_ex(uint32_t idx, zval *array)
{
HashTable *ht = Z_ARRVAL_P(array);
HashTableIterator *iter = EG(ht_iterators) + idx;
ZEND_ASSERT(idx != (uint32_t)-1);
if (iter->pos == HT_INVALID_IDX) {
return HT_INVALID_IDX;
} else if (UNEXPECTED(iter->ht != ht)) {
if (EXPECTED(iter->ht) && EXPECTED(iter->ht != HT_POISONED_PTR)
&& EXPECTED(iter->ht->u.v.nIteratorsCount != 255)) {
iter->ht->u.v.nIteratorsCount--;
}
SEPARATE_ARRAY(array);
ht = Z_ARRVAL_P(array);
if (EXPECTED(ht->u.v.nIteratorsCount != 255)) {
ht->u.v.nIteratorsCount++;
}
iter->ht = ht;
iter->pos = ht->nInternalPointer;
}
return iter->pos;
}
ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx)
{
HashTableIterator *iter = EG(ht_iterators) + idx;
ZEND_ASSERT(idx != (uint32_t)-1);
if (EXPECTED(iter->ht) && EXPECTED(iter->ht->u.v.nIteratorsCount != 255)) {
if (EXPECTED(iter->ht) && EXPECTED(iter->ht != HT_POISONED_PTR)
&& EXPECTED(iter->ht->u.v.nIteratorsCount != 255)) {
iter->ht->u.v.nIteratorsCount--;
}
iter->ht = NULL;
@@ -372,20 +434,13 @@ static zend_never_inline void ZEND_FASTCALL _zend_hash_iterators_remove(HashTabl
{
HashTableIterator *iter = EG(ht_iterators);
HashTableIterator *end = iter + EG(ht_iterators_used);
uint32_t idx;
while (iter != end) {
if (iter->ht == ht) {
iter->ht = NULL;
iter->ht = HT_POISONED_PTR;
}
iter++;
}
idx = EG(ht_iterators_used);
while (idx > 0 && EG(ht_iterators)[idx - 1].ht == NULL) {
idx--;
}
EG(ht_iterators_used) = idx;
}
static zend_always_inline void zend_hash_iterators_remove(HashTable *ht)
@@ -1049,9 +1104,14 @@ ZEND_API int ZEND_FASTCALL zend_hash_del_ind(HashTable *ht, zend_string *key)
return FAILURE;
} else {
if (ht->pDestructor) {
ht->pDestructor(data);
zval tmp;
ZVAL_COPY_VALUE(&tmp, data);
ZVAL_UNDEF(data);
ht->pDestructor(&tmp);
} else {
ZVAL_UNDEF(data);
}
ZVAL_UNDEF(data);
ht->u.v.flags |= HASH_FLAG_HAS_EMPTY_IND;
}
} else {
_zend_hash_del_el_ex(ht, idx, p, prev);
@@ -1095,6 +1155,7 @@ ZEND_API int ZEND_FASTCALL zend_hash_str_del_ind(HashTable *ht, const char *str,
ht->pDestructor(data);
}
ZVAL_UNDEF(data);
ht->u.v.flags |= HASH_FLAG_HAS_EMPTY_IND;
}
} else {
_zend_hash_del_el_ex(ht, idx, p, prev);
@@ -1454,8 +1515,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_fu
HT_ASSERT(GC_REFCOUNT(ht) == 1);
HASH_PROTECT_RECURSION(ht);
p = ht->arData;
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
for (idx = 0; idx < ht->nNumUsed; idx++) {
p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
result = apply_func(&p->val);
@@ -1480,8 +1541,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_f
HT_ASSERT(GC_REFCOUNT(ht) == 1);
HASH_PROTECT_RECURSION(ht);
p = ht->arData;
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
for (idx = 0; idx < ht->nNumUsed; idx++) {
p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
result = apply_func(&p->val, argument);
@@ -1509,8 +1570,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_arguments(HashTable *ht, apply_
HASH_PROTECT_RECURSION(ht);
p = ht->arData;
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
for (idx = 0; idx < ht->nNumUsed; idx++) {
p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
va_start(args, num_args);
hash_key.h = p->h;
@@ -1543,10 +1604,9 @@ ZEND_API void ZEND_FASTCALL zend_hash_reverse_apply(HashTable *ht, apply_func_t
HASH_PROTECT_RECURSION(ht);
idx = ht->nNumUsed;
p = ht->arData + idx;
while (idx > 0) {
idx--;
p--;
p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
result = apply_func(&p->val);
+2
View File
@@ -216,6 +216,7 @@ ZEND_API zval* ZEND_FASTCALL zend_hash_minmax(const HashTable *ht, compare_func_
ZEND_API int ZEND_FASTCALL zend_hash_rehash(HashTable *ht);
ZEND_API uint32_t zend_array_count(HashTable *ht);
ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source);
ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_symtable_clean(HashTable *ht);
@@ -224,6 +225,7 @@ ZEND_API int ZEND_FASTCALL _zend_handle_numeric_str_ex(const char *key, size_t l
ZEND_API uint32_t ZEND_FASTCALL zend_hash_iterator_add(HashTable *ht, HashPosition pos);
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTable *ht);
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos_ex(uint32_t idx, zval *array);
ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx);
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterators_lower_pos(HashTable *ht, HashPosition start);
ZEND_API void ZEND_FASTCALL _zend_hash_iterators_update(HashTable *ht, HashPosition from, HashPosition to);
+4
View File
@@ -25,6 +25,7 @@
#include "zend_highlight.h"
#include "zend_ptr_stack.h"
#include "zend_globals.h"
#include "zend_exceptions.h"
ZEND_API void zend_html_putc(char c)
{
@@ -168,6 +169,9 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
}
zend_printf("</span>\n");
zend_printf("</code>");
/* Discard parse errors thrown during tokenization */
zend_clear_exception();
}
ZEND_API void zend_strip(void)
+7 -4
View File
@@ -106,16 +106,19 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
if (Z_TYPE_P(op1) != IS_STRING) {
zend_string *str = zval_get_string(op1);
ZVAL_PSTRINGL(op1, str->val, str->len);
/* ZEND_ASSERT(!Z_REFCOUNTED_P(op1)); */
ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str));
zend_string_release(str);
}
op1_len = (int)Z_STRLEN_P(op1);
if (Z_TYPE_P(op2) != IS_STRING) {
convert_to_string(op2);
}
length = op1_len + (int)Z_STRLEN_P(op2);
ZVAL_NEW_STR(result, zend_string_extend(Z_STR_P(op1), length, 1));
memcpy(Z_STRVAL_P(result)+op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2));
Z_STRVAL_P(result)[length] = 0;
memcpy(Z_STRVAL_P(result) + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2) + 1);
}
/* }}} */
+2 -2
View File
@@ -114,7 +114,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
/* Eat leading whitespace */
#define EAT_LEADING_WHITESPACE() \
while (yytext[0]) { \
while (yyleng) { \
if (yytext[0] == ' ' || yytext[0] == '\t') { \
SCNG(yy_text)++; \
yyleng--; \
@@ -125,7 +125,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
/* Eat trailing whitespace + extra char */
#define EAT_TRAILING_WHITESPACE_EX(ch) \
while (yyleng > 0 && ( \
while (yyleng && ( \
(ch != 'X' && yytext[yyleng - 1] == ch) || \
yytext[yyleng - 1] == '\n' || \
yytext[yyleng - 1] == '\r' || \
+2 -2
View File
@@ -112,7 +112,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
/* Eat leading whitespace */
#define EAT_LEADING_WHITESPACE() \
while (yytext[0]) { \
while (yyleng) { \
if (yytext[0] == ' ' || yytext[0] == '\t') { \
SCNG(yy_text)++; \
yyleng--; \
@@ -123,7 +123,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
/* Eat trailing whitespace + extra char */
#define EAT_TRAILING_WHITESPACE_EX(ch) \
while (yyleng > 0 && ( \
while (yyleng && ( \
(ch != 'X' && yytext[yyleng - 1] == ch) || \
yytext[yyleng - 1] == '\n' || \
yytext[yyleng - 1] == '\r' || \
+44 -28
View File
@@ -1278,50 +1278,66 @@ isset_variable:
would have been. */
static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
{
if (!yyres) {
return yystrlen(yystr);
/* CG(parse_error) states:
* 0 => yyres = NULL, yystr is the unexpected token
* 1 => yyres = NULL, yystr is one of the expected tokens
* 2 => yyres != NULL, yystr is the unexpected token
* 3 => yyres != NULL, yystr is one of the expected tokens
*/
if (yyres && CG(parse_error) < 2) {
CG(parse_error) = 2;
}
{
if (CG(parse_error) == 0) {
char buffer[120];
const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
unsigned int len = 0, toklen = 0, yystr_len;
CG(parse_error) = 1;
if (CG(parse_error) % 2 == 0) {
/* The unexpected token */
char buffer[120];
const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
unsigned int len = 0, toklen = 0, yystr_len;
if (LANG_SCNG(yy_text)[0] == 0 &&
LANG_SCNG(yy_leng) == 1 &&
memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
CG(parse_error)++;
if (LANG_SCNG(yy_text)[0] == 0 &&
LANG_SCNG(yy_leng) == 1 &&
memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
if (yyres) {
yystpcpy(yyres, "end of file");
return sizeof("end of file")-1;
}
return sizeof("end of file")-1;
}
str = LANG_SCNG(yy_text);
end = memchr(str, '\n', LANG_SCNG(yy_leng));
yystr_len = (unsigned int)yystrlen(yystr);
str = LANG_SCNG(yy_text);
end = memchr(str, '\n', LANG_SCNG(yy_leng));
yystr_len = (unsigned int)yystrlen(yystr);
if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
&& (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
toklen = (tok2 - tok1) + 1;
} else {
tok1 = tok2 = NULL;
toklen = 0;
}
if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
&& (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
toklen = (tok2 - tok1) + 1;
} else {
tok1 = tok2 = NULL;
toklen = 0;
}
if (end == NULL) {
len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
} else {
len = (end - str) > 30 ? 30 : (end - str);
}
if (end == NULL) {
len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
} else {
len = (end - str) > 30 ? 30 : (end - str);
}
if (yyres) {
if (toklen) {
snprintf(buffer, sizeof(buffer), "'%.*s' %.*s", len, str, toklen, tok1);
} else {
snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
}
yystpcpy(yyres, buffer);
return len + (toklen ? toklen + 1 : 0) + 2;
}
return len + (toklen ? toklen + 1 : 0) + 2;
}
/* One of the expected tokens */
if (!yyres) {
return yystrlen(yystr) - (*yystr == '"' ? 2 : 0);
}
if (*yystr == '"') {
YYSIZE_T yyn = 0;
const char *yyp = yystr;
+1 -1
View File
@@ -84,7 +84,7 @@ static void zend_resource_dtor(zend_resource *res)
ZEND_API int zend_list_close(zend_resource *res)
{
if (GC_REFCOUNT(res) <= 0) {
return zend_list_delete(res);
return zend_list_free(res);
} else if (res->type >= 0) {
zend_resource_dtor(res);
}
+12 -3
View File
@@ -275,10 +275,10 @@ static zend_always_inline int zend_verify_property_access(zend_property_info *pr
return 1;
} else if (property_info->flags & ZEND_ACC_PRIVATE) {
return (ce == EG(scope) || property_info->ce == EG(scope));
} else {
ZEND_ASSERT(property_info->flags & ZEND_ACC_PROTECTED);
} else if (property_info->flags & ZEND_ACC_PROTECTED) {
return zend_check_protected(property_info->ce, EG(scope));
}
return 0;
}
/* }}} */
@@ -1526,9 +1526,18 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
if (ce->__tostring &&
(zend_call_method_with_0_params(readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(exception))) {
if (UNEXPECTED(EG(exception) != NULL)) {
zval *msg, ex, rv;
zval_ptr_dtor(&retval);
ZVAL_OBJ(&ex, EG(exception));
EG(exception) = NULL;
zend_error_noreturn(E_ERROR, "Method %s::__toString() must not throw an exception", ZSTR_VAL(ce->name));
msg = zend_read_property(Z_OBJCE(ex), &ex, "message", sizeof("message") - 1, 1, &rv);
if (UNEXPECTED(Z_TYPE_P(msg) != IS_STRING)) {
ZVAL_EMPTY_STRING(&rv);
msg = &rv;
}
zend_error_noreturn(E_ERROR,
"Method %s::__toString() must not throw an exception, caught %s: %s",
ZSTR_VAL(ce->name), ZSTR_VAL(Z_OBJCE(ex)->name), Z_STRVAL_P(msg));
return FAILURE;
}
if (EXPECTED(Z_TYPE(retval) == IS_STRING)) {
+2 -2
View File
@@ -2277,7 +2277,7 @@ try_again:
zval *val;
val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv);
Z_ADDREF_P(val);
Z_TRY_ADDREF_P(val);
increment_function(val);
Z_OBJ_HANDLER_P(op1, set)(op1, val);
zval_ptr_dtor(val);
@@ -2345,7 +2345,7 @@ try_again:
zval *val;
val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv);
Z_ADDREF_P(val);
Z_TRY_ADDREF_P(val);
decrement_function(val);
Z_OBJ_HANDLER_P(op1, set)(op1, val);
zval_ptr_dtor(val);
+1 -1
View File
@@ -757,7 +757,7 @@ static zend_always_inline int fast_is_not_identical_function(zval *op1, zval *op
int ret; \
zval rv; \
zval *objval = Z_OBJ_HANDLER_P(op1, get)(op1, &rv); \
Z_ADDREF_P(objval); \
Z_TRY_ADDREF_P(objval); \
ret = binary_op(objval, objval, op2); \
Z_OBJ_HANDLER_P(op1, set)(op1, objval); \
zval_ptr_dtor(objval); \
+17
View File
@@ -459,6 +459,9 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
}
}
#else
#ifdef ZEND_WIN32
ZeroMemory(&cwd, sizeof(cwd));
#endif
result = getcwd(cwd, sizeof(cwd));
#endif
if (!result) {
@@ -1563,6 +1566,20 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode) /* {{{ */
return -1;
}
#ifdef ZEND_WIN32
{
mode_t _tmp = mode;
mode = 0;
if (_tmp & _S_IREAD) {
mode |= _S_IREAD;
}
if (_tmp & _S_IWRITE) {
mode |= _S_IWRITE;
}
}
#endif
ret = chmod(new_state.cwd, mode);
CWD_STATE_FREE_ERR(&new_state);
+38 -35
View File
@@ -328,12 +328,9 @@ ZEND_VM_HANDLER(15, ZEND_IS_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
result = fast_is_identical_function(op1, op2);
FREE_OP1();
FREE_OP2();
ZEND_VM_SMART_BRANCH(result, (OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
@@ -349,12 +346,9 @@ ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
result = fast_is_not_identical_function(op1, op2);
FREE_OP1();
FREE_OP2();
ZEND_VM_SMART_BRANCH(result, (OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_HANDLER(17, ZEND_IS_EQUAL, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
@@ -1543,6 +1537,9 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
}
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(EG(exception))) {
if (OP1_TYPE != IS_CONST) {
zend_string_release(name);
}
FREE_OP1();
HANDLE_EXCEPTION();
}
@@ -2386,7 +2383,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
if (UNEXPECTED(EG(exception) != NULL)) {
const zend_op *old_opline = EX(opline);
zend_throw_exception_internal(NULL);
if (RETURN_VALUE_USED(old_opline)) {
if (old_opline->opcode != ZEND_HANDLE_EXCEPTION && RETURN_VALUE_USED(old_opline)) {
zval_ptr_dtor(EX_VAR(old_opline->result.var));
}
HANDLE_EXCEPTION_LEAVE();
@@ -3108,8 +3105,8 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -4714,9 +4711,8 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
SAVE_OPLINE();
if (UNEXPECTED(!zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num)))) {
HANDLE_EXCEPTION();
}
zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
@@ -5520,8 +5516,14 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR)
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -5852,8 +5854,9 @@ ZEND_VM_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, ANY)
Z_ADDREF_P(array_ref);
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref);
} else {
array_ptr = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(array_ptr, array_ref);
array_ref = EX_VAR(opline->result.var);
ZVAL_NEW_REF(array_ref, array_ptr);
array_ptr = Z_REFVAL_P(array_ref);
}
if (OP1_TYPE == IS_CONST) {
zval_copy_ctor_func(array_ptr);
@@ -6179,8 +6182,8 @@ ZEND_VM_HANDLER(126, ZEND_FE_FETCH_RW, VAR, ANY)
ZVAL_DEREF(array);
if (EXPECTED(Z_TYPE_P(array) == IS_ARRAY)) {
pos = zend_hash_iterator_pos_ex(Z_FE_ITER_P(EX_VAR(opline->op1.var)), array);
fe_ht = Z_ARRVAL_P(array);
pos = zend_hash_iterator_pos(Z_FE_ITER_P(EX_VAR(opline->op1.var)), fe_ht);
p = fe_ht->arData + pos;
while (1) {
if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {
@@ -7125,11 +7128,12 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
}
}
i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
cleanup_unfinished_calls(execute_data, op_num);
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
cleanup_live_vars(execute_data, op_num, finally_op_num);
if (in_finally && Z_OBJ_P(fast_call)) {
zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
}
@@ -7139,6 +7143,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[finally_op_num]);
ZEND_VM_CONTINUE();
} else {
cleanup_live_vars(execute_data, op_num, catch_op_num);
if (in_finally) {
/* we are going out of current finally scope */
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
@@ -7177,14 +7182,10 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
SAVE_OPLINE();
ret = zend_user_opcode_handlers[opline->opcode](execute_data);
if (EG(exception)) {
HANDLE_EXCEPTION();
}
opline = EX(opline);
switch (ret) {
case ZEND_USER_OPCODE_CONTINUE:
LOAD_OPLINE();
ZEND_VM_CONTINUE();
case ZEND_USER_OPCODE_RETURN:
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
@@ -7197,13 +7198,10 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
case ZEND_USER_OPCODE_ENTER:
ZEND_VM_ENTER();
case ZEND_USER_OPCODE_LEAVE:
LOAD_OPLINE();
ZEND_VM_LEAVE();
case ZEND_USER_OPCODE_DISPATCH:
ZEND_ASSERT(EX(opline) == opline);
ZEND_VM_DISPATCH(opline->opcode, opline);
default:
ZEND_ASSERT(EX(opline) == opline);
ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
}
}
@@ -7565,20 +7563,25 @@ ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, ANY)
USE_OPLINE
if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) {
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
} else {
EG(exception) = Z_OBJ_P(fast_call);
Z_OBJ_P(fast_call) = NULL;
if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, 0);
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
}
}
}
}
+209 -221
View File
@@ -501,7 +501,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
if (UNEXPECTED(EG(exception) != NULL)) {
const zend_op *old_opline = EX(opline);
zend_throw_exception_internal(NULL);
if (RETURN_VALUE_USED(old_opline)) {
if (old_opline->opcode != ZEND_HANDLE_EXCEPTION && RETURN_VALUE_USED(old_opline)) {
zval_ptr_dtor(EX_VAR(old_opline->result.var));
}
HANDLE_EXCEPTION_LEAVE();
@@ -1204,9 +1204,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
SAVE_OPLINE();
if (UNEXPECTED(!zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num)))) {
HANDLE_EXCEPTION();
}
zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
@@ -1515,11 +1514,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(
}
}
i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
cleanup_unfinished_calls(execute_data, op_num);
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
cleanup_live_vars(execute_data, op_num, finally_op_num);
if (in_finally && Z_OBJ_P(fast_call)) {
zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
}
@@ -1529,6 +1529,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[finally_op_num]);
ZEND_VM_CONTINUE();
} else {
cleanup_live_vars(execute_data, op_num, catch_op_num);
if (in_finally) {
/* we are going out of current finally scope */
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
@@ -1567,14 +1568,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_
SAVE_OPLINE();
ret = zend_user_opcode_handlers[opline->opcode](execute_data);
if (EG(exception)) {
HANDLE_EXCEPTION();
}
opline = EX(opline);
switch (ret) {
case ZEND_USER_OPCODE_CONTINUE:
LOAD_OPLINE();
ZEND_VM_CONTINUE();
case ZEND_USER_OPCODE_RETURN:
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
@@ -1587,13 +1584,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_
case ZEND_USER_OPCODE_ENTER:
ZEND_VM_ENTER();
case ZEND_USER_OPCODE_LEAVE:
LOAD_OPLINE();
ZEND_VM_LEAVE();
case ZEND_USER_OPCODE_DISPATCH:
ZEND_ASSERT(EX(opline) == opline);
ZEND_VM_DISPATCH(opline->opcode, opline);
default:
ZEND_ASSERT(EX(opline) == opline);
ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
}
}
@@ -1647,20 +1641,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPC
USE_OPLINE
if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) {
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
} else {
EG(exception) = Z_OBJ_P(fast_call);
Z_OBJ_P(fast_call) = NULL;
if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, 0);
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
}
}
}
@@ -3834,8 +3833,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CONST_HANDLER
Z_ADDREF_P(array_ref);
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref);
} else {
array_ptr = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(array_ptr, array_ref);
array_ref = EX_VAR(opline->result.var);
ZVAL_NEW_REF(array_ref, array_ptr);
array_ptr = Z_REFVAL_P(array_ref);
}
if (IS_CONST == IS_CONST) {
zval_copy_ctor_func(array_ptr);
@@ -4596,12 +4596,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CONST_
result = fast_is_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -4617,12 +4614,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CO
result = fast_is_not_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -5003,6 +4997,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
}
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(EG(exception))) {
if (IS_CONST != IS_CONST) {
zend_string_release(name);
}
HANDLE_EXCEPTION();
}
@@ -5699,8 +5696,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -6119,8 +6116,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HAN
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -6646,12 +6649,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HA
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6667,12 +6667,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TM
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6829,12 +6826,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HA
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6850,12 +6844,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VA
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type ZEND_OPCODE_HANDLER_ARGS_DC)
@@ -6925,6 +6916,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
}
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(EG(exception))) {
if (IS_CONST != IS_CONST) {
zend_string_release(name);
}
HANDLE_EXCEPTION();
}
@@ -7060,8 +7054,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDL
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -7422,6 +7422,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
}
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(EG(exception))) {
if (IS_CONST != IS_CONST) {
zend_string_release(name);
}
HANDLE_EXCEPTION();
}
@@ -7674,8 +7677,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -7920,8 +7923,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HA
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -8540,12 +8549,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CV_HAN
result = fast_is_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8561,12 +8567,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV
result = fast_is_not_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -9417,8 +9420,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -11225,8 +11228,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -12180,8 +12183,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z
Z_ADDREF_P(array_ref);
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref);
} else {
array_ptr = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(array_ptr, array_ref);
array_ref = EX_VAR(opline->result.var);
ZVAL_NEW_REF(array_ref, array_ptr);
array_ptr = Z_REFVAL_P(array_ref);
}
if (IS_TMP_VAR == IS_CONST) {
zval_copy_ctor_func(array_ptr);
@@ -12573,12 +12577,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HA
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -12594,12 +12595,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONS
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13128,12 +13126,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HAND
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13149,12 +13144,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13311,12 +13303,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HAND
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13332,12 +13321,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13864,12 +13850,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDL
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13885,12 +13868,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_H
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -15649,8 +15629,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z
Z_ADDREF_P(array_ref);
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref);
} else {
array_ptr = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(array_ptr, array_ref);
array_ref = EX_VAR(opline->result.var);
ZVAL_NEW_REF(array_ref, array_ptr);
array_ptr = Z_REFVAL_P(array_ref);
}
if (IS_VAR == IS_CONST) {
zval_copy_ctor_func(array_ptr);
@@ -15976,8 +15957,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_FETCH_RW_SPEC_VAR_HANDLER(Z
ZVAL_DEREF(array);
if (EXPECTED(Z_TYPE_P(array) == IS_ARRAY)) {
pos = zend_hash_iterator_pos_ex(Z_FE_ITER_P(EX_VAR(opline->op1.var)), array);
fe_ht = Z_ARRVAL_P(array);
pos = zend_hash_iterator_pos(Z_FE_ITER_P(EX_VAR(opline->op1.var)), fe_ht);
p = fe_ht->arData + pos;
while (1) {
if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {
@@ -16414,12 +16395,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HA
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -16435,12 +16413,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONS
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op_type binary_op ZEND_OPCODE_HANDLER_ARGS_DC)
@@ -17584,8 +17559,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -18156,12 +18131,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HAND
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -18177,12 +18149,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -18368,12 +18337,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HAND
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -18389,12 +18355,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -19224,8 +19187,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -19622,12 +19585,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDL
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -19643,12 +19603,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_H
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op_type binary_op ZEND_OPCODE_HANDLER_ARGS_DC)
@@ -20851,8 +20808,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -22421,8 +22378,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -29358,8 +29315,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE
Z_ADDREF_P(array_ref);
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref);
} else {
array_ptr = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(array_ptr, array_ref);
array_ref = EX_VAR(opline->result.var);
ZVAL_NEW_REF(array_ref, array_ptr);
array_ptr = Z_REFVAL_P(array_ref);
}
if (IS_CV == IS_CONST) {
zval_copy_ctor_func(array_ptr);
@@ -30100,12 +30058,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CONST_HAN
result = fast_is_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -30121,12 +30076,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST
result = fast_is_not_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -31074,6 +31026,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
}
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(EG(exception))) {
if (IS_CV != IS_CONST) {
zend_string_release(name);
}
HANDLE_EXCEPTION();
}
@@ -32214,8 +32169,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLE
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -32981,12 +32942,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDL
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -33002,12 +32960,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_H
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -33192,12 +33147,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDL
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -33213,12 +33165,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_H
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type ZEND_OPCODE_HANDLER_ARGS_DC)
@@ -33288,6 +33237,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
}
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(EG(exception))) {
if (IS_CV != IS_CONST) {
zend_string_release(name);
}
HANDLE_EXCEPTION();
}
@@ -33510,8 +33462,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -34226,6 +34184,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
}
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(EG(exception))) {
if (IS_CV != IS_CONST) {
zend_string_release(name);
}
HANDLE_EXCEPTION();
}
@@ -34740,8 +34701,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDL
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -35338,12 +35305,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLE
result = fast_is_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -35359,12 +35323,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HA
result = fast_is_not_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -41418,6 +41379,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
}
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(EG(exception))) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
}
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
@@ -41951,8 +41915,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_CONST_HA
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -42400,6 +42370,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
}
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(EG(exception))) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
}
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
@@ -42536,8 +42509,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_VAR_HAND
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -42802,6 +42781,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
}
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(EG(exception))) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
}
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
@@ -42938,8 +42920,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_H
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
+54
View File
@@ -3050,3 +3050,57 @@ AC_DEFUN([PHP_CHECK_BUILTIN_EXPECT], [
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_EXPECT], [$have_builtin_expect], [Whether the compiler supports __builtin_expect])
])
dnl PHP_CHECK_BUILTIN_CLZ
AC_DEFUN([PHP_CHECK_BUILTIN_CLZ], [
AC_MSG_CHECKING([for __builtin_clz])
AC_TRY_LINK(, [
return __builtin_clz(1) ? 1 : 0;
], [
have_builtin_clz=1
AC_MSG_RESULT([yes])
], [
have_builtin_clz=0
AC_MSG_RESULT([no])
])
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CLZ], [$have_builtin_clz], [Whether the compiler supports __builtin_clz])
])
dnl PHP_CHECK_BUILTIN_CTZL
AC_DEFUN([PHP_CHECK_BUILTIN_CTZL], [
AC_MSG_CHECKING([for __builtin_ctzl])
AC_TRY_LINK(, [
return __builtin_ctzl(2L) ? 1 : 0;
], [
have_builtin_ctzl=1
AC_MSG_RESULT([yes])
], [
have_builtin_ctzl=0
AC_MSG_RESULT([no])
])
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZL], [$have_builtin_ctzl], [Whether the compiler supports __builtin_ctzl])
])
dnl PHP_CHECK_BUILTIN_CTZLL
AC_DEFUN([PHP_CHECK_BUILTIN_CTZLL], [
AC_MSG_CHECKING([for __builtin_ctzll])
AC_TRY_LINK(, [
return __builtin_ctzll(2LL) ? 1 : 0;
], [
have_builtin_ctzll=1
AC_MSG_RESULT([yes])
], [
have_builtin_ctzll=0
AC_MSG_RESULT([no])
])
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZLL], [$have_builtin_ctzll], [Whether the compiler supports __builtin_ctzll])
])
+4 -2
View File
@@ -4,7 +4,9 @@
dir=$1; shift
for stubfile in $dir/*/config0.m4 $dir/*/config.m4 $dir/*/config9.m4; do
echo "config_m4_src=$stubfile
config_m4_dir=`dirname $stubfile`
echo "dnl Define where extension directories are located in the configure context
AC_DEFUN([PHP_EXT_BUILDDIR], [`dirname $stubfile`])
AC_DEFUN([PHP_EXT_DIR], [`dirname $stubfile`])
AC_DEFUN([PHP_EXT_SRCDIR], [\$abs_srcdir/`dirname $stubfile`])
sinclude($stubfile)"
done
+8 -2
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=2
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
@@ -577,6 +577,12 @@ PHP_CHECK_STDINT_TYPES
dnl Check __builtin_expect
PHP_CHECK_BUILTIN_EXPECT
dnl Check __builtin_clz
PHP_CHECK_BUILTIN_CLZ
dnl Check __builtin_ctzl
PHP_CHECK_BUILTIN_CTZL
dnl Check __builtin_ctzll
PHP_CHECK_BUILTIN_CTZLL
dnl Check for members of the stat structure
AC_STRUCT_ST_BLKSIZE
+1 -1
View File
@@ -810,7 +810,7 @@ PHP_FUNCTION(com_message_pump)
}
/* }}} */
/* {{{ proto bool com_load_typelib(string typelib_name [, int case_insensitive])
/* {{{ proto bool com_load_typelib(string typelib_name [, bool case_insensitive])
Loads a Typelibrary and registers its constants */
PHP_FUNCTION(com_load_typelib)
{
+8
View File
@@ -1851,7 +1851,9 @@ static void _php_curl_set_default_options(php_curl *ch)
curl_easy_setopt(ch->cp, CURLOPT_INFILE, (void *) ch);
curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_header);
curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch);
#if !defined(ZTS)
curl_easy_setopt(ch->cp, CURLOPT_DNS_USE_GLOBAL_CACHE, 1);
#endif
curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120);
curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */
@@ -2183,6 +2185,12 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
return 1;
}
#endif
# if defined(ZTS)
if (option == CURLOPT_DNS_USE_GLOBAL_CACHE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled");
return 1;
}
# endif
error = curl_easy_setopt(ch->cp, option, lval);
break;
case CURLOPT_SAFE_UPLOAD:
+2
View File
@@ -9,6 +9,8 @@ if (!extension_loaded('curl')) exit("skip curl extension not loaded");
$curl = curl_init("http://www.google.com");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_PRIVATE, "123");
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, 1);
curl_exec($curl);
var_dump(curl_getinfo($curl, CURLINFO_PRIVATE));
+1 -1
View File
@@ -2,7 +2,7 @@
Test curl_opt() function with POST params from array with a numeric key
--SKIPIF--
<?php
include 'skipinf.inc';
include 'skipif.inc';
?>
--FILE--
<?php
+3 -1
View File
@@ -15,7 +15,9 @@ var_dump(curl_setopt_array($c, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_UPLOAD => true,
CURLOPT_INFILE => $f,
CURLOPT_INFILESIZE => filesize(__FILE__)
CURLOPT_INFILESIZE => filesize(__FILE__),
CURLOPT_CONNECTTIMEOUT => 1,
CURLOPT_TIMEOUT => 1,
]));
fclose($f);
var_dump(curl_setopt_array($c, [
+3 -1
View File
@@ -17,7 +17,9 @@ curl_setopt_array($ch, array(
CURLOPT_HTTPHEADER => array(
'Content-Length: 1',
),
CURLOPT_READFUNCTION => 'curl_read'
CURLOPT_READFUNCTION => 'curl_read',
CURLOPT_CONNECTTIMEOUT=> 1,
CURLOPT_TIMEOUT=>1
));
function curl_read($ch, $fp, $len) {
+3 -1
View File
@@ -18,7 +18,9 @@ curl_setopt_array($ch, array(
CURLOPT_HTTPHEADER => array(
'Content-Length: 1',
),
CURLOPT_READFUNCTION => 'curl_read'
CURLOPT_READFUNCTION => 'curl_read',
CURLOPT_CONNECTTIMEOUT => 1,
CURLOPT_TIMEOUT => 1
));
function curl_read($ch, $fp, $len) {
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Bug #71144 (Sementation fault when using cURL with ZTS)
--SKIPIF--
<?php include 'skipif.inc'; ?>
<?php if (!PHP_ZTS) { print "skip only for zts build"; } ?>
--FILE--
<?php
$ch = curl_init();
var_dump(curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, 1));
?>
--EXPECTF--
Warning: curl_setopt(): CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled in %sbug71144.php on line %d
bool(false)
+2 -2
View File
@@ -3579,9 +3579,9 @@ PHP_FUNCTION(date_diff)
zval *object1, *object2;
php_date_obj *dateobj1, *dateobj2;
php_interval_obj *interval;
zend_long absolute = 0;
zend_bool absolute = 0;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|l", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|b", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
RETURN_FALSE;
}
dateobj1 = Z_PHPDATE_P(object1);
+5 -1
View File
@@ -320,6 +320,10 @@ if test "$PHP_DB4" != "no"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/db4/db.h
break
elif test -f "$i/include/db5.3/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db5.3/db.h
break
elif test -f "$i/include/db5.1/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db5.1/db.h
@@ -362,7 +366,7 @@ if test "$PHP_DB4" != "no"; then
break
fi
done
PHP_DBA_DB_CHECK(4, db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
PHP_DBA_DB_CHECK(4, db-5.3 db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
fi
PHP_DBA_STD_RESULT(db4,Berkeley DB4)
+13 -6
View File
@@ -209,7 +209,7 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
if (zend_hash_num_elements(Z_ARRVAL_P(key)) != 2) {
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Key does not have exactly two elements: (key, name)");
return -1;
return 0;
}
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(key), &pos);
group = zend_hash_get_current_data_ex(Z_ARRVAL_P(key), &pos);
@@ -232,9 +232,10 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
ZVAL_COPY(&tmp, key);
convert_to_string(&tmp);
*key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
len = Z_STRLEN(tmp);
if (len) {
*key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
}
zval_ptr_dtor(&tmp);
return len;
}
@@ -281,8 +282,14 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
RETURN_FALSE; \
}
#define DBA_ID_GET2 DBA_ID_PARS; DBA_GET2; DBA_FETCH_RESOURCE(info, id)
#define DBA_ID_GET2_3 DBA_ID_PARS; DBA_GET2_3; DBA_FETCH_RESOURCE(info, id)
#define DBA_FETCH_RESOURCE_WITH_ID(info, id) \
if ((info = (dba_info *)zend_fetch_resource2(Z_RES_P(id), "DBA identifier", le_db, le_pdb)) == NULL) { \
DBA_ID_DONE; \
RETURN_FALSE; \
}
#define DBA_ID_GET2 DBA_ID_PARS; DBA_GET2; DBA_FETCH_RESOURCE_WITH_ID(info, id)
#define DBA_ID_GET2_3 DBA_ID_PARS; DBA_GET2_3; DBA_FETCH_RESOURCE_WITH_ID(info, id)
#define DBA_ID_DONE \
if (key_free) efree(key_free)
@@ -578,7 +585,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
RETURN_FALSE;
}
DBA_FETCH_RESOURCE(info, id);
DBA_FETCH_RESOURCE_WITH_ID(info, id);
DBA_WRITE_CHECK_WITH_ID;
+2 -2
View File
@@ -1348,9 +1348,9 @@ PHP_FUNCTION(dom_node_clone_node)
xmlNode *n, *node;
int ret;
dom_object *intern;
zend_long recursive = 0;
zend_bool recursive = 0;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &id, dom_node_class_entry, &recursive) == FAILURE) {
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|b", &id, dom_node_class_entry, &recursive) == FAILURE) {
return;
}
+1 -1
View File
@@ -546,7 +546,7 @@ static zval *php_filter_get_storage(zend_long arg)/* {{{ */
if (PG(auto_globals_jit)) {
zend_is_auto_global_str(ZEND_STRL("_ENV"));
}
array_ptr = &IF_G(env_array) ? &IF_G(env_array) : &PG(http_globals)[TRACK_VARS_ENV];
array_ptr = !Z_ISUNDEF(IF_G(env_array)) ? &IF_G(env_array) : &PG(http_globals)[TRACK_VARS_ENV];
break;
case PARSE_SESSION:
/* FIXME: Implement session source */
Loaded 100 of 369 files, more files were not shown because too many files have changed in this diff. Show more