mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-17 22:16:37 +00:00
Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
734a5fca2c | ||
|
|
9e4de0cbdc | ||
|
|
ee2c9065d8 | ||
|
|
75fa8842f4 | ||
|
|
3b8d4de300 | ||
|
|
7133f28df5 | ||
|
|
11bcba38cc | ||
|
|
f16bc42465 | ||
|
|
66f92ec63b | ||
|
|
4c0d91caef | ||
|
|
eaaa1affbc | ||
|
|
8090c73262 | ||
|
|
de3cc93543 | ||
|
|
83b22e0f56 |
No files matched your search
@@ -1,16 +0,0 @@
|
||||
; http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*.{c,h}]
|
||||
charset = UTF-8
|
||||
end_of_line = LF
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
insert_final_newline = true
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.yml]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
@@ -148,7 +148,6 @@ tests/*/*/*.sh
|
||||
*/tests/*/*/*.sh
|
||||
*/*/tests/*.diff
|
||||
*/*/tests/*.out
|
||||
*/*/tests/*.out.png
|
||||
*/*/tests/*.php
|
||||
*/*/tests/*.exp
|
||||
*/*/tests/*.log
|
||||
|
||||
+3
-3
@@ -108,8 +108,8 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_dblib
|
||||
PRIMARY MAINTAINER: Adam Baratz <adambaratz@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -132,7 +132,7 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_oci
|
||||
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
|
||||
@@ -1,827 +1,5 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
24 Nov 2016 PHP 7.0.14RC1
|
||||
|
||||
- Core:
|
||||
. Fixed memory leak(null coalescing operator with Spl hash). (Tyson Andre)
|
||||
. Fixded bug #72736 (Slow performance when fetching large dataset with mysqli
|
||||
/ PDO). (Dmitry)
|
||||
|
||||
- Calendar:
|
||||
. Fix integer overflows (Joshua Rogers)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #69587 (DateInterval properties and isset). (jhdxr)
|
||||
|
||||
- DTrace:
|
||||
. Disabled PHP call tracing by default (it makes significant overhead).
|
||||
This may be enabled again using envirionment variable USE_ZEND_DTRACE=1.
|
||||
(Dmitry)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #73526 (php_json_encode depth issue). (Jakub Zelenka)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #64526 (Add missing mysqlnd.* parameters to php.ini-*). (cmb)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #73448 (odbc_errormsg returns trash, always 513 bytes).
|
||||
(Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #69090 (check cached files permissions). (dmitry)
|
||||
. Fixed bug #73546 (Logging for opcache has an empty file name). (mhagstrand)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #73483 (Segmentation fault on pcre_replace_callback). (Laruence)
|
||||
. Fixed bug #73392 (A use-after-free in zend allocator management).
|
||||
(Laruence)
|
||||
|
||||
- PDO_Firebird:
|
||||
. Fixed bug #73087, #61183, #71494 (Memory corruption in bindParam).
|
||||
(Dorin Marcoci)
|
||||
|
||||
- Postgres:
|
||||
. Fixed bug #73498 (Incorrect SQL generated for pg_copy_to()). (Craig Duncan)
|
||||
|
||||
- Soap:
|
||||
. Fixed bug #73538 (SoapClient::__setSoapHeaders doesn't overwrite SOAP
|
||||
headers). (duncan3dc)
|
||||
. Fixed bug #73452 (Segfault (Regression for #69152)). (Dmitry)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #73423 (Reproducible crash with GDB backtrace). (Laruence)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #73530 (Unsetting result set may reset other result set). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #73297 (HTTP stream wrapper should ignore HTTP 100 Continue).
|
||||
(rowan dot collins at gmail dot com)
|
||||
|
||||
- XML:
|
||||
. Fixed bug #72135 (malformed XML causes fault) (edgarsandi)
|
||||
|
||||
10 Nov 2016 PHP 7.0.13
|
||||
|
||||
- Core:
|
||||
. Fixed bug #73350 (Exception::__toString() cause circular references).
|
||||
(Laruence)
|
||||
. Fixed bug #73181 (parse_str() without a second argument leads to crash).
|
||||
(Nikita)
|
||||
. Fixed bug #66773 (Autoload with Opcache allows importing conflicting class
|
||||
name to namespace). (Nikita)
|
||||
. Fixed bug #66862 ((Sub-)Namespaces unexpected behaviour). (Nikita)
|
||||
. Fix pthreads detection when cross-compiling (ffontaine)
|
||||
. Fixed bug #73337 (try/catch not working with two exceptions inside a same
|
||||
operation). (Dmitry)
|
||||
. Fixed bug #73338 (Exception thrown from error handler causes valgrind
|
||||
warnings (and crashes)). (Bob, Dmitry)
|
||||
. Fixed bug #73329 ((Float)"Nano" == NAN). (Anatol)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #73213 (Integer overflow in imageline() with antialiasing). (cmb)
|
||||
. Fixed bug #73272 (imagescale() is not affected by, but affects
|
||||
imagesetinterpolation()). (cmb)
|
||||
. Fixed bug #73279 (Integer overflow in gdImageScaleBilinearPalette()). (cmb)
|
||||
. Fixed bug #73280 (Stack Buffer Overflow in GD dynamicGetbuf). (cmb)
|
||||
. Fixed bug #72482 (Ilegal write/read access caused by gdImageAALine
|
||||
overflow). (cmb)
|
||||
. Fixed bug #72696 (imagefilltoborder stackoverflow on truecolor images).
|
||||
(cmb)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #73418 (Integer Overflow in "_php_imap_mail" leads to crash).
|
||||
(Anatol)
|
||||
|
||||
- OCI8
|
||||
. Fixed bug #71148 (Bind reference overwritten on PHP 7). (Oracle Corp.)
|
||||
|
||||
- phpdbg:
|
||||
. Properly allow for stdin input from a file. (Bob)
|
||||
. Add -s command line option / stdin command for reading script from stdin.
|
||||
(Bob)
|
||||
. Ignore non-executable opcodes in line mode of phpdbg_end_oplog(). (Bob)
|
||||
. Fixed bug #70776 (Simple SIGINT does not have any effect with -rr). (Bob)
|
||||
. Fixed bug #71234 (INI files are loaded even invoked as -n --version). (Bob)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #73273 (session_unset() empties values from all variables in which
|
||||
is $_session stored). (Nikita)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #73037 (SoapServer reports Bad Request when gzipped). (Anatol)
|
||||
. Fixed bug #73237 (Nested object in "any" element overwrites other fields).
|
||||
(Keith Smiley)
|
||||
. Fixed bug #69137 (Peer verification fails when using a proxy with SoapClient)
|
||||
(Keith Smiley)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #73333 (2147483647 is fetched as string). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #73203 (passing additional_parameters causes mail to fail). (cmb)
|
||||
. Fixed bug #71241 (array_replace_recursive sometimes mutates its parameters).
|
||||
(adsr)
|
||||
. Fixed bug #73192 (parse_url return wrong hostname). (Nikita)
|
||||
|
||||
- Wddx:
|
||||
. Fixed bug #73331 (NULL Pointer Dereference in WDDX Packet Deserialization
|
||||
with PDORow). (Stas)
|
||||
|
||||
13 Oct 2016 PHP 7.0.12
|
||||
|
||||
- Core:
|
||||
. Fixed bug #73025 (Heap Buffer Overflow in virtual_popen of
|
||||
zend_virtual_cwd.c). (cmb)
|
||||
. Fixed bug #72703 (Out of bounds global memory read in BF_crypt triggered by
|
||||
password_verify). (Anatol)
|
||||
. Fixed bug #73058 (crypt broken when salt is 'too' long). (Anatol)
|
||||
. Fixed bug #69579 (Invalid free in extension trait). (John Boehr)
|
||||
. Fixed bug #73156 (segfault on undefined function). (Dmitry)
|
||||
. Fixed bug #73163 (PHP hangs if error handler throws while accessing undef
|
||||
const in default value). (Nikita)
|
||||
. Fixed bug #73172 (parse error: Invalid numeric literal). (Nikita, Anatol)
|
||||
. Fixed for #73240 (Write out of bounds at number_format). (Stas)
|
||||
. Fixed bug #73147 (Use After Free in PHP7 unserialize()). (Stas)
|
||||
. Fixed bug #73189 (Memcpy negative size parameter php_resolve_path). (Stas)
|
||||
|
||||
- BCmath:
|
||||
. Fix bug #73190 (memcpy negative parameter _bc_new_num_ex). (Stas)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #73126 (Cannot pass parameter 1 by reference). (Anatol)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #73091 (Unserializing DateInterval object may lead to __toString
|
||||
invocation). (Stas)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #73150 (missing NULL check in dom_document_save_html). (Stas)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #72972 (Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and
|
||||
FILTER_FLAG_NO_PRIV_RANGE). (julien)
|
||||
. Fixed bug #73054 (default option ignored when object passed to int filter).
|
||||
(cmb)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #67325 (imagetruecolortopalette: white is duplicated in palette).
|
||||
(cmb)
|
||||
. Fixed bug #50194 (imagettftext broken on transparent background w/o
|
||||
alphablending). (cmb)
|
||||
. Fixed bug #73003 (Integer Overflow in gdImageWebpCtx of gd_webp.c). (trylab,
|
||||
cmb)
|
||||
. Fixed bug #53504 (imagettfbbox gives incorrect values for bounding box).
|
||||
(Mark Plomer, cmb)
|
||||
. Fixed bug #73157 (imagegd2() ignores 3rd param if 4 are given). (cmb)
|
||||
. Fixed bug #73155 (imagegd2() writes wrong chunk sizes on boundaries). (cmb)
|
||||
. Fixed bug #73159 (imagegd2(): unrecognized formats may result in corrupted
|
||||
files). (cmb)
|
||||
. Fixed bug #73161 (imagecreatefromgd2() may leak memory). (cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #73218 (add mitigation for ICU int overflow). (Stas)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #66797 (mb_substr only takes 32-bit signed integer). (cmb)
|
||||
. Fixed bug #66964 (mb_convert_variables() cannot detect recursion) (Yasuo)
|
||||
. Fixed bug #72992 (mbstring.internal_encoding doesn't inherit default_charset).
|
||||
(Yasuo)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #72489 (PHP Crashes When Modifying Array Containing MySQLi Result
|
||||
Data). (Nikita)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #72982 (Memory leak in zend_accel_blacklist_update_regexp()
|
||||
function). (Laruence)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #73072 (Invalid path SNI_server_certs causes segfault).
|
||||
(Jakub Zelenka)
|
||||
. Fixed bug #73276 (crash in openssl_random_pseudo_bytes function). (Stas)
|
||||
. Fixed bug #73275 (crash in openssl_encrypt function). (Stas)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #73121 (Bundled PCRE doesn't compile because JIT isn't supported
|
||||
on s390). (Anatol)
|
||||
. Fixed bug #73174 (heap overflow in php_pcre_replace_impl). (Stas)
|
||||
|
||||
- PDO_DBlib:
|
||||
. Fixed bug #72414 (Never quote values as raw binary data). (Adam Baratz)
|
||||
. Allow \PDO::setAttribute() to set query timeouts. (Adam Baratz)
|
||||
. Handle SQLDECIMAL/SQLNUMERIC types, which are used by later TDS versions.
|
||||
(Adam Baratz)
|
||||
. Add common PDO test suite. (Adam Baratz)
|
||||
. Free error and message strings when cleaning up PDO instances.
|
||||
(Adam Baratz)
|
||||
. Fixed bug #67130 (\PDOStatement::nextRowset() should succeed when all rows
|
||||
in current rowset haven't been fetched). (Peter LeBrun)
|
||||
. Ignore potentially misleading dberr values. (Chris Kings-Lynne)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #72996 (phpdbg_prompt.c undefined reference to DL_LOAD). (Nikita)
|
||||
. Fixed next command not stopping when leaving function. (Bob)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #68015 (Session does not report invalid uid for files save handler).
|
||||
(Yasuo)
|
||||
. Fixed bug #73100 (session_destroy null dereference in ps_files_path_create).
|
||||
(cmb)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #73293 (NULL pointer dereference in SimpleXMLElement::asXML()).
|
||||
(Stas)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #71711 (Soap Server Member variables reference bug). (Nikita)
|
||||
. Fixed bug #71996 (Using references in arrays doesn't work like expected).
|
||||
(Nikita)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #73257, #73258 (SplObjectStorage unserialize allows use of
|
||||
non-object as key). (Stas)
|
||||
|
||||
- SQLite3:
|
||||
. Updated bundled SQLite3 to 3.14.2. (cmb)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #70752 (Depacking with wrong password leaves 0 length files).
|
||||
(cmb)
|
||||
|
||||
15 Sep 2016 PHP 7.0.11
|
||||
|
||||
- Core:
|
||||
. Fixed bug #72944 (Null pointer deref in zval_delref_p). (Dmitry)
|
||||
. Fixed bug #72943 (assign_dim on string doesn't reset hval). (Laruence)
|
||||
. Fixed bug #72911 (Memleak in zend_binary_assign_op_obj_helper). (Laruence)
|
||||
. Fixed bug #72813 (Segfault with __get returned by ref). (Laruence)
|
||||
. Fixed bug #72767 (PHP Segfaults when trying to expand an infinite operator).
|
||||
(Nikita)
|
||||
. Fixed bug #72854 (PHP Crashes on duplicate destructor call). (Nikita)
|
||||
. Fixed bug #72857 (stream_socket_recvfrom read access violation). (Anatol)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #72922 (COM called from PHP does not return out parameters).
|
||||
(Anatol)
|
||||
|
||||
- Dba:
|
||||
. Fixed bug #70825 (Cannot fetch multiple values with group in ini file).
|
||||
(cmb)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #70195 (Cannot upload file using ftp_put to FTPES with
|
||||
require_ssl_reuse). (Benedict Singer)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #72709 (imagesetstyle() causes OOB read for empty $styles). (cmb)
|
||||
. Fixed bug #66005 (imagecopy does not support 1bit transparency on truecolor
|
||||
images). (cmb)
|
||||
. Fixed bug #72913 (imagecopy() loses single-color transparency on palette
|
||||
images). (cmb)
|
||||
. Fixed bug #68716 (possible resource leaks in _php_image_convert()). (cmb)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #72320 (iconv_substr returns false for empty strings). (cmb)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #72852 (imap_mail null dereference). (Anatol)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #65732 (grapheme_*() is not Unicode compliant on CR LF
|
||||
sequence). (cmb)
|
||||
. Fixed bug #73007 (add locale length check). (Stas)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #72293 (Heap overflow in mysqlnd related to BIT fields). (Stas)
|
||||
|
||||
- OCI8
|
||||
. Fixed invalid handle error with Implicit Result Sets. (Chris Jones)
|
||||
. Fixed bug #72524 (Binding null values triggers ORA-24816 error). (Chris Jones)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #72949 (Typo in opcache error message). (cmb)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #72788 (Invalid memory access when using persistent PDO
|
||||
connection). (Keyur)
|
||||
. Fixed bug #72791 (Memory leak in PDO persistent connection handling). (Keyur)
|
||||
. Fixed bug #60665 (call to empty() on NULL result using PDO::FETCH_LAZY
|
||||
returns false). (cmb)
|
||||
|
||||
- PDO_DBlib:
|
||||
. Implemented stringify 'uniqueidentifier' fields.
|
||||
(Alexander Zhuravlev, Adam Baratz)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Implemented FR #72633 (Postgres PDO lastInsertId() should work without
|
||||
specifying a sequence). (Pablo Santiago Sánchez, Matteo)
|
||||
. Fixed bug #72759 (Regression in pgo_pgsql). (Anatol)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #72928 (Out of bound when verify signature of zip phar in
|
||||
phar_parse_zipfile). (Stas)
|
||||
. Fixed bug #73035 (Out of bound when verify signature of tar phar in
|
||||
phar_parse_tarfile). (Stas)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #72846 (getConstant for a array constant with constant values
|
||||
returns NULL/NFC/UKNOWN). (Laruence)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #72724 (PHP7: session-uploadprogress kills httpd). (Nikita)
|
||||
. Fixed bug #72940 (SID always return "name=ID", even if session
|
||||
cookie exist). (Yasuo)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #72971 (SimpleXML isset/unset do not respect namespace). (Nikita)
|
||||
. Fixed bug #72957 (Null coalescing operator doesn't behave as expected with
|
||||
SimpleXMLElement). (Nikita)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #73029 (Missing type check when unserializing SplArray). (Stas)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #55451 (substr_compare NULL length interpreted as 0). (Lauri
|
||||
Kenttä)
|
||||
. Fixed bug #72278 (getimagesize returning FALSE on valid jpg). (cmb)
|
||||
. Fixed bug #65550 (get_browser() incorrectly parses entries with "+" sign).
|
||||
(cmb)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #72853 (stream_set_blocking doesn't work). (Laruence)
|
||||
. Fixed bug #72764 (ftps:// opendir wrapper data channel encryption fails
|
||||
with IIS FTP 7.5, 8.5). (vhuk)
|
||||
. Fixed bug #71882 (Negative ftruncate() on php://memory exhausts memory).
|
||||
(cmb)
|
||||
|
||||
- SQLite3:
|
||||
. Downgraded bundled SQLite to 3.8.10.2. (Anatol);
|
||||
|
||||
- Sysvshm:
|
||||
. Fixed bug #72858 (shm_attach null dereference). (Anatol)
|
||||
|
||||
- XML:
|
||||
. Fixed bug #72085 (SEGV on unknown address zif_xml_parse). (cmb)
|
||||
. Fixed bug #72714 (_xml_startElementHandler() segmentation fault). (cmb)
|
||||
|
||||
- Wddx:
|
||||
. Fixed bug #72860 (wddx_deserialize use-after-free). (Stas)
|
||||
. Fixed bug #73065 (Out-Of-Bounds Read in php_wddx_push_element). (Stas)
|
||||
|
||||
- ZIP:
|
||||
. Fixed bug #68302 (impossible to compile php with zip support). (cmb)
|
||||
|
||||
18 Aug 2016 PHP 7.0.10
|
||||
|
||||
- Core:
|
||||
. Fixed bug #72629 (Caught exception assignment to variables ignores
|
||||
references). (Laruence)
|
||||
. Fixed bug #72594 (Calling an earlier instance of an included anonymous
|
||||
class fatals). (Laruence)
|
||||
. Fixed bug #72581 (previous property undefined in Exception after
|
||||
deserialization). (Laruence)
|
||||
. Fixed bug #72496 (Cannot declare public method with signature incompatible
|
||||
with parent private method). (Pedro Magalhães)
|
||||
. Fixed bug #72024 (microtime() leaks memory). (maroszek at gmx dot net)
|
||||
. Fixed bug #71911 (Unable to set --enable-debug on building extensions by
|
||||
phpize on Windows). (Yuji Uchiyama)
|
||||
. Fixed bug causing ClosedGeneratorException being thrown into the calling
|
||||
code instead of the Generator yielding from. (Bob)
|
||||
. Implemented FR #72614 (Support "nmake test" on building extensions by
|
||||
phpize). (Yuji Uchiyama)
|
||||
. Fixed bug #72641 (phpize (on Windows) ignores PHP_PREFIX).
|
||||
(Yuji Uchiyama)
|
||||
. Fixed potential segfault in object storage freeing in shutdown sequence.
|
||||
(Bob)
|
||||
. Fixed bug #72663 (Create an Unexpected Object and Don't Invoke
|
||||
__wakeup() in Deserialization). (Stas)
|
||||
. Fixed bug #72681 (PHP Session Data Injection Vulnerability). (Stas)
|
||||
. Fixed bug #72683 (getmxrr broken). (Anatol)
|
||||
. Fixed bug #72742 (memory allocator fails to realloc small block to large
|
||||
one). (Stas)
|
||||
. Fixed URL rewriter partially. It would not rewrite '//example.com/' URL
|
||||
unconditionally. Only requested host(HTTP_HOST) is rewritten. (Yasuo)
|
||||
|
||||
- Bz2:
|
||||
. Fixed bug #72837 (integer overflow in bzdecompress caused heap
|
||||
corruption). (Stas)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #67976 (cal_days_month() fails for final month of the French
|
||||
calendar). (cmb)
|
||||
. Fixed bug #71894 (AddressSanitizer: global-buffer-overflow in
|
||||
zif_cal_from_jd). (cmb)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #72569 (DOTNET/COM array parameters broke in PHP7). (Anatol)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #71709 (curl_setopt segfault with empty CURLOPT_HTTPHEADER).
|
||||
(Pierrick)
|
||||
. Fixed bug #71929 (CURLINFO_CERTINFO data parsing error). (Pierrick)
|
||||
. Fixed bug #72674 (Heap overflow in curl_escape). (Stas)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #66502 (DOM document dangling reference). (Sean Heelan, cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #72735 (Samsung picture thumb not read (zero size)). (Kalle, Remi)
|
||||
. Fixed bug #72627 (Memory Leakage In exif_process_IFD_in_TIFF). (Stas)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #71745 (FILTER_FLAG_NO_RES_RANGE does not cover whole 127.0.0.0/8
|
||||
range). (bugs dot php dot net at majkl578 dot cz)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #72575 (using --allow-to-run-as-root should ignore missing user).
|
||||
(gooh)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #72596 (imagetypes function won't advertise WEBP support). (cmb)
|
||||
. Fixed bug #72604 (imagearc() ignores thickness for full arcs). (cmb)
|
||||
. Fixed bug #70315 (500 Server Error but page is fully rendered). (cmb)
|
||||
. Fixed bug #43828 (broken transparency of imagearc for truecolor in
|
||||
blendingmode). (cmb)
|
||||
. Fixed bug #66555 (Always false condition in ext/gd/libgd/gdkanji.c). (cmb)
|
||||
. Fixed bug #68712 (suspicious if-else statements). (cmb)
|
||||
. Fixed bug #72697 (select_colors write out-of-bounds). (Stas)
|
||||
. Fixed bug #72730 (imagegammacorrect allows arbitrary write access). (Stas)
|
||||
. Fixed bug #72494 (imagecropauto out-of-bounds access). (Fernando, Pierre,
|
||||
cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #72639 (Segfault when instantiating class that extends
|
||||
IntlCalendar and adds a property). (Laruence)
|
||||
. Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain
|
||||
names). (cmb)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #72691 (mb_ereg_search raises a warning if a match zero-width).
|
||||
(cmb)
|
||||
. Fixed bug #72693 (mb_ereg_search increments search position when a match
|
||||
zero-width). (cmb)
|
||||
. Fixed bug #72694 (mb_ereg_search_setpos does not accept a string's last
|
||||
position). (cmb)
|
||||
. Fixed bug #72710 (`mb_ereg` causes buffer overflow on regexp compile error).
|
||||
(ju1ius)
|
||||
|
||||
- Mcrypt:
|
||||
. Fixed bug #72782 (Heap Overflow due to integer overflows). (Stas)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #72590 (Opcache restart with kill_all_lockers does not work).
|
||||
(Keyur)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #72688 (preg_match missing group names in matches). (cmb)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Fixed bug #70313 (PDO statement fails to throw exception). (Matteo)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #72222 (ReflectionClass::export doesn't handle array constants).
|
||||
(Nikita Nefedov)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #72588 (Using global var doesn't work while accessing SimpleXML
|
||||
element). (Laruence)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #72708 (php_snmp_parse_oid integer overflow in memory
|
||||
allocation). (djodjo at gmail dot com)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #55701 (GlobIterator throws LogicException). (Valentin VĂLCIU)
|
||||
. Fixed bug #72646 (SplFileObject::getCsvControl does not return the escape
|
||||
character). (cmb)
|
||||
. Fixed bug #72684 (AppendIterator segfault with closed generator). (Pierrick)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #72668 (Spurious warning when exception is thrown in user defined
|
||||
function). (Laruence)
|
||||
. Fixed bug #72571 (SQLite3::bindValue, SQLite3::bindParam crash). (Laruence)
|
||||
. Implemented FR #72653 (SQLite should allow opening with empty filename).
|
||||
(cmb)
|
||||
. Updated to SQLite3 3.13.0. (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #72622 (array_walk + array_replace_recursive create references
|
||||
from nothing). (Laruence)
|
||||
. Fixed bug #72152 (base64_decode $strict fails to detect null byte).
|
||||
(Lauri Kenttä)
|
||||
. Fixed bug #72263 (base64_decode skips a character after padding in strict
|
||||
mode). (Lauri Kenttä)
|
||||
. Fixed bug #72264 (base64_decode $strict fails with whitespace between
|
||||
padding). (Lauri Kenttä)
|
||||
. Fixed bug #72330 (CSV fields incorrectly split if escape char followed by
|
||||
UTF chars). (cmb)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #41021 (Problems with the ftps wrapper). (vhuk)
|
||||
. Fixed bug #54431 (opendir() does not work with ftps:// wrapper). (vhuk)
|
||||
. Fixed bug #72667 (opendir() with ftp:// attempts to open data stream for
|
||||
non-existent directories). (vhuk)
|
||||
. Fixed bug #72771 (ftps:// wrapper is vulnerable to protocol downgrade
|
||||
attack). (Stas)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing
|
||||
array elements). (Laruence)
|
||||
|
||||
- Wddx:
|
||||
. Fixed bug #72564 (boolean always deserialized as "true") (Remi)
|
||||
. Fixed bug #72142 (WDDX Packet Injection Vulnerability in
|
||||
wddx_serialize_value()). (Taoguang Chen)
|
||||
. Fixed bug #72749 (wddx_deserialize allows illegal memory access) (Stas)
|
||||
. Fixed bug #72750 (wddx_deserialize null dereference). (Stas)
|
||||
. Fixed bug #72790 (wddx_deserialize null dereference with invalid xml).
|
||||
(Stas)
|
||||
. Fixed bug #72799 (wddx_deserialize null dereference in
|
||||
php_wddx_pop_element). (Stas)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd).
|
||||
(Laruence)
|
||||
|
||||
21 Jul 2016 PHP 7.0.9
|
||||
|
||||
- Core:
|
||||
. Fixed bug #72508 (strange references after recursive function call and
|
||||
"switch" statement). (Laruence)
|
||||
. Fixed bug #72513 (Stack-based buffer overflow vulnerability in
|
||||
virtual_file_ex). (Stas)
|
||||
. Fixed bug #72573 (HTTP_PROXY is improperly trusted by some PHP libraries
|
||||
and applications). (Stas)
|
||||
|
||||
- bz2:
|
||||
. Fixed bug #72613 (Inadequate error handling in bzread()). (Stas)
|
||||
|
||||
- CLI:
|
||||
. Fixed bug #72484 (SCRIPT_FILENAME shows wrong path if the user specify
|
||||
router.php). (Laruence)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #72498 (variant_date_from_timestamp null dereference). (Anatol)
|
||||
|
||||
- Curl:
|
||||
. Fixed bug #72541 (size_t overflow lead to heap corruption). (Stas)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails
|
||||
parsing). (derick)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #72603 (Out of bound read in exif_process_IFD_in_MAKERNOTE).
|
||||
(Stas)
|
||||
. Fixed bug #72618 (NULL Pointer Dereference in exif_process_user_comment).
|
||||
(Stas)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #43475 (Thick styled lines have scrambled patterns). (cmb)
|
||||
. Fixed bug #53640 (XBM images require width to be multiple of 8). (cmb)
|
||||
. Fixed bug #64641 (imagefilledpolygon doesn't draw horizontal line). (cmb)
|
||||
. Fixed bug #72512 (gdImageTrueColorToPaletteBody allows arbitrary write/read
|
||||
access). (Pierre)
|
||||
. Fixed bug #72519 (imagegif/output out-of-bounds access). (Pierre)
|
||||
. Fixed bug #72558 (Integer overflow error within _gdContributionsAlloc()).
|
||||
(Pierre)
|
||||
. Fixed bug #72482 (Ilegal write/read access caused by gdImageAALine
|
||||
overflow). (Pierre)
|
||||
. Fixed bug #72494 (imagecropauto out-of-bounds access). (Pierre)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #72533 (locale_accept_from_http out-of-bounds access). (Stas)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #72405 (mb_ereg_replace - mbc_to_code (oniguruma) -
|
||||
oob read access). (Laruence)
|
||||
. Fixed bug #72399 (Use-After-Free in MBString (search_re)). (Laruence)
|
||||
|
||||
- mcrypt:
|
||||
. Fixed bug #72551, bug #72552 (In correct casting from size_t to int lead to
|
||||
heap overflow in mdecrypt_generic). (Stas)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Fixed bug #72570 (Segmentation fault when binding parameters on a query
|
||||
without placeholders). (Matteo)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #72476 (Memleak in jit_stack). (Laruence)
|
||||
. Fixed bug #72463 (mail fails with invalid argument). (Anatol)
|
||||
|
||||
- Readline:
|
||||
. Fixed bug #72538 (readline_redisplay crashes php). (Laruence)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #72505 (readfile() mangles files larger than 2G). (Cschneid)
|
||||
. Fixed bug #72306 (Heap overflow through proc_open and $env parameter).
|
||||
(Laruence)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #72531 (ps_files_cleanup_dir Buffer overflow). (Laruence)
|
||||
. Fixed bug #72562 (Use After Free in unserialize() with Unexpected Session
|
||||
Deserialization). (Stas)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #72479 (Use After Free Vulnerability in SNMP with GC and
|
||||
unserialize()). (Stas)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #72439 (Stream socket with remote address leads to a segmentation
|
||||
fault). (Laruence)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #72606 (heap-buffer-overflow (write) simplestring_addn
|
||||
simplestring.c). (Stas)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #72520 (Stack-based buffer overflow vulnerability in
|
||||
php_stream_zip_opener). (Stas)
|
||||
|
||||
23 Jun 2016 PHP 7.0.8
|
||||
|
||||
- Core:
|
||||
. Fixed bug #72218 (If host name cannot be resolved then PHP 7 crashes).
|
||||
(Esminis at esminis dot lt)
|
||||
. Fixed bug #72221 (segfault, past-the-end access). (Lauri Kenttä)
|
||||
. Fixed bug #72268 (Integer Overflow in nl2br()). (Stas)
|
||||
. Fixed bug #72275 (Integer Overflow in json_encode()/json_decode()/
|
||||
json_utf8_to_utf16()). (Stas)
|
||||
. Fixed bug #72400 (Integer Overflow in addcslashes/addslashes). (Stas)
|
||||
. Fixed bug #72403 (Integer Overflow in Length of String-typed ZVAL). (Stas)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #63740 (strtotime seems to use both sunday and monday as start of
|
||||
week). (Derick)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #72308 (fastcgi_finish_request and logging environment
|
||||
variables). (Laruence)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (CVE-2015-8874)
|
||||
(cmb)
|
||||
. Fixed bug #72298 (pass2_no_dither out-of-bounds access). (Stas)
|
||||
. Fixed bug #72337 (invalid dimensions can lead to crash). (Pierre)
|
||||
. Fixed bug #72339 (Integer Overflow in _gd2GetHeader() resulting in heap
|
||||
overflow). (CVE-2016-5766) (Pierre)
|
||||
. Fixed bug #72407 (NULL Pointer Dereference at _gdScaleVert). (Stas)
|
||||
. Fixed bug #72446 (Integer Overflow in gdImagePaletteToTrueColor() resulting
|
||||
in heap overflow). (CVE-2016-5767) (Pierre)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #70484 (selectordinal doesn't work with named parameters).
|
||||
(Anatol)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #72402 (_php_mb_regex_ereg_replace_exec - double free).
|
||||
(CVE-2016-5768) (Stas)
|
||||
|
||||
- mcrypt:
|
||||
. Fixed bug #72455 (Heap Overflow due to integer overflows). (CVE-2016-5769)
|
||||
(Stas)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #72140 (segfault after calling ERR_free_strings()).
|
||||
(Jakub Zelenka)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #72143 (preg_replace uses int instead of size_t). (Joe)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Fixed bug #71573 (Segfault (core dumped) if paramno beyond bound).
|
||||
(Laruence)
|
||||
. Fixed bug #72294 (Segmentation fault/invalid pointer in connection
|
||||
with pgsql_stmt_dtor). (Anatol)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #72321 (invalid free in phar_extract_file()).
|
||||
(hji at dyntopia dot com)
|
||||
|
||||
- Phpdbg:
|
||||
. Fixed bug #72284 (phpdbg fatal errors with coverage). (Bob)
|
||||
|
||||
- Postgres:
|
||||
. Fixed bug #72195 (pg_pconnect/pg_connect cause use-after-free). (Laruence)
|
||||
. Fixed bug #72197 (pg_lo_create arbitrary read). (Anatol)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #72369 (array_merge() produces references in PHP7). (Dmitry)
|
||||
. Fixed bug #72300 (ignore_user_abort(false) has no effect). (Laruence)
|
||||
. Fixed bug #72229 (Wrong reference when serialize/unserialize an object).
|
||||
(Laruence)
|
||||
. Fixed bug #72193 (dns_get_record returns array containing elements of
|
||||
type 'unknown'). (Laruence)
|
||||
. Fixed bug #72017 (range() with float step produces unexpected result).
|
||||
(Thomas Punt)
|
||||
|
||||
- WDDX:
|
||||
. Fixed bug #72340 (Double Free Courruption in wddx_deserialize).
|
||||
(CVE-2016-5772) (Stas)
|
||||
|
||||
- XML:
|
||||
. Fixed bug #72206 (xml_parser_create/xml_parser_free leaks mem). (Joe)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #72155 (use-after-free caused by get_zval_xmlrpc_type).
|
||||
(Joe, Laruence)
|
||||
|
||||
- Zip:
|
||||
. Fixed ug #72258 (ZipArchive converts filenames to unrecoverable form).
|
||||
(Anatol)
|
||||
. Fixed bug #72434 (ZipArchive class Use After Free Vulnerability in PHP's GC
|
||||
algorithm and unserialize). (CVE-2016-5773) (Dmitry)
|
||||
|
||||
26 May 2016 PHP 7.0.7
|
||||
|
||||
- Core:
|
||||
. Fixed bug #72162 (use-after-free - error_reporting). (Laruence)
|
||||
. Add compiler option to disable special case function calls. (Joe)
|
||||
. Fixed bug #72101 (crash on complex code). (Dmitry)
|
||||
. Fixed bug #72100 (implode() inserts garbage into resulting string when
|
||||
joins very big integer). (Mikhail Galanin)
|
||||
. Fixed bug #72057 (PHP Hangs when using custom error handler and typehint).
|
||||
(Nikita Nefedov)
|
||||
. Fixed bug #72038 (Function calls with values to a by-ref parameter don't
|
||||
always throw a notice). (Bob)
|
||||
. Fixed bug #71737 (Memory leak in closure with parameter named $this).
|
||||
(Nikita)
|
||||
. Fixed bug #72059 (?? is not allowed on constant expressions). (Bob, Marcio)
|
||||
. Fixed bug #72159 (Imported Class Overrides Local Class Name). (Nikita)
|
||||
|
||||
- Curl:
|
||||
. Fixed bug #68658 (Define CURLE_SSL_CACERT_BADFILE). (Pierrick)
|
||||
|
||||
- DBA:
|
||||
. Fixed bug #72157 (use-after-free caused by dba_open). (Shm, Laruence)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #72227 (imagescale out-of-bounds read). (Stas)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #64524 (Add intl.use_exceptions to php.ini-*). (Anatol)
|
||||
. Fixed bug #72241 (get_icu_value_internal out-of-bounds read). (Stas)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #72069 (Behavior \JsonSerializable different from json_encode).
|
||||
(Laruence)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #72164 (Null Pointer Dereference - mb_ereg_replace). (Laruence)
|
||||
|
||||
- OCI8:
|
||||
. Fixed bug #71600 (oci_fetch_all segfaults when selecting more than eight
|
||||
columns). (Tian Yang)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #72014 (Including a file with anonymous classes multiple times
|
||||
leads to fatal error). (Laruence)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #72165 (Null pointer dereference - openssl_csr_new). (Anatol)
|
||||
|
||||
- PCNTL:
|
||||
. Fixed bug #72154 (pcntl_wait/pcntl_waitpid array internal structure
|
||||
overwrite). (Laruence)
|
||||
|
||||
- POSIX:
|
||||
. Fixed bug #72133 (php_posix_group_to_array crashes if gr_passwd is NULL).
|
||||
(esminis at esminis dot lt)
|
||||
|
||||
- Postgres:
|
||||
. Fixed bug #72028 (pg_query_params(): NULL converts to empty string).
|
||||
(Laruence)
|
||||
. Fixed bug #71062 (pg_convert() doesn't accept ISO 8601 for datatype
|
||||
timestamp). (denver at timothy dot io)
|
||||
. Fixed bug #72151 (mysqli_fetch_object changed behaviour). (Anatol)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #72174 (ReflectionProperty#getValue() causes __isset call).
|
||||
(Nikita)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #71972 (Cyclic references causing session_start(): Failed to
|
||||
decode session object). (Laruence)
|
||||
|
||||
- Sockets:
|
||||
. Added socket_export_stream() function for getting a stream compatible
|
||||
resource from a socket resource. (Chris Wright, Bob)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #72051 (The reference in CallbackFilterIterator doesn't work as
|
||||
expected). (Laruence)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #68849 (bindValue is not using the right data type). (Anatol)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #72075 (Referencing socket resources breaks stream_select).
|
||||
(Laruence)
|
||||
. Fixed bug #72031 (array_column() against an array of objects discards all
|
||||
values matching null). (Nikita)
|
||||
|
||||
28 Apr 2016 PHP 7.0.6
|
||||
|
||||
- Core:
|
||||
@@ -837,6 +15,7 @@ PHP NEWS
|
||||
php_url_encode). (Stas)
|
||||
. Fixed bug #71731 (Null coalescing operator and ArrayAccess). (Nikita)
|
||||
. Fixed bug #71609 (Segmentation fault on ZTS with gethostbyname). (krakjoe)
|
||||
. Fixed bug #71428 (inheritance and allow_null). (krakjoe)
|
||||
. Fixed bug #71414 (Inheritance, traits and interfaces). (krakjoe)
|
||||
. Fixed bug #71359 (Null coalescing operator and magic). (krakjoe)
|
||||
. Fixed bug #71334 (Cannot access array keys while uksort()). (Nikita)
|
||||
@@ -863,7 +42,7 @@ PHP NEWS
|
||||
. Fixed bug #72094 (Out of bounds heap read access in exif header processing). (Stas)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #71912 (libgd: signedness vulnerability). (CVE-2016-3074) (Stas)
|
||||
. Fixed bug #71912 (libgd: signedness vulnerability). (Stas)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #71516 (IntlDateFormatter looses locale if pattern is set via
|
||||
@@ -940,8 +119,7 @@ PHP NEWS
|
||||
. Fixed bug #72099 (xml_parse_into_struct segmentation fault). (Stas)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #71923 (integer overflow in ZipArchive::getFrom*).
|
||||
(CVE-2016-3078) (Stas)
|
||||
. Fixed bug #71923 (integer overflow in ZipArchive::getFrom*). (Stas)
|
||||
|
||||
31 Mar 2016 PHP 7.0.5
|
||||
|
||||
@@ -984,14 +162,14 @@ PHP NEWS
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #71527 (Buffer over-write in finfo_open with malformed magic
|
||||
file). (CVE-2015-8865) (Anatol)
|
||||
file). (Anatol)
|
||||
|
||||
- libxml:
|
||||
. Fixed bug #71536 (Access Violation crashes php-cgi.exe). (Anatol)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #71906 (AddressSanitizer: negative-size-param (-1) in
|
||||
mbfl_strcut). (CVE-2016-4073) (Stas)
|
||||
mbfl_strcut). (Stas)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #47803, #69526 (Executing prepared statements is succesfull only
|
||||
@@ -1009,7 +187,7 @@ PHP NEWS
|
||||
. Fixed bug #71625 (Crash in php7.dll with bad phar filename). (Anatol)
|
||||
. Fixed bug #71317 (PharData fails to open specific file). (Jos Elstgeest)
|
||||
. Fixed bug #71860 (Invalid memory write in phar on filename with \0 in
|
||||
name). (CVE-2016-4072) (Stas)
|
||||
name). (Stas)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed crash when advancing (except step) inside an internal function. (Bob)
|
||||
@@ -1020,7 +198,7 @@ PHP NEWS
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #71704 (php_snmp_error() Format String Vulnerability).
|
||||
(CVE-2016-4071) (andrew at jmpesp dot org)
|
||||
(andrew at jmpesp dot org)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #71617 (private properties lost when unserializing ArrayObject).
|
||||
@@ -1029,7 +207,7 @@ PHP NEWS
|
||||
- Standard:
|
||||
. Fixed bug #71660 (array_column behaves incorrectly after foreach by
|
||||
reference). (Laruence)
|
||||
. Fixed bug #71798 (Integer Overflow in php_raw_url_encode). (CVE-2016-4070)
|
||||
. Fixed bug #71798 (Integer Overflow in php_raw_url_encode).
|
||||
(taoguangchen at icloud dot com, Stas)
|
||||
|
||||
- Zip:
|
||||
@@ -1054,8 +232,7 @@ PHP NEWS
|
||||
using count). (Nikita)
|
||||
. Fixed bug #71601 (finally block not executed after yield from). (Bob)
|
||||
. Fixed bug #71637 (Multiple Heap Overflow due to integer overflows in
|
||||
xml/filter_url/addcslashes). (CVE-2016-4344, CVE-2016-4345, CVE-2016-4346)
|
||||
(Stas)
|
||||
xml/filter_url/addcslashes). (Stas)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #71559 (Built-in HTTP server, we can download file in web by bug).
|
||||
@@ -1091,7 +268,7 @@ PHP NEWS
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #71610 (Type Confusion Vulnerability - SOAP /
|
||||
make_http_soap_request()). (CVE-2016-3185) (Stas)
|
||||
make_http_soap_request()). (Stas)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #71603 (compact() maintains references in php7). (Laruence)
|
||||
@@ -1153,18 +330,13 @@ PHP NEWS
|
||||
. Fixed bug #71475 (openssl_seal() uninitialized memory usage). (Stas)
|
||||
|
||||
- PCRE:
|
||||
. Upgraded pcrelib to 8.38. (CVE-2015-8383, CVE-2015-8386, CVE-2015-8387,
|
||||
CVE-2015-8389, CVE-2015-8390, CVE-2015-8391, CVE-2015-8393, CVE-2015-8394)
|
||||
. Upgraded pcrelib to 8.38.
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #71354 (Heap corruption in tar/zip/phar parser). (CVE-2016-4342)
|
||||
(Stas)
|
||||
. Fixed bug #71331 (Uninitialized pointer in phar_make_dirstream()).
|
||||
(CVE-2016-4343) (Stas)
|
||||
. Fixed bug #71354 (Heap corruption in tar/zip/phar parser). (Stas)
|
||||
. Fixed bug #71391 (NULL Pointer Dereference in phar_tar_setupmetadata()).
|
||||
(Stas)
|
||||
. Fixed bug #71488 (Stack overflow when decompressing tar archives).
|
||||
(CVE-2016-2554) (Stas)
|
||||
. Fixed bug #71488 (Stack overflow when decompressing tar archives). (Stas)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #70979 (crash with bad soap request). (Anatol)
|
||||
@@ -1240,7 +412,7 @@ PHP NEWS
|
||||
|
||||
- GD:
|
||||
. Fixed bug #70976 (Memory Read via gdImageRotateInterpolated Array Index
|
||||
Out of Bounds). (CVE-2016-1903) (emmanuel dot law at gmail dot com)
|
||||
Out of Bounds). (emmanuel dot law at gmail dot com)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #71066 (mb_send_mail: Program terminated with signal SIGSEGV,
|
||||
@@ -1268,7 +440,7 @@ PHP NEWS
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #71270 (Heap BufferOver Flow in escapeshell functions).
|
||||
(CVE-2016-1904) (emmanuel dot law at gmail dot com)
|
||||
(emmanuel dot law at gmail dot com)
|
||||
|
||||
- WDDX:
|
||||
. Fixed bug #70661 (Use After Free Vulnerability in WDDX Packet
|
||||
@@ -1671,8 +843,6 @@ PHP NEWS
|
||||
|
||||
- Filter:
|
||||
. New FILTER_VALIDATE_DOMAIN and better RFC conformance for FILTER_VALIDATE_URL. (Kevin Dunglas)
|
||||
. Fixed bug #67167 (Wrong return value from FILTER_VALIDATE_BOOLEAN,
|
||||
FILTER_NULL_ON_FAILURE). (levim)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #70538 ("php-fpm -i" crashes). (rainer dot jung at
|
||||
@@ -1688,8 +858,7 @@ PHP NEWS
|
||||
|
||||
- GD:
|
||||
. Fixed bug #53156 (imagerectangle problem with point ordering). (cmb)
|
||||
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (CVE-2015-8874)
|
||||
(cmb)
|
||||
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (cmb)
|
||||
. Fixed bug #70102 (imagecreatefromwebm() shifts colors). (cmb)
|
||||
. Fixed bug #66590 (imagewebp() doesn't pad to even length). (cmb)
|
||||
. Fixed bug #66882 (imagerotate by -90 degrees truncates image by 1px). (cmb)
|
||||
@@ -1775,7 +944,7 @@ PHP NEWS
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #69975 (PHP segfaults when accessing nvarchar(max) defined
|
||||
columns). (CVE-2015-8879) (cmb)
|
||||
columns). (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #70656 (require() statement broken after opcache_reset() or a
|
||||
@@ -1816,7 +985,7 @@ PHP NEWS
|
||||
. Implemented FR #70438 (Add IV parameter for openssl_seal and openssl_open)
|
||||
(Jakub Zelenka)
|
||||
. Fixed bug #70014 (openssl_random_pseudo_bytes() is not cryptographically
|
||||
secure). (CVE-2015-8867) (Stas)
|
||||
secure). (Stas)
|
||||
. Fixed bug #69882 (OpenSSL error "key values mismatch" after
|
||||
openssl_pkcs12_read with extra cert). (Tomasz Sawicki)
|
||||
. Added "alpn_protocols" SSL context option allowing encrypted client/server
|
||||
@@ -2064,8 +1233,7 @@ PHP NEWS
|
||||
(Daniel Lowrey & Bob Weinand)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #70322 (ZipArchive::close() doesn't indicate errors).
|
||||
(CVE-2014-9767) (cmb)
|
||||
. Fixed bug #70322 (ZipArchive::close() doesn't indicate errors). (cmb)
|
||||
. Fixed bug #70350 (ZipArchive::extractTo allows for directory traversal when
|
||||
creating directories). (neal at fb dot com)
|
||||
. Added ZipArchive::setCompressionName and ZipArchive::setCompressionIndex
|
||||
|
||||
+30
-27
@@ -66,7 +66,7 @@ dnl
|
||||
dnl Check whether the current setup can use POSIX threads calls
|
||||
dnl
|
||||
AC_DEFUN([PTHREADS_CHECK_COMPILE], [
|
||||
AC_LINK_IFELSE([ AC_LANG_SOURCE([
|
||||
AC_TRY_RUN( [
|
||||
#include <pthread.h>
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -80,11 +80,18 @@ int main() {
|
||||
int data = 1;
|
||||
pthread_mutexattr_init(&mattr);
|
||||
return pthread_create(&thd, NULL, thread_routine, &data);
|
||||
} ]) ], [
|
||||
pthreads_checked=yes
|
||||
} ], [
|
||||
pthreads_working=yes
|
||||
], [
|
||||
pthreads_checked=no
|
||||
]
|
||||
pthreads_working=no
|
||||
], [
|
||||
dnl For cross compiling running this test is of no use. NetWare supports pthreads
|
||||
pthreads_working=no
|
||||
case $host_alias in
|
||||
*netware*)
|
||||
pthreads_working=yes
|
||||
esac
|
||||
]
|
||||
) ] )dnl
|
||||
dnl
|
||||
dnl PTHREADS_CHECK()
|
||||
@@ -122,34 +129,30 @@ else
|
||||
CFLAGS="$CFLAGS $flag"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
CFLAGS=$ac_save
|
||||
if test "$pthreads_checked" = "yes"; then
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
ac_cv_pthreads_cflags=$flag
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
|
||||
ac_cv_pthreads_lib=
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
for lib in pthread pthreads c_r; do
|
||||
ac_save=$LIBS
|
||||
LIBS="$LIBS -l$lib"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
LIBS=$ac_save
|
||||
if test "$pthreads_checked" = "yes"; then
|
||||
ac_cv_pthreads_lib=$lib
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
|
||||
pthreads_working="yes"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
|
||||
ac_cv_pthreads_lib=
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
for lib in pthread pthreads c_r; do
|
||||
ac_save=$LIBS
|
||||
LIBS="$LIBS -l$lib"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
LIBS=$ac_save
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
ac_cv_pthreads_lib=$lib
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
threads_result="POSIX-Threads found"
|
||||
|
||||
+2
-18
@@ -622,12 +622,6 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
}
|
||||
} else {
|
||||
if (flags & IPC_EXCL) {
|
||||
if (shm_handle) {
|
||||
CloseHandle(shm_handle);
|
||||
}
|
||||
if (info_handle) {
|
||||
CloseHandle(info_handle);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -671,27 +665,17 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
{
|
||||
shm_pair *shm = shm_get(key, NULL);
|
||||
int err;
|
||||
|
||||
if (!shm->segment) {
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
err = GetLastError();
|
||||
if (err) {
|
||||
/* Catch more errors */
|
||||
if (ERROR_NOT_ENOUGH_MEMORY == err) {
|
||||
_set_errno(ENOMEM);
|
||||
}
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
shm->descriptor->shm_atime = time(NULL);
|
||||
shm->descriptor->shm_lpid = getpid();
|
||||
shm->descriptor->shm_nattch++;
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
return shm->addr;
|
||||
}
|
||||
|
||||
|
||||
@@ -442,8 +442,6 @@ Other
|
||||
- Curl:
|
||||
. Removed support for disabling the CURLOPT_SAFE_UPLOAD option. All curl file
|
||||
uploads must use the curl_file / CURLFile APIs.
|
||||
. curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer
|
||||
as a string (PHP >= 5.6.25)
|
||||
|
||||
- Date:
|
||||
. Removed $is_dst parameter from mktime() and gmmktime().
|
||||
@@ -517,10 +515,6 @@ Other
|
||||
- Stream:
|
||||
. Removed set_socket_blocking() in favor of its alias stream_set_blocking().
|
||||
|
||||
- XML:
|
||||
. xml_set_object() now requires to manually unset the $parser when finished,
|
||||
to avoid memory leaks.
|
||||
|
||||
- XSL:
|
||||
. Removed xsl.security_prefs ini option. Use XsltProcessor::setSecurityPrefs()
|
||||
instead.
|
||||
@@ -647,10 +641,6 @@ Other
|
||||
- debug_zval_dump
|
||||
It prints now "int" instead of "long", and "float" instead of "double".
|
||||
|
||||
- getenv()
|
||||
Since 7.0.9, getenv() has optional second parameter, making it only
|
||||
consider local environment and not SAPI environment if true.
|
||||
|
||||
========================================
|
||||
6. New Functions
|
||||
========================================
|
||||
@@ -727,9 +717,6 @@ out, that the corresponding SDK isn't available anymore.
|
||||
- Openssl
|
||||
minimum supported OpenSSL version series was raised to 0.9.8
|
||||
|
||||
- Shmop
|
||||
The shmop identifiers have been changed from ints to resources of type shmop.
|
||||
|
||||
========================================
|
||||
10. New Global Constants
|
||||
========================================
|
||||
@@ -753,8 +740,6 @@ out, that the corresponding SDK isn't available anymore.
|
||||
. ZLIB_FINISH
|
||||
|
||||
- GD
|
||||
. IMG_WEBP (>= 7.0.10)
|
||||
|
||||
. T1Lib support removed, thus lifting the optional dependency on T1Lib, the
|
||||
following is therefore not available anymore:
|
||||
|
||||
@@ -771,14 +756,6 @@ out, that the corresponding SDK isn't available anymore.
|
||||
- 'gd PS font'
|
||||
- 'gd PS encoding'
|
||||
|
||||
- Zip
|
||||
. Filename encoding flags, as of 7.0.8
|
||||
- ZipArchive::FL_ENC_GUESS
|
||||
- ZipArchive::FL_ENC_RAW
|
||||
- ZipArchive::FL_ENC_STRICT
|
||||
- ZipArchive::FL_ENC_UTF_8
|
||||
- ZipArchive::FL_ENC_CP437
|
||||
|
||||
========================================
|
||||
11. Changes to INI File Handling
|
||||
========================================
|
||||
@@ -830,7 +807,3 @@ out, that the corresponding SDK isn't available anymore.
|
||||
of aditional information with internal functions. In PHP-5 it was possible
|
||||
to use zend_function.op_array.reserved[] even for internal functions, but
|
||||
now we don't allocate extra space.
|
||||
|
||||
- CURL
|
||||
. curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer
|
||||
as a string (PHP >= 7.0.10)
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Array must be separated if unpacking by reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function inc(&... $args) {
|
||||
foreach ($args as &$arg) {
|
||||
$arg++;
|
||||
}
|
||||
}
|
||||
|
||||
$arr = [1, 2];
|
||||
$arr[] = 3;
|
||||
$arr2 = $arr;
|
||||
inc(...$arr);
|
||||
var_dump($arr);
|
||||
var_dump($arr2);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
[2]=>
|
||||
int(4)
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Next free element may overflow in array literals
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$i = PHP_INT_MAX;
|
||||
$array = [$i => 42, new stdClass];
|
||||
var_dump($array);
|
||||
|
||||
const FOO = [PHP_INT_MAX => 42, "foo"];
|
||||
var_dump(FOO);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Serialization of backtick literal is incorrect
|
||||
--INI--
|
||||
zend.assertions=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
assert_options(ASSERT_WARNING);
|
||||
assert(false && `echo -n ""`);
|
||||
--EXPECTF--
|
||||
Warning: assert(): assert(false && `echo -n ""`) failed in %s%east_serialize_backtick_literal.php on line %d
|
||||
@@ -8,8 +8,7 @@ class Thing {}
|
||||
function boom()
|
||||
{
|
||||
$reader = xml_parser_create();
|
||||
$thing = new Thing();
|
||||
xml_set_object($reader, $thing);
|
||||
xml_set_object($reader, new Thing());
|
||||
die("ok\n");
|
||||
xml_parser_free($reader);
|
||||
}
|
||||
|
||||
@@ -10,4 +10,5 @@ class foo {
|
||||
$obj = new foo("Hello world");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use $this as parameter in %s on line %d
|
||||
Fatal error: Cannot re-assign $this in %sbug41117_1.php on line 3
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71737: Memory leak in closure with parameter named $this
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public function method() {
|
||||
return function($this) {};
|
||||
}
|
||||
}
|
||||
|
||||
(new Test)->method()(new stdClass);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use $this as parameter in %s on line %d
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
test($foo = new stdClass);
|
||||
var_dump($foo);
|
||||
test($bar = 2);
|
||||
var_dump($bar);
|
||||
test($baz = &$bar);
|
||||
var_dump($baz);
|
||||
|
||||
function test(&$param) {
|
||||
$param = 1;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Notice: Only variables should be passed by reference in %s on line %d
|
||||
object(stdClass)#1 (0) {
|
||||
}
|
||||
|
||||
Notice: Only variables should be passed by reference in %s on line %d
|
||||
int(2)
|
||||
int(1)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72057 (PHP hangs when user error handler throws exception after Notice from type coercion)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(
|
||||
function() {
|
||||
throw new Exception("My custom error");
|
||||
}
|
||||
);
|
||||
|
||||
(function (int $i) { bar(); })("7as");
|
||||
|
||||
--EXPECTF--
|
||||
|
||||
Fatal error: Uncaught Exception: My custom error in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): {closure}(8, 'A non well form...', '%s', %d, Array)
|
||||
#1 %s(%d): {closure}('7as')
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,85 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72101 (crash on complex code)
|
||||
--FILE--
|
||||
<?php
|
||||
class PHPUnit_Framework_MockObject_Stub_ReturnCallback {
|
||||
protected $callback;
|
||||
public function __construct($callback) {
|
||||
$this->callback = $callback;
|
||||
}
|
||||
public function invoke($invocation) {
|
||||
return call_user_func_array($this->callback, $invocation->parameters);
|
||||
}
|
||||
}
|
||||
|
||||
class PHPUnit_Framework_MockObject_InvocationMocker {
|
||||
protected $matchers = [];
|
||||
public function addMatcher( $matcher) {
|
||||
$this->matchers[] = $matcher;
|
||||
}
|
||||
public function invoke( $invocation) {
|
||||
foreach ($this->matchers as $match) {
|
||||
$match->invoked($invocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class PHPUnit_Framework_MockObject_Matcher {
|
||||
public $stub = null;
|
||||
public function invoked($invocation) {
|
||||
return $this->stub->invoke($invocation);
|
||||
}
|
||||
}
|
||||
|
||||
class MethodCallbackByReference {
|
||||
public function bar(&$a, &$b, $c) {
|
||||
Legacy::bar($a, $b, $c);
|
||||
}
|
||||
public function callback(&$a, &$b, $c) {
|
||||
$b = 1;
|
||||
}
|
||||
}
|
||||
class PHPUnit_Framework_MockObject_Invocation_Static {
|
||||
public $parameters;
|
||||
public function __construct(array $parameters) {
|
||||
$this->parameters = $parameters;
|
||||
}
|
||||
}
|
||||
|
||||
class Mock_MethodCallbackByReference_7b180d26 extends MethodCallbackByReference {
|
||||
public $inv_mocker;
|
||||
public function bar(&$a, &$b, $c) {
|
||||
$arguments = array($a, $b, $c);
|
||||
$result = $this->inv_mocker->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Static(
|
||||
$arguments
|
||||
)
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
set_error_handler(function() {
|
||||
// var_dump(func_get_args());
|
||||
DoesNotExists::$nope = true;
|
||||
}, E_ALL | E_STRICT);
|
||||
|
||||
$foo = new Mock_MethodCallbackByReference_7b180d26();
|
||||
$InvMocker = new PHPUnit_Framework_MockObject_InvocationMocker();
|
||||
$foo->inv_mocker = $InvMocker;
|
||||
$OuterMatcher = new PHPUnit_Framework_MockObject_Matcher();
|
||||
$InvMocker->addMatcher($OuterMatcher);
|
||||
$OuterMatcher->methodNameMatcher = null;
|
||||
$OuterMatcher->stub = new PHPUnit_Framework_MockObject_Stub_ReturnCallback([$foo, 'callback']);
|
||||
$a = $b = $c = 0;
|
||||
$foo->bar($a, $b, $c);
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Class 'DoesNotExists' not found in %sbug72101.php:61
|
||||
Stack trace:
|
||||
#0 %sbug72101.php(8): {closure}(2, 'Parameter 1 to ...', '%s', 8, Array)
|
||||
#1 %sbug72101.php(27): PHPUnit_Framework_MockObject_Stub_ReturnCallback->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
|
||||
#2 %sbug72101.php(19): PHPUnit_Framework_MockObject_Matcher->invoked(Object(PHPUnit_Framework_MockObject_Invocation_Static))
|
||||
#3 %sbug72101.php(51): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
|
||||
#4 %sbug72101.php(72): Mock_MethodCallbackByReference_7b180d26->bar(0, 0, 0)
|
||||
#5 {main}
|
||||
thrown in %sbug72101.php on line 61
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72162 (use-after-free - error_reporting)
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
$var11 = new StdClass();
|
||||
$var16 = error_reporting($var11);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Catchable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72496 (declare public method with signature incompatible with parent private method should not throw a warning)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
private function getFoo()
|
||||
{
|
||||
return 'Foo';
|
||||
}
|
||||
|
||||
private function getBar()
|
||||
{
|
||||
return 'Bar';
|
||||
}
|
||||
|
||||
private function getBaz()
|
||||
{
|
||||
return 'Baz';
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo
|
||||
{
|
||||
public function getFoo($extraArgument)
|
||||
{
|
||||
return $extraArgument;
|
||||
}
|
||||
|
||||
protected function getBar($extraArgument)
|
||||
{
|
||||
return $extraArgument;
|
||||
}
|
||||
|
||||
private function getBaz($extraArgument)
|
||||
{
|
||||
return $extraArgument;
|
||||
}
|
||||
}
|
||||
|
||||
echo "OK\n";
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72508 (strange references after recursive function call and "switch" statement)
|
||||
--FILE--
|
||||
<?php
|
||||
function a ($option) {
|
||||
b($option['bla']);
|
||||
c($option);
|
||||
var_dump($option);
|
||||
}
|
||||
function b (&$string) {
|
||||
$string = 'changed';
|
||||
}
|
||||
function c ($option) {
|
||||
switch ($option['bla']) {
|
||||
default:
|
||||
$copy = $option;
|
||||
$copy['bla'] = 'copy';
|
||||
break;
|
||||
}
|
||||
}
|
||||
a(array('bla' => 'fasel'));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["bla"]=>
|
||||
string(7) "changed"
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72581 (previous property undefined in Exception after deserialization)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$e = new Exception('aaa', 200);
|
||||
|
||||
$a = serialize($e);
|
||||
|
||||
$b = unserialize($a);
|
||||
|
||||
var_dump($b->__toString());
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%s) "Exception: aaa in %sbug72581.php:%d
|
||||
Stack trace:
|
||||
#0 {main}"
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72594 (Calling an earlier instance of an included anonymous class fatals)
|
||||
--INI--
|
||||
opcache.enable=0
|
||||
--FILE--
|
||||
<?php
|
||||
if (isset($runtime)) {
|
||||
return new class {
|
||||
public $bar;
|
||||
public function bing($foo = null) {
|
||||
if ($foo) $foo->bing();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
$runtime = 1;
|
||||
$oldFoo = require(__FILE__);
|
||||
$newFoo = require(__FILE__);
|
||||
|
||||
var_dump(get_class_methods($oldFoo));
|
||||
var_dump(get_object_vars($oldFoo));
|
||||
|
||||
$newFoo->bing($oldFoo);
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(4) "bing"
|
||||
}
|
||||
array(1) {
|
||||
["bar"]=>
|
||||
NULL
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72767: PHP Segfaults when trying to expand an infinite operator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {}
|
||||
$iterator = new LimitIterator(
|
||||
new InfiniteIterator(new ArrayIterator([42])),
|
||||
0, 17000
|
||||
);
|
||||
test(...$iterator);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72813 (Segfault with __get returned by ref)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test
|
||||
{
|
||||
private $props = ['a' => 'text', 'b' => 1];
|
||||
|
||||
public function &__get($prop)
|
||||
{
|
||||
return $this->props[$prop];
|
||||
}
|
||||
|
||||
public function __set($prop, $value)
|
||||
{
|
||||
if ($prop === 'b') $value = [$value];
|
||||
$this->props[$prop] = $value;
|
||||
}
|
||||
|
||||
public function getProperties()
|
||||
{
|
||||
return [$this->props];
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$obj->b = $obj->b;
|
||||
print_r($obj->getProperties());
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[a] => text
|
||||
[b] => Array
|
||||
(
|
||||
[0] => 1
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72854: PHP Crashes on duplicate destructor call
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function get() {
|
||||
$t = new stdClass;
|
||||
$t->prop = $t;
|
||||
return $t;
|
||||
}
|
||||
|
||||
$i = 42;
|
||||
get()->prop =& $i;
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72911 (Memleak in zend_binary_assign_op_obj_helper)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = 0;
|
||||
|
||||
$b = $a->b->i -= 0;
|
||||
|
||||
var_dump($b);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Attempt to modify property of non-object in %sbug72911.php on line %d
|
||||
|
||||
Warning: Attempt to assign property of non-object in %sbug72911.php on line %d
|
||||
NULL
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72943 (assign_dim on string doesn't reset hval)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array("test" => 1);
|
||||
|
||||
$a = "lest";
|
||||
var_dump($array[$a]);
|
||||
$a[0] = "f";
|
||||
var_dump($array[$a]);
|
||||
$a[0] = "t";
|
||||
var_dump($array[$a]);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined index: lest in %sbug72943.php on line %d
|
||||
NULL
|
||||
|
||||
Notice: Undefined index: fest in %sbug72943.php on line %d
|
||||
NULL
|
||||
int(1)
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72944 (Null pointer deref in zval_delref_p).
|
||||
--FILE--
|
||||
<?php
|
||||
"a"== e & $A = $A? 0 : 0 ?:0;
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Use of undefined constant e - assumed 'e' in %sbug72944.php on line 2
|
||||
|
||||
Notice: Undefined variable: A in %sbug72944.php on line 2
|
||||
OK
|
||||
@@ -1,50 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73156 (segfault on undefined function)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public function __call($name, $args) {
|
||||
eval('$args = array(); var_dump(debug_backtrace());');
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
|
||||
$a->test("test");
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["file"]=>
|
||||
string(%d) "%sbug73156.php"
|
||||
["line"]=>
|
||||
int(4)
|
||||
["function"]=>
|
||||
string(4) "eval"
|
||||
}
|
||||
[1]=>
|
||||
array(7) {
|
||||
["file"]=>
|
||||
string(%d) "%sbug73156.php"
|
||||
["line"]=>
|
||||
int(10)
|
||||
["function"]=>
|
||||
string(6) "__call"
|
||||
["class"]=>
|
||||
string(1) "A"
|
||||
["object"]=>
|
||||
object(A)#%d (0) {
|
||||
}
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(4) "test"
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73163 (PHP hangs if error handler throws while accessing undef const in default value)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function doSomething(string $value = UNDEFINED) {
|
||||
}
|
||||
|
||||
set_error_handler(function($errno, $errstr) {
|
||||
throw new Exception($errstr);
|
||||
});
|
||||
|
||||
doSomething();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): {closure}(%s)
|
||||
#1 %s(%d): doSomething()
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73181: parse_str() without a second argument leads to crash
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function x() {
|
||||
parse_str("1&x");
|
||||
var_dump(get_defined_vars());
|
||||
}
|
||||
|
||||
x();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[1]=>
|
||||
string(0) ""
|
||||
["x"]=>
|
||||
string(0) ""
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73337 (try/catch not working with two exceptions inside a same operation)
|
||||
--FILE--
|
||||
<?php
|
||||
class d { function __destruct() { throw new Exception; } }
|
||||
try { new d + new d; } catch (Exception $e) { print "Exception properly caught\n"; }
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Object of class d could not be converted to int in %sbug73337.php on line 3
|
||||
|
||||
Notice: Object of class d could not be converted to int in %sbug73337.php on line 3
|
||||
Exception properly caught
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73338: Ensure exceptions in function init opcodes are cleaned properly
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try { call_user_func(new class { function __destruct () { throw new Error; } }); } catch (Error $e) {}
|
||||
|
||||
set_error_handler(function() { throw new Error; });
|
||||
|
||||
try { var_dump(new stdClass, call_user_func("fail")); } catch (Error $e) {}
|
||||
|
||||
try { (function() { call_user_func("fail"); })(); } catch (Error $e) {}
|
||||
|
||||
try { [new class { static function foo() {} function __destruct () { throw new Error; } }, "foo"](); } catch (Error $e) {}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in %s on line %d
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73350 (Exception::__toString() cause circular references)
|
||||
--FILE--
|
||||
<?php
|
||||
$e = new Exception();
|
||||
|
||||
// This line cause problem :(
|
||||
// Comment it to see the difference.
|
||||
(string) $e;
|
||||
|
||||
// This line show the clue (PHP Warning: ...).
|
||||
var_export($e);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Exception::__set_state(array(
|
||||
'message' => '',
|
||||
'string' => 'Exception in %sbug73350.php:%d
|
||||
Stack trace:
|
||||
#0 {main}',
|
||||
'code' => 0,
|
||||
'file' => '%sbug73350.php',
|
||||
'line' => %d,
|
||||
'trace' =>
|
||||
array (
|
||||
),
|
||||
'previous' => NULL,
|
||||
))
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
call_user_func() should not use FUNC_ARG fetches
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo(&$ref) { $ref = 24; }
|
||||
|
||||
$a = [];
|
||||
call_user_func('foo', $a[0][0]);
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined offset: 0 in %s on line %d
|
||||
|
||||
Warning: Parameter 1 to foo() expected to be a reference, value given in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
--TEST--
|
||||
call_user_func_array() passes value to prefer-ref arg if element wasn't a reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace {
|
||||
call_user_func_array('array_multisort', [[3, 2, 1]]);
|
||||
|
||||
$args = [[3, 2, 1]];
|
||||
call_user_func_array('array_multisort', $args);
|
||||
var_dump($args);
|
||||
unset($args);
|
||||
|
||||
$array = [3, 2, 1];
|
||||
call_user_func('array_multisort', $array);
|
||||
var_dump($array);
|
||||
unset($array);
|
||||
}
|
||||
|
||||
namespace Foo {
|
||||
call_user_func_array('array_multisort', [[3, 2, 1]]);
|
||||
|
||||
$args = [[3, 2, 1]];
|
||||
call_user_func_array('array_multisort', $args);
|
||||
var_dump($args);
|
||||
unset($args);
|
||||
|
||||
$array = [3, 2, 1];
|
||||
call_user_func('array_multisort', $array);
|
||||
var_dump($array);
|
||||
unset($array);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Constexpr arrays should be able to handle resource keys
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
const FOO = [STDIN => 42];
|
||||
var_dump(FOO);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
--TEST--
|
||||
Constant expressions with null coalescing operator ??
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
const A = [1 => [[]]];
|
||||
|
||||
const T_1 = null ?? A[1]['undefined']['index'] ?? 1;
|
||||
const T_2 = null ?? A['undefined']['index'] ?? 2;
|
||||
const T_3 = null ?? A[1][0][2] ?? 3;
|
||||
const T_4 = A[1][0][2] ?? 4;
|
||||
const T_5 = null ?? __LINE__;
|
||||
const T_6 = __LINE__ ?? "bar";
|
||||
|
||||
var_dump(T_1);
|
||||
var_dump(T_2);
|
||||
var_dump(T_3);
|
||||
var_dump(T_4);
|
||||
var_dump(T_5);
|
||||
var_dump(T_6);
|
||||
|
||||
var_dump((function(){ static $var = null ?? A[1]['undefined']['index'] ?? 1; return $var; })());
|
||||
var_dump((function(){ static $var = null ?? A['undefined']['index'] ?? 2; return $var; })());
|
||||
var_dump((function(){ static $var = null ?? A[1][0][2] ?? 3; return $var; })());
|
||||
var_dump((function(){ static $var = A[1][0][2] ?? 4; return $var; })());
|
||||
|
||||
var_dump((new class { public $var = null ?? A[1]['undefined']['index'] ?? 1; })->var);
|
||||
var_dump((new class { public $var = null ?? A['undefined']['index'] ?? 2; })->var);
|
||||
var_dump((new class { public $var = null ?? A[1][0][2] ?? 3; })->var);
|
||||
var_dump((new class { public $var = A[1][0][2] ?? 4; })->var);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(4)
|
||||
int(%d)
|
||||
int(%d)
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(4)
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(4)
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Constant expressions with empty dimension fetch on coalesce
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
const A = [][] ?? 1;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use [] for reading in %s.php on line %d
|
||||
|
||||
@@ -35,12 +35,10 @@ const T_19 = [
|
||||
false => false,
|
||||
true => true,
|
||||
];
|
||||
eval("const T_20x = 'a';");
|
||||
const T_20 = null ?: (T_20x . 'bc');
|
||||
|
||||
var_dump(
|
||||
T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9, T_10,
|
||||
T_11, T_12, T_13, T_14, T_15, T_16, T_17, T_18, T_19, T_20
|
||||
T_11, T_12, T_13, T_14, T_15, T_16, T_17, T_18, T_19
|
||||
);
|
||||
|
||||
?>
|
||||
@@ -77,4 +75,3 @@ array(6) {
|
||||
[1]=>
|
||||
bool(true)
|
||||
}
|
||||
string(3) "abc"
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns RESOURCE
|
||||
--INI--
|
||||
allow_url_fopen=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Crash when using dynamic call syntax with fully qualified name in a namespace
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
try {
|
||||
('\bar')();
|
||||
} catch (\Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Call to undefined function bar()
|
||||
@@ -3,12 +3,10 @@ Testing each() with array and object
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = new stdClass;
|
||||
$foo = each($a);
|
||||
$foo = each(new stdClass);
|
||||
var_dump($foo);
|
||||
|
||||
$a = new stdClass;
|
||||
var_dump(each($a));
|
||||
var_dump(each(new stdClass));
|
||||
|
||||
$a = array(new stdClass);
|
||||
var_dump(each($a));
|
||||
|
||||
@@ -40,10 +40,11 @@ Stack trace:
|
||||
#2 %s(%d): Generator->next()
|
||||
#3 {main}
|
||||
Generator 1
|
||||
Caught exception!
|
||||
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
|
||||
|
||||
Fatal error: Uncaught ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: gen(Object(Generator))
|
||||
#1 %s(%d): Generator->current()
|
||||
#2 {main}
|
||||
NULL
|
||||
thrown in %s on line %d
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Cannot "yield from" from force closed generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen1() {
|
||||
echo "gen1\n";
|
||||
yield 1;
|
||||
}
|
||||
|
||||
function gen2() {
|
||||
try {
|
||||
echo "try\n";
|
||||
yield from gen1();
|
||||
} finally {
|
||||
echo "finally\n";
|
||||
yield from gen1();
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$gen = gen2();
|
||||
$gen->rewind();
|
||||
unset($gen);
|
||||
} catch (Error $e) {
|
||||
echo $e, "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
try
|
||||
gen1
|
||||
finally
|
||||
Error: Cannot use "yield from" in a force-closed generator in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): gen2()
|
||||
#1 {main}
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Leak when using an invalid parent:: reference in a constant definition
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
const B = parent::C;
|
||||
}
|
||||
|
||||
try {
|
||||
A::B;
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Cannot access parent:: when current class scope has no parent
|
||||
@@ -2,13 +2,6 @@
|
||||
int memory_get_peak_usage ([ bool $real_usage = false ] );
|
||||
--CREDITS--
|
||||
marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
|
||||
if ($zend_mm_enabled === "0") {
|
||||
die("skip Zend MM disabled");
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
memory_limit=-1
|
||||
--FILE--
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Indirect modification of isref by-value return value not possible
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public $b;
|
||||
}
|
||||
|
||||
$arr = [];
|
||||
|
||||
$a = new A;
|
||||
$a->b =& $arr;
|
||||
|
||||
(new ReflectionProperty('A', 'b'))->getValue($a)[] = 42;
|
||||
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(A)#1 (1) {
|
||||
["b"]=>
|
||||
&array(0) {
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Class declaration colliding with import (in namespace)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo {
|
||||
class Bar {}
|
||||
}
|
||||
|
||||
namespace Bazzle {
|
||||
use Foo\Bar;
|
||||
class Bar {}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot declare class Bazzle\Bar because the name is already in use in %s on line %d
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Function declaration colliding with import (in namespace)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo {
|
||||
function bar() {}
|
||||
}
|
||||
|
||||
namespace Bazzle {
|
||||
use function Foo\bar;
|
||||
function bar() {}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot declare function Bazzle\bar because the name is already in use in %s on line %d
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Class declaration colliding with import (in namespace)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo {
|
||||
const BAR = 42;
|
||||
}
|
||||
|
||||
namespace Bazzle {
|
||||
use const Foo\BAR;
|
||||
const BAR = 24;
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot declare const Bazzle\BAR because the name is already in use in %s on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Leak in QM_ASSIGN when unwrapping references (rc=1)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function &ref() {
|
||||
$str = "str";
|
||||
$str .= "str";
|
||||
return $str;
|
||||
}
|
||||
|
||||
var_dump(true ? ref() : ref());
|
||||
var_dump(ref() ?: ref());
|
||||
var_dump(ref() ?? ref());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "strstr"
|
||||
string(6) "strstr"
|
||||
string(6) "strstr"
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69579 (Internal trait double-free)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!PHP_DEBUG) die("skip only run in debug version");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Bar{
|
||||
use _ZendTestTrait;
|
||||
}
|
||||
|
||||
$bar = new Bar();
|
||||
var_dump($bar->testMethod());
|
||||
// destruction causes a double-free and explodes
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -12,8 +12,8 @@ final class e { }
|
||||
var_dump(get_declared_traits());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(%d) {%A
|
||||
[%d]=>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "c"
|
||||
}
|
||||
@@ -13,8 +13,8 @@ namespace test {
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(%d) {%A
|
||||
[%d]=>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(6) "test\c"
|
||||
}
|
||||
@@ -13,15 +13,13 @@ var_dump(get_declared_traits());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(%d) {%A
|
||||
[%d]=>
|
||||
string(1) "a"
|
||||
%astring(1) "a"
|
||||
[%d]=>
|
||||
string(1) "d"
|
||||
[%d]=>
|
||||
string(1) "e"
|
||||
}
|
||||
array(%d) {%A
|
||||
[%d]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "c"
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72629 (Caught exception assignment to variables ignores references)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$var = null;
|
||||
$e = &$var;
|
||||
|
||||
try {
|
||||
throw new Exception;
|
||||
} catch (Exception $e) { }
|
||||
|
||||
var_dump($var === $e);
|
||||
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
"use function" should not conflict with class names
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
|
||||
class Bar {}
|
||||
|
||||
use function bar;
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Use conflicts should not occur across files
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/use_no_file_conflict_1.inc';
|
||||
require __DIR__ . '/use_no_file_conflict_2.inc';
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
class A {}
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
use A;
|
||||
+3
-13
@@ -678,19 +678,9 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
|
||||
|
||||
#if HAVE_DTRACE
|
||||
/* build with dtrace support */
|
||||
{
|
||||
char *tmp = getenv("USE_ZEND_DTRACE");
|
||||
|
||||
if (tmp && zend_atoi(tmp, 0)) {
|
||||
zend_compile_file = dtrace_compile_file;
|
||||
zend_execute_ex = dtrace_execute_ex;
|
||||
zend_execute_internal = dtrace_execute_internal;
|
||||
} else {
|
||||
zend_compile_file = compile_file;
|
||||
zend_execute_ex = execute_ex;
|
||||
zend_execute_internal = NULL;
|
||||
}
|
||||
}
|
||||
zend_compile_file = dtrace_compile_file;
|
||||
zend_execute_ex = dtrace_execute_ex;
|
||||
zend_execute_internal = dtrace_execute_internal;
|
||||
#else
|
||||
zend_compile_file = compile_file;
|
||||
zend_execute_ex = execute_ex;
|
||||
|
||||
+5
-22
@@ -197,6 +197,7 @@ ZEND_API char *zend_zval_type_name(const zval *arg) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef FAST_ZPP
|
||||
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args) /* {{{ */
|
||||
{
|
||||
zend_function *active_function = EG(current_execute_data)->func;
|
||||
@@ -290,6 +291,7 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc
|
||||
return 1;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
ZEND_API int ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest) /* {{{ */
|
||||
{
|
||||
@@ -1859,7 +1861,7 @@ static int zend_startup_module_zval(zval *zv) /* {{{ */
|
||||
{
|
||||
zend_module_entry *module = Z_PTR_P(zv);
|
||||
|
||||
return (zend_startup_module_ex(module) == SUCCESS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
return zend_startup_module_ex(module);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3098,13 +3100,13 @@ get_function_via_handler:
|
||||
|
||||
if (retval) {
|
||||
if (fcc->calling_scope && !call_via_handler) {
|
||||
if (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
if (!fcc->object && (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
if (error) {
|
||||
zend_spprintf(error, 0, "cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
|
||||
retval = 0;
|
||||
} else {
|
||||
zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
|
||||
retval = 0;
|
||||
return 0;
|
||||
}
|
||||
} else if (!fcc->object && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
int severity;
|
||||
@@ -3356,7 +3358,6 @@ again:
|
||||
memcpy(ZSTR_VAL(*callable_name), ZSTR_VAL(ce->name), ZSTR_LEN(ce->name));
|
||||
memcpy(ZSTR_VAL(*callable_name) + ZSTR_LEN(ce->name), "::__invoke", sizeof("::__invoke"));
|
||||
}
|
||||
fcc->initialized = 1;
|
||||
return 1;
|
||||
}
|
||||
if (callable_name) {
|
||||
@@ -3847,24 +3848,6 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, c
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length) /* {{{ */
|
||||
{
|
||||
zval property;
|
||||
zend_class_entry *old_scope = EG(scope);
|
||||
|
||||
EG(scope) = scope;
|
||||
|
||||
if (!Z_OBJ_HT_P(object)->unset_property) {
|
||||
zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be unset", name, ZSTR_VAL(Z_OBJCE_P(object)->name));
|
||||
}
|
||||
ZVAL_STRINGL(&property, name, name_length);
|
||||
Z_OBJ_HT_P(object)->unset_property(object, &property, 0);
|
||||
zval_ptr_dtor(&property);
|
||||
|
||||
EG(scope) = old_scope;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value) /* {{{ */
|
||||
{
|
||||
zval tmp;
|
||||
|
||||
+8
-4
@@ -343,7 +343,6 @@ ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object,
|
||||
ZEND_API void zend_update_property_str(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_string *value);
|
||||
ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value);
|
||||
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value, size_t value_length);
|
||||
ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length);
|
||||
|
||||
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value);
|
||||
ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, size_t name_length);
|
||||
@@ -477,7 +476,8 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
|
||||
|
||||
/** Build zend_call_info/cache from a zval*
|
||||
*
|
||||
* Caller is responsible to provide a return value (fci->retval), otherwise the we will crash.
|
||||
* Caller is responsible to provide a return value, otherwise the we will crash.
|
||||
* fci->retval_ptr_ptr = NULL;
|
||||
* In order to pass parameters the following members need to be set:
|
||||
* fci->param_count = 0;
|
||||
* fci->params = NULL;
|
||||
@@ -666,11 +666,13 @@ END_EXTERN_C()
|
||||
|
||||
/* Fast parameter parsing API */
|
||||
|
||||
/* Fast ZPP is always enabled now; this define is left in for compatibility
|
||||
* with any existing conditional compilation blocks.
|
||||
/* This API should be used only for really often used functions.
|
||||
* (Keep the original parsing code and wrap usage with #ifndef FAST_ZPP)
|
||||
*/
|
||||
#define FAST_ZPP 1
|
||||
|
||||
#ifdef FAST_ZPP
|
||||
|
||||
#define Z_EXPECTED_TYPES(_) \
|
||||
_(Z_EXPECTED_LONG, "integer") \
|
||||
_(Z_EXPECTED_BOOL, "boolean") \
|
||||
@@ -1033,6 +1035,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, in
|
||||
#define Z_PARAM_VARIADIC(spec, dest, dest_num) \
|
||||
Z_PARAM_VARIADIC_EX(spec, dest, dest_num, 0)
|
||||
|
||||
#endif /* FAST_ZPP */
|
||||
|
||||
/* End of new parameter parsing API */
|
||||
|
||||
/* Inlined implementations shared by new and old parameter parsing APIs */
|
||||
|
||||
+33
-31
@@ -897,7 +897,6 @@ static void *zend_mm_alloc_pages(zend_mm_heap *heap, int pages_count ZEND_FILE_L
|
||||
{
|
||||
zend_mm_chunk *chunk = heap->main_chunk;
|
||||
int page_num, len;
|
||||
int steps = 0;
|
||||
|
||||
while (1) {
|
||||
if (UNEXPECTED(chunk->free_pages < pages_count)) {
|
||||
@@ -1074,20 +1073,10 @@ get_chunk:
|
||||
goto found;
|
||||
} else {
|
||||
chunk = chunk->next;
|
||||
steps++;
|
||||
}
|
||||
}
|
||||
|
||||
found:
|
||||
if (steps > 2 && pages_count < 8) {
|
||||
/* move chunk into the head of the linked-list */
|
||||
chunk->prev->next = chunk->next;
|
||||
chunk->next->prev = chunk->prev;
|
||||
chunk->next = heap->main_chunk->next;
|
||||
chunk->prev = heap->main_chunk;
|
||||
chunk->prev->next = chunk;
|
||||
chunk->next->prev = chunk;
|
||||
}
|
||||
/* mark run as allocated */
|
||||
chunk->free_pages -= pages_count;
|
||||
zend_mm_bitset_set_range(chunk->free_map, page_num, pages_count);
|
||||
@@ -1483,7 +1472,7 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
|
||||
#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
|
||||
* 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));
|
||||
@@ -1559,21 +1548,21 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
|
||||
|
||||
ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
|
||||
if (info & ZEND_MM_IS_SRUN) {
|
||||
int old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
|
||||
int old_bin_num, bin_num;
|
||||
|
||||
old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
|
||||
old_size = bin_data_size[old_bin_num];
|
||||
if (size <= ZEND_MM_MAX_SMALL_SIZE) {
|
||||
int bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
|
||||
if (old_bin_num == bin_num) {
|
||||
bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
|
||||
if (old_bin_num == bin_num) {
|
||||
#if ZEND_DEBUG
|
||||
dbg = zend_mm_get_debug_info(heap, ptr);
|
||||
dbg->size = real_size;
|
||||
dbg->filename = __zend_filename;
|
||||
dbg->orig_filename = __zend_orig_filename;
|
||||
dbg->lineno = __zend_lineno;
|
||||
dbg->orig_lineno = __zend_orig_lineno;
|
||||
dbg = zend_mm_get_debug_info(heap, ptr);
|
||||
dbg->size = real_size;
|
||||
dbg->filename = __zend_filename;
|
||||
dbg->orig_filename = __zend_orig_filename;
|
||||
dbg->lineno = __zend_lineno;
|
||||
dbg->orig_lineno = __zend_orig_lineno;
|
||||
#endif
|
||||
return ptr;
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
} else /* if (info & ZEND_MM_IS_LARGE_RUN) */ {
|
||||
ZEND_MM_CHECK(ZEND_MM_ALIGNED_OFFSET(page_offset, ZEND_MM_PAGE_SIZE) == 0, "zend_mm_heap corrupted");
|
||||
@@ -1751,7 +1740,7 @@ static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D
|
||||
{
|
||||
#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
|
||||
* 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));
|
||||
@@ -2511,24 +2500,37 @@ ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr ZEND_FILE_LINE_DC Z
|
||||
return zend_mm_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
|
||||
static zend_always_inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
|
||||
{
|
||||
int overflow;
|
||||
size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
|
||||
|
||||
if (UNEXPECTED(overflow)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
|
||||
return 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void* ZEND_FASTCALL _safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
return emalloc_rel(zend_safe_address_guarded(nmemb, size, offset));
|
||||
return emalloc_rel(safe_address(nmemb, size, offset));
|
||||
}
|
||||
|
||||
ZEND_API void* ZEND_FASTCALL _safe_malloc(size_t nmemb, size_t size, size_t offset)
|
||||
{
|
||||
return pemalloc(zend_safe_address_guarded(nmemb, size, offset), 1);
|
||||
return pemalloc(safe_address(nmemb, size, offset), 1);
|
||||
}
|
||||
|
||||
ZEND_API void* ZEND_FASTCALL _safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
return erealloc_rel(ptr, zend_safe_address_guarded(nmemb, size, offset));
|
||||
return erealloc_rel(ptr, safe_address(nmemb, size, offset));
|
||||
}
|
||||
|
||||
ZEND_API void* ZEND_FASTCALL _safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset)
|
||||
{
|
||||
return perealloc(ptr, zend_safe_address_guarded(nmemb, size, offset), 1);
|
||||
return perealloc(ptr, safe_address(nmemb, size, offset), 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -2644,9 +2646,9 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
|
||||
alloc_globals->mm_heap = malloc(sizeof(zend_mm_heap));
|
||||
memset(alloc_globals->mm_heap, 0, sizeof(zend_mm_heap));
|
||||
alloc_globals->mm_heap->use_custom_heap = ZEND_MM_CUSTOM_HEAP_STD;
|
||||
alloc_globals->mm_heap->custom_heap.std._malloc = __zend_malloc;
|
||||
alloc_globals->mm_heap->custom_heap.std._malloc = malloc;
|
||||
alloc_globals->mm_heap->custom_heap.std._free = free;
|
||||
alloc_globals->mm_heap->custom_heap.std._realloc = __zend_realloc;
|
||||
alloc_globals->mm_heap->custom_heap.std._realloc = realloc;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
+3
-40
@@ -181,11 +181,7 @@ static int zend_ast_add_array_element(zval *result, zval *offset, zval *expr)
|
||||
{
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_UNDEF:
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(result), expr)) {
|
||||
zend_error(E_WARNING,
|
||||
"Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr);
|
||||
}
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(result), expr);
|
||||
break;
|
||||
case IS_STRING:
|
||||
zend_symtable_update(Z_ARRVAL_P(result), Z_STR_P(offset), expr);
|
||||
@@ -206,10 +202,6 @@ static int zend_ast_add_array_element(zval *result, zval *offset, zval *expr)
|
||||
case IS_DOUBLE:
|
||||
zend_hash_index_update(Z_ARRVAL_P(result), zend_dval_to_lval(Z_DVAL_P(offset)), expr);
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
zend_error(E_NOTICE, "Resource ID#%d used as offset, casting to integer (%d)", Z_RES_HANDLE_P(offset), Z_RES_HANDLE_P(offset));
|
||||
zend_hash_index_update(Z_ARRVAL_P(result), Z_RES_HANDLE_P(offset), expr);
|
||||
break;
|
||||
default:
|
||||
zend_throw_error(NULL, "Illegal offset type");
|
||||
return FAILURE;
|
||||
@@ -345,22 +337,6 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc
|
||||
zval_dtor(&op1);
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_COALESCE:
|
||||
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
|
||||
ret = FAILURE;
|
||||
break;
|
||||
}
|
||||
if (Z_TYPE(op1) > IS_NULL) {
|
||||
*result = op1;
|
||||
} else {
|
||||
if (UNEXPECTED(zend_ast_evaluate(result, ast->child[1], scope) != SUCCESS)) {
|
||||
zval_dtor(&op1);
|
||||
ret = FAILURE;
|
||||
break;
|
||||
}
|
||||
zval_dtor(&op1);
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_UNARY_PLUS:
|
||||
if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[0], scope) != SUCCESS)) {
|
||||
ret = FAILURE;
|
||||
@@ -409,10 +385,6 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_DIM:
|
||||
if (ast->child[1] == NULL) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
|
||||
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
|
||||
ret = FAILURE;
|
||||
} else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
|
||||
@@ -421,12 +393,7 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc
|
||||
} else {
|
||||
zval tmp;
|
||||
|
||||
if (ast->attr == ZEND_DIM_IS) {
|
||||
zend_fetch_dimension_by_zval_is(&tmp, &op1, &op2, IS_CONST);
|
||||
} else {
|
||||
zend_fetch_dimension_by_zval(&tmp, &op1, &op2);
|
||||
}
|
||||
|
||||
zend_fetch_dimension_by_zval(&tmp, &op1, &op2);
|
||||
if (UNEXPECTED(Z_ISREF(tmp))) {
|
||||
ZVAL_DUP(result, Z_REFVAL(tmp));
|
||||
} else {
|
||||
@@ -1225,11 +1192,7 @@ simple_list:
|
||||
if (ast->child[0]->kind == ZEND_AST_ENCAPS_LIST) {
|
||||
zend_ast_export_encaps_list(str, '`', (zend_ast_list*)ast->child[0], indent);
|
||||
} else {
|
||||
zval *zv;
|
||||
ZEND_ASSERT(ast->child[0]->kind == ZEND_AST_ZVAL);
|
||||
zv = zend_ast_get_zval(ast->child[0]);
|
||||
ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING);
|
||||
zend_ast_export_qstr(str, '`', Z_STR_P(zv));
|
||||
zend_ast_export_ex(str, ast->child[0], 0, indent);
|
||||
}
|
||||
smart_str_appendc(str, '`');
|
||||
break;
|
||||
|
||||
@@ -31,10 +31,6 @@
|
||||
|
||||
#undef ZEND_TEST_EXCEPTIONS
|
||||
|
||||
#if ZEND_DEBUG
|
||||
static zend_class_entry *zend_test_trait;
|
||||
#endif
|
||||
|
||||
static ZEND_FUNCTION(zend_version);
|
||||
static ZEND_FUNCTION(func_num_args);
|
||||
static ZEND_FUNCTION(func_get_arg);
|
||||
@@ -261,18 +257,6 @@ ZEND_END_ARG_INFO()
|
||||
|
||||
/* }}} */
|
||||
|
||||
#if ZEND_DEBUG
|
||||
static ZEND_METHOD(_ZendTestTrait, testMethod) /* {{{ */ {
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_function_entry zend_test_trait_methods[] = {
|
||||
ZEND_ME(_ZendTestTrait, testMethod, arginfo_zend__void, ZEND_ACC_PUBLIC)
|
||||
ZEND_FE_END
|
||||
};
|
||||
#endif
|
||||
|
||||
static const zend_function_entry builtin_functions[] = { /* {{{ */
|
||||
ZEND_FE(zend_version, arginfo_zend__void)
|
||||
ZEND_FE(func_num_args, arginfo_zend__void)
|
||||
@@ -355,13 +339,6 @@ ZEND_MINIT_FUNCTION(core) { /* {{{ */
|
||||
|
||||
zend_register_default_classes();
|
||||
|
||||
#if ZEND_DEBUG
|
||||
INIT_CLASS_ENTRY(class_entry, "_ZendTestTrait", zend_test_trait_methods);
|
||||
zend_test_trait = zend_register_internal_class(&class_entry);
|
||||
zend_test_trait->ce_flags |= ZEND_ACC_TRAIT;
|
||||
zend_declare_property_null(zend_test_trait, "testProp", sizeof("testProp")-1, ZEND_ACC_PUBLIC);
|
||||
#endif
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -567,9 +544,15 @@ ZEND_FUNCTION(strlen)
|
||||
{
|
||||
zend_string *s;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &s) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(s)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETVAL_LONG(ZSTR_LEN(s));
|
||||
}
|
||||
@@ -709,14 +692,19 @@ ZEND_FUNCTION(error_reporting)
|
||||
zval *err;
|
||||
int old_error_reporting;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &err) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(0, 1)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_ZVAL(err)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
old_error_reporting = EG(error_reporting);
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
zend_string *new_val = zval_get_string(err);
|
||||
if(ZEND_NUM_ARGS() != 0) {
|
||||
do {
|
||||
zend_ini_entry *p = EG(error_reporting_ini_entry);
|
||||
|
||||
@@ -742,7 +730,7 @@ ZEND_FUNCTION(error_reporting)
|
||||
zend_string_release(p->value);
|
||||
}
|
||||
|
||||
p->value = new_val;
|
||||
p->value = zval_get_string(err);
|
||||
if (Z_TYPE_P(err) == IS_LONG) {
|
||||
EG(error_reporting) = Z_LVAL_P(err);
|
||||
} else {
|
||||
@@ -826,12 +814,18 @@ ZEND_FUNCTION(define)
|
||||
int case_sensitive = CONST_CS;
|
||||
zend_constant c;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &name, &val, &non_cs) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 3)
|
||||
Z_PARAM_STR(name)
|
||||
Z_PARAM_ZVAL(val)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(non_cs)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (non_cs) {
|
||||
case_sensitive = 0;
|
||||
@@ -912,9 +906,15 @@ ZEND_FUNCTION(defined)
|
||||
{
|
||||
zend_string *name;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(name)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (zend_get_constant_ex(name, NULL, ZEND_FETCH_CLASS_SILENT)) {
|
||||
RETURN_TRUE;
|
||||
@@ -1010,12 +1010,18 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /*
|
||||
zend_bool allow_string = only_subclass;
|
||||
zend_bool retval;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS|b", &obj, &class_name, &allow_string) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 3)
|
||||
Z_PARAM_ZVAL(obj)
|
||||
Z_PARAM_STR(class_name)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(allow_string)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
/*
|
||||
* allow_string - is_a default is no, is_subclass_of is yes.
|
||||
* if it's allowed, then the autoloader will be called if the class does not exist.
|
||||
@@ -1155,9 +1161,15 @@ ZEND_FUNCTION(get_object_vars)
|
||||
zend_string *key;
|
||||
zend_object *zobj;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_OBJECT(obj)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (Z_OBJ_HT_P(obj)->get_properties == NULL) {
|
||||
RETURN_FALSE;
|
||||
@@ -1293,11 +1305,16 @@ ZEND_FUNCTION(method_exists)
|
||||
zend_string *lcname;
|
||||
zend_class_entry * ce;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS", &klass, &method_name) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_ZVAL(klass)
|
||||
Z_PARAM_STR(method_name)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
#endif
|
||||
if (Z_TYPE_P(klass) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(klass);
|
||||
} else if (Z_TYPE_P(klass) == IS_STRING) {
|
||||
@@ -1393,11 +1410,17 @@ ZEND_FUNCTION(class_exists)
|
||||
zend_class_entry *ce;
|
||||
zend_bool autoload = 1;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &class_name, &autoload) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_STR(class_name)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(autoload)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (!autoload) {
|
||||
if (ZSTR_VAL(class_name)[0] == '\\') {
|
||||
@@ -1430,11 +1453,17 @@ ZEND_FUNCTION(interface_exists)
|
||||
zend_class_entry *ce;
|
||||
zend_bool autoload = 1;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &iface_name, &autoload) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_STR(iface_name)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(autoload)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (!autoload) {
|
||||
if (ZSTR_VAL(iface_name)[0] == '\\') {
|
||||
@@ -1466,11 +1495,17 @@ ZEND_FUNCTION(trait_exists)
|
||||
zend_class_entry *ce;
|
||||
zend_bool autoload = 1;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &trait_name, &autoload) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_STR(trait_name)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(autoload)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (!autoload) {
|
||||
if (ZSTR_VAL(trait_name)[0] == '\\') {
|
||||
@@ -1503,9 +1538,15 @@ ZEND_FUNCTION(function_exists)
|
||||
zend_function *func;
|
||||
zend_string *lcname;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(name)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (ZSTR_VAL(name)[0] == '\\') {
|
||||
/* Ignore leading "\" */
|
||||
@@ -2211,33 +2252,9 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
|
||||
zend_hash_real_init(Z_ARRVAL_P(arg_array), 1);
|
||||
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(arg_array)) {
|
||||
if (call->func->type == ZEND_USER_FUNCTION) {
|
||||
uint32_t first_extra_arg = MIN(num_args, call->func->op_array.num_args);
|
||||
uint32_t first_extra_arg = call->func->op_array.num_args;
|
||||
|
||||
if (UNEXPECTED(call->symbol_table)) {
|
||||
/* In case of attached symbol_table, values on stack may be invalid
|
||||
* and we have to access them through symbol_table
|
||||
* See: https://bugs.php.net/bug.php?id=73156
|
||||
*/
|
||||
zend_string *arg_name;
|
||||
zval *arg;
|
||||
|
||||
while (i < first_extra_arg) {
|
||||
arg_name = call->func->op_array.vars[i];
|
||||
arg = zend_hash_find_ind(call->symbol_table, arg_name);
|
||||
if (arg) {
|
||||
if (Z_OPT_REFCOUNTED_P(arg)) {
|
||||
Z_ADDREF_P(arg);
|
||||
}
|
||||
n++;
|
||||
ZEND_HASH_FILL_ADD(arg);
|
||||
} else {
|
||||
zval tmp;
|
||||
ZVAL_UNDEF(&tmp);
|
||||
ZEND_HASH_FILL_ADD(&tmp);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
if (ZEND_CALL_NUM_ARGS(call) > first_extra_arg) {
|
||||
while (i < first_extra_arg) {
|
||||
if (EXPECTED(Z_TYPE_INFO_P(p) != IS_UNDEF)) {
|
||||
if (Z_OPT_REFCOUNTED_P(p)) {
|
||||
@@ -2249,8 +2266,8 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
|
||||
p++;
|
||||
i++;
|
||||
}
|
||||
p = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T);
|
||||
}
|
||||
p = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T);
|
||||
}
|
||||
|
||||
while (i < num_args) {
|
||||
@@ -2370,10 +2387,8 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
if (object) {
|
||||
if (func->common.scope) {
|
||||
class_name = func->common.scope->name;
|
||||
} else if (object->handlers->get_class_name == std_object_handlers.get_class_name) {
|
||||
class_name = object->ce->name;
|
||||
} else {
|
||||
class_name = object->handlers->get_class_name(object);
|
||||
class_name = object->ce->name;
|
||||
}
|
||||
|
||||
call_type = "->";
|
||||
@@ -2433,11 +2448,6 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
if (class_name) {
|
||||
ZEND_PUTS(ZSTR_VAL(class_name));
|
||||
ZEND_PUTS(call_type);
|
||||
if (object
|
||||
&& !func->common.scope
|
||||
&& object->handlers->get_class_name != std_object_handlers.get_class_name) {
|
||||
zend_string_release(class_name);
|
||||
}
|
||||
}
|
||||
zend_printf("%s(", function_name);
|
||||
if (Z_TYPE(arg_array) != IS_UNDEF) {
|
||||
@@ -2597,11 +2607,9 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
if (object) {
|
||||
if (func->common.scope) {
|
||||
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, zend_string_copy(func->common.scope->name));
|
||||
} else if (object->handlers->get_class_name == std_object_handlers.get_class_name) {
|
||||
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, zend_string_copy(object->ce->name));
|
||||
} else {
|
||||
zend_string *class_name = object->handlers->get_class_name(object);
|
||||
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, class_name);
|
||||
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, zend_string_copy(object->ce->name));
|
||||
|
||||
}
|
||||
if ((options & DEBUG_BACKTRACE_PROVIDE_OBJECT) != 0) {
|
||||
zval zv;
|
||||
|
||||
+95
-181
@@ -773,7 +773,6 @@ zend_string *zend_resolve_non_class_name(
|
||||
|
||||
if (ZSTR_VAL(name)[0] == '\\') {
|
||||
/* Remove \ prefix (only relevant if this is a string rather than a label) */
|
||||
*is_fully_qualified = 1;
|
||||
return zend_string_init(ZSTR_VAL(name) + 1, ZSTR_LEN(name) - 1, 0);
|
||||
}
|
||||
|
||||
@@ -1944,42 +1943,10 @@ static inline uint32_t zend_emit_jump(uint32_t opnum_target) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zend_is_smart_branch(zend_op *opline) /* {{{ */
|
||||
{
|
||||
switch (opline->opcode) {
|
||||
case ZEND_IS_IDENTICAL:
|
||||
case ZEND_IS_NOT_IDENTICAL:
|
||||
case ZEND_IS_EQUAL:
|
||||
case ZEND_IS_NOT_EQUAL:
|
||||
case ZEND_IS_SMALLER:
|
||||
case ZEND_IS_SMALLER_OR_EQUAL:
|
||||
case ZEND_CASE:
|
||||
case ZEND_ISSET_ISEMPTY_VAR:
|
||||
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
|
||||
case ZEND_ISSET_ISEMPTY_PROP_OBJ:
|
||||
case ZEND_INSTANCEOF:
|
||||
case ZEND_TYPE_CHECK:
|
||||
case ZEND_DEFINED:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static inline uint32_t zend_emit_cond_jump(zend_uchar opcode, znode *cond, uint32_t opnum_target) /* {{{ */
|
||||
{
|
||||
uint32_t opnum = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline;
|
||||
|
||||
if ((cond->op_type & (IS_CV|IS_CONST))
|
||||
&& opnum > 0
|
||||
&& zend_is_smart_branch(CG(active_op_array)->opcodes + opnum - 1)) {
|
||||
/* emit extra NOP to avoid incorrect SMART_BRANCH in very rare cases */
|
||||
zend_emit_op(NULL, ZEND_NOP, NULL, NULL);
|
||||
opnum = get_next_op_number(CG(active_op_array));
|
||||
}
|
||||
opline = zend_emit_op(NULL, opcode, cond, NULL);
|
||||
zend_op *opline = zend_emit_op(NULL, opcode, cond, NULL);
|
||||
opline->op2.opline_num = opnum_target;
|
||||
return opnum;
|
||||
}
|
||||
@@ -3102,9 +3069,19 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
|
||||
zend_ast *arg_ast = args->child[i];
|
||||
znode arg_node;
|
||||
zend_op *opline;
|
||||
zend_bool send_user = 0;
|
||||
|
||||
zend_compile_expr(&arg_node, arg_ast);
|
||||
if (arg_node.op_type & (IS_VAR|IS_CV)) {
|
||||
if (zend_is_variable(arg_ast) && !zend_is_call(arg_ast)) {
|
||||
zend_compile_var(&arg_node, arg_ast, BP_VAR_FUNC_ARG | (i << BP_VAR_SHIFT));
|
||||
send_user = 1;
|
||||
} else {
|
||||
zend_compile_expr(&arg_node, arg_ast);
|
||||
if (arg_node.op_type & (IS_VAR|IS_CV)) {
|
||||
send_user = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (send_user) {
|
||||
opline = zend_emit_op(NULL, ZEND_SEND_USER, &arg_node, NULL);
|
||||
} else {
|
||||
opline = zend_emit_op(NULL, ZEND_SEND_VAL, &arg_node, NULL);
|
||||
@@ -3191,14 +3168,6 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (zend_string_equals_literal(lcname, "assert")) {
|
||||
return zend_compile_assert(result, args, lcname, fbc);
|
||||
}
|
||||
|
||||
if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (zend_string_equals_literal(lcname, "strlen")) {
|
||||
return zend_compile_func_strlen(result, args);
|
||||
} else if (zend_string_equals_literal(lcname, "is_null")) {
|
||||
@@ -3229,6 +3198,8 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
|
||||
return zend_compile_func_cufa(result, args, lcname);
|
||||
} else if (zend_string_equals_literal(lcname, "call_user_func")) {
|
||||
return zend_compile_func_cuf(result, args, lcname);
|
||||
} else if (zend_string_equals_literal(lcname, "assert")) {
|
||||
return zend_compile_assert(result, args, lcname, fbc);
|
||||
} else {
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -4057,32 +4028,16 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
|
||||
|
||||
znode expr_node, case_node;
|
||||
zend_op *opline;
|
||||
uint32_t *jmpnz_opnums, opnum_default_jmp;
|
||||
uint32_t *jmpnz_opnums = safe_emalloc(sizeof(uint32_t), cases->children, 0);
|
||||
uint32_t opnum_default_jmp;
|
||||
|
||||
zend_compile_expr(&expr_node, expr_ast);
|
||||
|
||||
if (cases->children == 1 && cases->child[0]->child[0] == NULL) {
|
||||
/* we have to take care about the case that only have one default branch,
|
||||
* expr result will not be unrefed in this case, but it should be like in ZEND_CASE */
|
||||
zend_ast *stmt_ast = cases->child[0]->child[1];
|
||||
if (expr_node.op_type == IS_VAR || expr_node.op_type == IS_TMP_VAR) {
|
||||
zend_emit_op(NULL, ZEND_FREE, &expr_node, NULL);
|
||||
} else if (expr_node.op_type == IS_CONST) {
|
||||
zval_dtor(&expr_node.u.constant);
|
||||
}
|
||||
|
||||
zend_begin_loop(ZEND_NOP, NULL);
|
||||
zend_compile_stmt(stmt_ast);
|
||||
zend_end_loop(get_next_op_number(CG(active_op_array)));
|
||||
return;
|
||||
}
|
||||
|
||||
zend_begin_loop(ZEND_FREE, &expr_node);
|
||||
|
||||
case_node.op_type = IS_TMP_VAR;
|
||||
case_node.u.op.var = get_temporary_variable(CG(active_op_array));
|
||||
|
||||
jmpnz_opnums = safe_emalloc(sizeof(uint32_t), cases->children, 0);
|
||||
for (i = 0; i < cases->children; ++i) {
|
||||
zend_ast *case_ast = cases->child[i];
|
||||
zend_ast *cond_ast = case_ast->child[0];
|
||||
@@ -4529,9 +4484,8 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Redefinition of parameter $%s",
|
||||
ZSTR_VAL(name));
|
||||
} else if (zend_string_equals_literal(name, "this")) {
|
||||
if ((op_array->scope || (op_array->fn_flags & ZEND_ACC_CLOSURE))
|
||||
&& (op_array->fn_flags & ZEND_ACC_STATIC) == 0) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as parameter");
|
||||
if (op_array->scope && (op_array->fn_flags & ZEND_ACC_STATIC) == 0) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this");
|
||||
}
|
||||
op_array->this_var = var_node.u.op.var;
|
||||
}
|
||||
@@ -4857,16 +4811,15 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
|
||||
static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_ast_decl *decl) /* {{{ */
|
||||
{
|
||||
zend_ast *params_ast = decl->child[0];
|
||||
zend_string *unqualified_name, *name, *lcname;
|
||||
zend_string *name = decl->name, *lcname;
|
||||
zend_op *opline;
|
||||
|
||||
unqualified_name = decl->name;
|
||||
op_array->function_name = name = zend_prefix_with_ns(unqualified_name);
|
||||
op_array->function_name = name = zend_prefix_with_ns(name);
|
||||
|
||||
lcname = zend_string_tolower(name);
|
||||
|
||||
if (FC(imports_function)) {
|
||||
zend_string *import_name = zend_hash_find_ptr_lc(
|
||||
FC(imports_function), ZSTR_VAL(unqualified_name), ZSTR_LEN(unqualified_name));
|
||||
zend_string *import_name = zend_hash_find_ptr(FC(imports_function), lcname);
|
||||
if (import_name && !zend_string_equals_ci(lcname, import_name)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare function %s "
|
||||
"because the name is already in use", ZSTR_VAL(name));
|
||||
@@ -5249,7 +5202,7 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
|
||||
zend_ast *extends_ast = decl->child[0];
|
||||
zend_ast *implements_ast = decl->child[1];
|
||||
zend_ast *stmt_ast = decl->child[2];
|
||||
zend_string *name, *lcname;
|
||||
zend_string *name, *lcname, *import_name = NULL;
|
||||
zend_class_entry *ce = zend_arena_alloc(&CG(arena), sizeof(zend_class_entry));
|
||||
zend_op *opline;
|
||||
znode declare_node, extends_node;
|
||||
@@ -5258,25 +5211,31 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
|
||||
znode original_implementing_class = FC(implementing_class);
|
||||
|
||||
if (EXPECTED((decl->flags & ZEND_ACC_ANON_CLASS) == 0)) {
|
||||
zend_string *unqualified_name = decl->name;
|
||||
|
||||
if (CG(active_class_entry)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Class declarations may not be nested");
|
||||
}
|
||||
|
||||
zend_assert_valid_class_name(unqualified_name);
|
||||
name = zend_prefix_with_ns(unqualified_name);
|
||||
name = zend_new_interned_string(name);
|
||||
name = decl->name;
|
||||
zend_assert_valid_class_name(name);
|
||||
lcname = zend_string_tolower(name);
|
||||
if (FC(current_namespace)) {
|
||||
name = zend_prefix_with_ns(name);
|
||||
|
||||
zend_string_release(lcname);
|
||||
lcname = zend_string_tolower(name);
|
||||
} else {
|
||||
zend_string_addref(name);
|
||||
}
|
||||
|
||||
if (FC(imports)) {
|
||||
zend_string *import_name = zend_hash_find_ptr_lc(
|
||||
FC(imports), ZSTR_VAL(unqualified_name), ZSTR_LEN(unqualified_name));
|
||||
if (import_name && !zend_string_equals_ci(lcname, import_name)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare class %s "
|
||||
"because the name is already in use", ZSTR_VAL(name));
|
||||
}
|
||||
import_name = zend_hash_find_ptr(FC(imports), lcname);
|
||||
}
|
||||
|
||||
if (import_name && !zend_string_equals_ci(lcname, import_name)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare class %s "
|
||||
"because the name is already in use", ZSTR_VAL(name));
|
||||
}
|
||||
|
||||
name = zend_new_interned_string(name);
|
||||
} else {
|
||||
name = zend_generate_anon_class_name(decl->lex_pos);
|
||||
lcname = zend_string_tolower(name);
|
||||
@@ -5315,7 +5274,7 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
|
||||
opline = get_next_op(CG(active_op_array));
|
||||
zend_make_var_result(&declare_node, opline);
|
||||
|
||||
/* TODO.AST drop this */
|
||||
// TODO.AST drop this
|
||||
GET_NODE(&FC(implementing_class), opline->result);
|
||||
|
||||
opline->op2_type = IS_CONST;
|
||||
@@ -5331,15 +5290,7 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
|
||||
|
||||
opline->op1_type = IS_UNUSED;
|
||||
|
||||
if (!zend_hash_exists(CG(class_table), lcname)) {
|
||||
zend_hash_add_ptr(CG(class_table), lcname, ce);
|
||||
} else {
|
||||
/* this anonymous class has been included */
|
||||
zval zv;
|
||||
ZVAL_PTR(&zv, ce);
|
||||
destroy_zend_class(&zv);
|
||||
return;
|
||||
}
|
||||
zend_hash_update_ptr(CG(class_table), lcname, ce);
|
||||
} else {
|
||||
zend_string *key;
|
||||
|
||||
@@ -5499,41 +5450,6 @@ static void zend_check_already_in_use(uint32_t type, zend_string *old_name, zend
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_check_use_conflict(
|
||||
uint32_t type, zend_string *old_name, zend_string *new_name, zend_string *lookup_name) {
|
||||
switch (type) {
|
||||
case T_CLASS:
|
||||
{
|
||||
zend_class_entry *ce = zend_hash_find_ptr(CG(class_table), lookup_name);
|
||||
if (ce && ce->type == ZEND_USER_CLASS
|
||||
&& ce->info.user.filename == CG(compiled_filename)
|
||||
) {
|
||||
zend_check_already_in_use(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case T_FUNCTION:
|
||||
{
|
||||
zend_function *fn = zend_hash_find_ptr(CG(function_table), lookup_name);
|
||||
if (fn && fn->type == ZEND_USER_FUNCTION
|
||||
&& fn->op_array.filename == CG(compiled_filename)
|
||||
) {
|
||||
zend_check_already_in_use(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case T_CONST:
|
||||
{
|
||||
zend_string *filename = zend_hash_find_ptr(&CG(const_filenames), lookup_name);
|
||||
if (filename && filename == CG(compiled_filename)) {
|
||||
zend_check_already_in_use(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
|
||||
void zend_compile_use(zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_ast_list *list = zend_ast_get_list(ast);
|
||||
@@ -5590,11 +5506,43 @@ void zend_compile_use(zend_ast *ast) /* {{{ */
|
||||
ZSTR_VAL(ns_name)[ZSTR_LEN(current_ns)] = '\\';
|
||||
memcpy(ZSTR_VAL(ns_name) + ZSTR_LEN(current_ns) + 1, ZSTR_VAL(lookup_name), ZSTR_LEN(lookup_name));
|
||||
|
||||
zend_check_use_conflict(type, old_name, new_name, ns_name);
|
||||
if (zend_hash_exists(CG(class_table), ns_name)) {
|
||||
zend_check_already_in_use(type, old_name, new_name, ns_name);
|
||||
}
|
||||
|
||||
zend_string_free(ns_name);
|
||||
} else {
|
||||
zend_check_use_conflict(type, old_name, new_name, lookup_name);
|
||||
switch (type) {
|
||||
case T_CLASS:
|
||||
{
|
||||
zend_class_entry *ce = zend_hash_find_ptr(CG(class_table), lookup_name);
|
||||
if (ce && ce->type == ZEND_USER_CLASS
|
||||
&& ce->info.user.filename == CG(compiled_filename)
|
||||
) {
|
||||
zend_check_already_in_use(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case T_FUNCTION:
|
||||
{
|
||||
zend_function *fn = zend_hash_find_ptr(CG(function_table), lookup_name);
|
||||
if (fn && fn->type == ZEND_USER_FUNCTION
|
||||
&& fn->op_array.filename == CG(compiled_filename)
|
||||
) {
|
||||
zend_check_already_in_use(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case T_CONST:
|
||||
{
|
||||
zend_string *filename = zend_hash_find_ptr(&CG(const_filenames), lookup_name);
|
||||
if (filename && filename == CG(compiled_filename)) {
|
||||
zend_check_already_in_use(type, old_name, new_name, lookup_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
|
||||
zend_string_addref(old_name);
|
||||
@@ -5629,6 +5577,7 @@ void zend_compile_group_use(zend_ast *ast) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
void zend_compile_const_decl(zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_ast_list *list = zend_ast_get_list(ast);
|
||||
@@ -5637,26 +5586,26 @@ void zend_compile_const_decl(zend_ast *ast) /* {{{ */
|
||||
zend_ast *const_ast = list->child[i];
|
||||
zend_ast *name_ast = const_ast->child[0];
|
||||
zend_ast *value_ast = const_ast->child[1];
|
||||
zend_string *unqualified_name = zend_ast_get_str(name_ast);
|
||||
zend_string *name = zend_ast_get_str(name_ast);
|
||||
|
||||
zend_string *name;
|
||||
zend_string *import_name;
|
||||
znode name_node, value_node;
|
||||
zval *value_zv = &value_node.u.constant;
|
||||
|
||||
value_node.op_type = IS_CONST;
|
||||
zend_const_expr_to_zval(value_zv, value_ast);
|
||||
|
||||
if (zend_lookup_reserved_const(ZSTR_VAL(unqualified_name), ZSTR_LEN(unqualified_name))) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR,
|
||||
"Cannot redeclare constant '%s'", ZSTR_VAL(unqualified_name));
|
||||
if (zend_lookup_reserved_const(ZSTR_VAL(name), ZSTR_LEN(name))) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare constant '%s'", ZSTR_VAL(name));
|
||||
}
|
||||
|
||||
name = zend_prefix_with_ns(unqualified_name);
|
||||
name = zend_prefix_with_ns(name);
|
||||
name = zend_new_interned_string(name);
|
||||
|
||||
if (FC(imports_const)) {
|
||||
zend_string *import_name = zend_hash_find_ptr(FC(imports_const), unqualified_name);
|
||||
if (import_name && !zend_string_equals(import_name, name)) {
|
||||
if (FC(imports_const)
|
||||
&& (import_name = zend_hash_find_ptr(FC(imports_const), name))
|
||||
) {
|
||||
if (!zend_string_equals(import_name, name)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare const %s because "
|
||||
"the name is already in use", ZSTR_VAL(name));
|
||||
}
|
||||
@@ -5953,11 +5902,7 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(result), value)) {
|
||||
zval_ptr_dtor_nogc(value);
|
||||
zval_ptr_dtor(result);
|
||||
return 0;
|
||||
}
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(result), value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6887,7 +6832,7 @@ zend_bool zend_is_allowed_in_const_expr(zend_ast_kind kind) /* {{{ */
|
||||
|| kind == ZEND_AST_CONDITIONAL || kind == ZEND_AST_DIM
|
||||
|| kind == ZEND_AST_ARRAY || kind == ZEND_AST_ARRAY_ELEM
|
||||
|| kind == ZEND_AST_CONST || kind == ZEND_AST_CLASS_CONST
|
||||
|| kind == ZEND_AST_MAGIC_CONST || kind == ZEND_AST_COALESCE;
|
||||
|| kind == ZEND_AST_MAGIC_CONST;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -7021,16 +6966,14 @@ void zend_const_expr_to_zval(zval *result, zend_ast *ast) /* {{{ */
|
||||
zend_compile_const_expr(&ast);
|
||||
if (ast->kind == ZEND_AST_ZVAL) {
|
||||
ZVAL_COPY_VALUE(result, zend_ast_get_zval(ast));
|
||||
|
||||
/* Kill this branch of the original AST, as it was already destroyed.
|
||||
* It would be nice to find a better solution to this problem in the
|
||||
* future. */
|
||||
orig_ast->kind = 0;
|
||||
} else {
|
||||
ZVAL_NEW_AST(result, zend_ast_copy(ast));
|
||||
/* destroy the ast here, it might have been replaced */
|
||||
zend_ast_destroy(ast);
|
||||
}
|
||||
|
||||
/* Kill this branch of the original AST, as it was already destroyed.
|
||||
* It would be nice to find a better solution to this problem in the
|
||||
* future. */
|
||||
orig_ast->kind = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -7441,30 +7384,6 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||
|
||||
zend_ct_eval_unary_pm(&result, ast->kind, zend_ast_get_zval(ast->child[0]));
|
||||
break;
|
||||
case ZEND_AST_COALESCE:
|
||||
/* Set isset fetch indicator here, opcache disallows runtime altering of the AST */
|
||||
if (ast->child[0]->kind == ZEND_AST_DIM) {
|
||||
ast->child[0]->attr = ZEND_DIM_IS;
|
||||
}
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
|
||||
if (ast->child[0]->kind != ZEND_AST_ZVAL) {
|
||||
/* ensure everything was compile-time evaluated at least once */
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(zend_ast_get_zval(ast->child[0])) == IS_NULL) {
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
*ast_ptr = ast->child[1];
|
||||
ast->child[1] = NULL;
|
||||
zend_ast_destroy(ast);
|
||||
} else {
|
||||
*ast_ptr = ast->child[0];
|
||||
ast->child[0] = NULL;
|
||||
zend_ast_destroy(ast);
|
||||
}
|
||||
return;
|
||||
case ZEND_AST_CONDITIONAL:
|
||||
{
|
||||
zend_ast **child, *child_ast;
|
||||
@@ -7498,11 +7417,6 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
|
||||
/* Set isset fetch indicator here, opcache disallows runtime altering of the AST */
|
||||
if (ast->attr == ZEND_DIM_IS && ast->child[0]->kind == ZEND_AST_DIM) {
|
||||
ast->child[0]->attr = ZEND_DIM_IS;
|
||||
}
|
||||
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
|
||||
|
||||
@@ -761,7 +761,6 @@ ZEND_API char *zend_make_compiled_string_description(const char *name);
|
||||
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers);
|
||||
uint32_t zend_get_class_fetch_type(zend_string *name);
|
||||
ZEND_API zend_uchar zend_get_call_op(zend_uchar init_op, zend_function *fbc);
|
||||
ZEND_API int zend_is_smart_branch(zend_op *opline);
|
||||
|
||||
typedef zend_bool (*zend_auto_global_callback)(zend_string *name);
|
||||
typedef struct _zend_auto_global {
|
||||
@@ -890,8 +889,6 @@ ZEND_API void zend_assert_valid_class_name(const zend_string *const_name);
|
||||
#define ZEND_SEND_BY_REF 1
|
||||
#define ZEND_SEND_PREFER_REF 2
|
||||
|
||||
#define ZEND_DIM_IS 1
|
||||
|
||||
static zend_always_inline int zend_check_arg_send_type(const zend_function *zf, uint32_t arg_num, uint32_t mask)
|
||||
{
|
||||
arg_num--;
|
||||
@@ -1012,9 +1009,6 @@ END_EXTERN_C()
|
||||
/* force IS_OBJ_USE_GUARDS for all classes */
|
||||
#define ZEND_COMPILE_GUARDS (1<<9)
|
||||
|
||||
/* disable builtin special case function calls */
|
||||
#define ZEND_COMPILE_NO_BUILTINS (1<<10)
|
||||
|
||||
/* The default value for CG(compiler_options) */
|
||||
#define ZEND_COMPILE_DEFAULT ZEND_COMPILE_HANDLE_OP_ARRAY
|
||||
|
||||
|
||||
+20
-10
@@ -299,6 +299,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
|
||||
zend_constant *c;
|
||||
const char *colon;
|
||||
zend_class_entry *ce = NULL;
|
||||
zend_string *class_name;
|
||||
const char *name = ZSTR_VAL(cname);
|
||||
size_t name_len = ZSTR_LEN(cname);
|
||||
|
||||
@@ -314,9 +315,13 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
|
||||
int class_name_len = colon - name - 1;
|
||||
size_t const_name_len = name_len - class_name_len - 2;
|
||||
zend_string *constant_name = zend_string_init(colon + 1, const_name_len, 0);
|
||||
zend_string *class_name = zend_string_init(name, class_name_len, 0);
|
||||
char *lcname;
|
||||
zval *ret_constant = NULL;
|
||||
ALLOCA_FLAG(use_heap)
|
||||
|
||||
class_name = zend_string_init(name, class_name_len, 0);
|
||||
lcname = do_alloca(class_name_len + 1, use_heap);
|
||||
zend_str_tolower_copy(lcname, name, class_name_len);
|
||||
if (!scope) {
|
||||
if (EG(current_execute_data)) {
|
||||
scope = EG(scope);
|
||||
@@ -325,43 +330,48 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
|
||||
}
|
||||
}
|
||||
|
||||
if (zend_string_equals_literal_ci(class_name, "self")) {
|
||||
if (class_name_len == sizeof("self")-1 &&
|
||||
!memcmp(lcname, "self", sizeof("self")-1)) {
|
||||
if (UNEXPECTED(!scope)) {
|
||||
zend_throw_error(NULL, "Cannot access self:: when no class scope is active");
|
||||
goto failure;
|
||||
return NULL;
|
||||
}
|
||||
ce = scope;
|
||||
} else if (zend_string_equals_literal_ci(class_name, "parent")) {
|
||||
} else if (class_name_len == sizeof("parent")-1 &&
|
||||
!memcmp(lcname, "parent", sizeof("parent")-1)) {
|
||||
if (UNEXPECTED(!scope)) {
|
||||
zend_throw_error(NULL, "Cannot access parent:: when no class scope is active");
|
||||
goto failure;
|
||||
return NULL;
|
||||
} else if (UNEXPECTED(!scope->parent)) {
|
||||
zend_throw_error(NULL, "Cannot access parent:: when current class scope has no parent");
|
||||
goto failure;
|
||||
return NULL;
|
||||
} else {
|
||||
ce = scope->parent;
|
||||
}
|
||||
} else if (zend_string_equals_literal_ci(class_name, "static")) {
|
||||
} else if (class_name_len == sizeof("static")-1 &&
|
||||
!memcmp(lcname, "static", sizeof("static")-1)) {
|
||||
ce = zend_get_called_scope(EG(current_execute_data));
|
||||
if (UNEXPECTED(!ce)) {
|
||||
zend_throw_error(NULL, "Cannot access static:: when no class scope is active");
|
||||
goto failure;
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
ce = zend_fetch_class(class_name, flags);
|
||||
}
|
||||
free_alloca(lcname, use_heap);
|
||||
if (ce) {
|
||||
ret_constant = zend_hash_find(&ce->constants_table, constant_name);
|
||||
if (ret_constant == NULL) {
|
||||
if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
|
||||
zend_throw_error(NULL, "Undefined class constant '%s::%s'", ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
|
||||
zend_string_release(class_name);
|
||||
zend_string_free(constant_name);
|
||||
return NULL;
|
||||
}
|
||||
} else if (Z_ISREF_P(ret_constant)) {
|
||||
ret_constant = Z_REFVAL_P(ret_constant);
|
||||
}
|
||||
}
|
||||
|
||||
failure:
|
||||
zend_string_release(class_name);
|
||||
zend_string_free(constant_name);
|
||||
if (ret_constant && Z_CONSTANT_P(ret_constant)) {
|
||||
|
||||
+9
-29
@@ -291,9 +291,13 @@ ZEND_METHOD(exception, __construct)
|
||||
/* {{{ proto Exception::__wakeup()
|
||||
Exception unserialize checks */
|
||||
#define CHECK_EXC_TYPE(name, type) \
|
||||
ZVAL_UNDEF(&value); \
|
||||
pvalue = zend_read_property(i_get_exception_base(object), (object), name, sizeof(name) - 1, 1, &value); \
|
||||
if (Z_TYPE_P(pvalue) != IS_NULL && Z_TYPE_P(pvalue) != type) { \
|
||||
zend_unset_property(i_get_exception_base(object), object, name, sizeof(name)-1); \
|
||||
if(Z_TYPE_P(pvalue) != IS_UNDEF && Z_TYPE_P(pvalue) != type) { \
|
||||
zval tmp; \
|
||||
ZVAL_STRINGL(&tmp, name, sizeof(name) - 1); \
|
||||
Z_OBJ_HANDLER_P(object, unset_property)(object, &tmp, NULL); \
|
||||
zval_ptr_dtor(&tmp); \
|
||||
}
|
||||
|
||||
ZEND_METHOD(exception, __wakeup)
|
||||
@@ -306,12 +310,7 @@ ZEND_METHOD(exception, __wakeup)
|
||||
CHECK_EXC_TYPE("file", IS_STRING);
|
||||
CHECK_EXC_TYPE("line", IS_LONG);
|
||||
CHECK_EXC_TYPE("trace", IS_ARRAY);
|
||||
pvalue = zend_read_property(i_get_exception_base(object), object, "previous", sizeof("previous")-1, 1, &value);
|
||||
if (pvalue && Z_TYPE_P(pvalue) != IS_NULL && (Z_TYPE_P(pvalue) != IS_OBJECT ||
|
||||
!instanceof_function(Z_OBJCE_P(pvalue), i_get_exception_base(object)) ||
|
||||
pvalue == object)) {
|
||||
zend_unset_property(i_get_exception_base(object), object, "previous", sizeof("previous")-1);
|
||||
}
|
||||
CHECK_EXC_TYPE("previous", IS_OBJECT);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -564,14 +563,11 @@ static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */
|
||||
case IS_ARRAY:
|
||||
smart_str_appends(str, "Array, ");
|
||||
break;
|
||||
case IS_OBJECT: {
|
||||
zend_string *class_name = Z_OBJ_HANDLER_P(arg, get_class_name)(Z_OBJ_P(arg));
|
||||
case IS_OBJECT:
|
||||
smart_str_appends(str, "Object(");
|
||||
smart_str_appends(str, ZSTR_VAL(class_name));
|
||||
smart_str_appends(str, ZSTR_VAL(Z_OBJCE_P(arg)->name));
|
||||
smart_str_appends(str, "), ");
|
||||
zend_string_release(class_name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -773,25 +769,10 @@ ZEND_METHOD(exception, __toString)
|
||||
zend_string_release(file);
|
||||
zval_ptr_dtor(&trace);
|
||||
|
||||
Z_OBJPROP_P(exception)->u.v.nApplyCount++;
|
||||
exception = GET_PROPERTY(exception, "previous");
|
||||
if (exception && Z_TYPE_P(exception) == IS_OBJECT && Z_OBJPROP_P(exception)->u.v.nApplyCount > 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
zval_dtor(&fname);
|
||||
|
||||
exception = getThis();
|
||||
/* Reset apply counts */
|
||||
while (exception && Z_TYPE_P(exception) == IS_OBJECT && (base_ce = i_get_exception_base(exception)) && instanceof_function(Z_OBJCE_P(exception), base_ce)) {
|
||||
if (Z_OBJPROP_P(exception)->u.v.nApplyCount) {
|
||||
Z_OBJPROP_P(exception)->u.v.nApplyCount--;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
exception = GET_PROPERTY(exception, "previous");
|
||||
}
|
||||
|
||||
exception = getThis();
|
||||
base_ce = i_get_exception_base(exception);
|
||||
|
||||
@@ -1088,7 +1069,6 @@ ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception) /* {{{ */
|
||||
|
||||
if (!exception_ce || !instanceof_function(exception_ce, zend_ce_throwable)) {
|
||||
zend_throw_error(NULL, "Cannot throw objects that do not implement Throwable");
|
||||
zval_ptr_dtor(exception);
|
||||
return;
|
||||
}
|
||||
zend_throw_exception_internal(exception);
|
||||
|
||||
+12
-32
@@ -145,8 +145,7 @@ static const zend_internal_function zend_pass_function = {
|
||||
((ZEND_VM_STACK_PAGE_SLOTS(gen) - ZEND_VM_STACK_HEADER_SLOTS) * sizeof(zval))
|
||||
|
||||
#define ZEND_VM_STACK_PAGE_ALIGNED_SIZE(gen, size) \
|
||||
(((size) + ZEND_VM_STACK_HEADER_SLOTS * sizeof(zval) \
|
||||
+ (ZEND_VM_STACK_PAGE_SIZE(gen) - 1)) & ~(ZEND_VM_STACK_PAGE_SIZE(gen) - 1))
|
||||
(((size) + (ZEND_VM_STACK_FREE_PAGE_SIZE(gen) - 1)) & ~(ZEND_VM_STACK_PAGE_SIZE(gen) - 1))
|
||||
|
||||
static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t size, zend_vm_stack prev) {
|
||||
zend_vm_stack page = (zend_vm_stack)emalloc(size);
|
||||
@@ -585,17 +584,7 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
|
||||
|
||||
ref = Z_REF_P(value_ptr);
|
||||
GC_REFCOUNT(ref)++;
|
||||
if (Z_REFCOUNTED_P(variable_ptr)) {
|
||||
zend_refcounted *garbage = Z_COUNTED_P(variable_ptr);
|
||||
|
||||
if (--GC_REFCOUNT(garbage) == 0) {
|
||||
ZVAL_REF(variable_ptr, ref);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
return;
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(variable_ptr);
|
||||
ZVAL_REF(variable_ptr, ref);
|
||||
}
|
||||
|
||||
@@ -603,9 +592,7 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
|
||||
static inline int make_real_object(zval *object)
|
||||
{
|
||||
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
|
||||
if (UNEXPECTED(object == &EG(error_zval))) {
|
||||
return 0;
|
||||
} else if (EXPECTED(Z_TYPE_P(object) <= IS_FALSE)) {
|
||||
if (EXPECTED(Z_TYPE_P(object) <= IS_FALSE)) {
|
||||
/* nothing to destroy */
|
||||
} else if (EXPECTED((Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
|
||||
zval_ptr_dtor_nogc(object);
|
||||
@@ -835,8 +822,11 @@ static zend_always_inline int zend_verify_arg_type(zend_function *zf, uint32_t a
|
||||
} else {
|
||||
ce = zend_verify_arg_class_kind(cur_arg_info);
|
||||
if (UNEXPECTED(!ce)) {
|
||||
ZEND_ASSERT(Z_TYPE_P(arg) != IS_OBJECT);
|
||||
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "", zend_zval_type_name(arg), arg);
|
||||
if (Z_TYPE_P(arg) == IS_OBJECT) {
|
||||
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "instance of ", ZSTR_VAL(Z_OBJCE_P(arg)->name), arg);
|
||||
} else {
|
||||
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "", zend_zval_type_name(arg), arg);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
*cache_slot = (void*)ce;
|
||||
@@ -1343,7 +1333,6 @@ static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *valu
|
||||
zend_string_release(tmp);
|
||||
} else {
|
||||
Z_STRVAL_P(str)[offset] = Z_STRVAL_P(value)[0];
|
||||
zend_string_forget_hash_val(Z_STR_P(str));
|
||||
}
|
||||
/*
|
||||
* the value of an assignment to a string offset is undefined
|
||||
@@ -1412,11 +1401,11 @@ static zend_never_inline void zend_pre_incdec_overloaded_property(zval *object,
|
||||
zval rv;
|
||||
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z, *zptr, obj;
|
||||
zval *z, obj;
|
||||
|
||||
ZVAL_OBJ(&obj, Z_OBJ_P(object));
|
||||
Z_ADDREF(obj);
|
||||
zptr = z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv);
|
||||
z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
OBJ_RELEASE(Z_OBJ(obj));
|
||||
return;
|
||||
@@ -1443,7 +1432,7 @@ static zend_never_inline void zend_pre_incdec_overloaded_property(zval *object,
|
||||
}
|
||||
Z_OBJ_HT(obj)->write_property(&obj, property, z, cache_slot);
|
||||
OBJ_RELEASE(Z_OBJ(obj));
|
||||
zval_ptr_dtor(zptr);
|
||||
zval_ptr_dtor(z);
|
||||
} else {
|
||||
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
|
||||
if (UNEXPECTED(result)) {
|
||||
@@ -1923,12 +1912,6 @@ ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *
|
||||
zend_fetch_dimension_address_read_R(result, container, dim, IS_TMP_VAR);
|
||||
}
|
||||
|
||||
ZEND_API void zend_fetch_dimension_by_zval_is(zval *result, zval *container, zval *dim, int dim_type)
|
||||
{
|
||||
zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_IS);
|
||||
}
|
||||
|
||||
|
||||
static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type)
|
||||
{
|
||||
if (container_op_type != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
|
||||
@@ -2455,12 +2438,9 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o
|
||||
|
||||
if (UNEXPECTED(opline->opcode == ZEND_INIT_FCALL ||
|
||||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
|
||||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
|
||||
opline->opcode == ZEND_INIT_DYNAMIC_CALL ||
|
||||
opline->opcode == ZEND_INIT_USER_CALL ||
|
||||
opline->opcode == ZEND_INIT_METHOD_CALL ||
|
||||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
|
||||
opline->opcode == ZEND_NEW)) {
|
||||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL)) {
|
||||
ZEND_ASSERT(op_num);
|
||||
opline--;
|
||||
}
|
||||
|
||||
@@ -296,7 +296,6 @@ ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, con
|
||||
void zend_verify_abstract_class(zend_class_entry *ce);
|
||||
|
||||
ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *dim);
|
||||
ZEND_API void zend_fetch_dimension_by_zval_is(zval *result, zval *container, zval *dim, int dim_type);
|
||||
|
||||
ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var);
|
||||
|
||||
|
||||
+29
-22
@@ -573,6 +573,8 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
|
||||
ZVAL_EMPTY_STRING(p);
|
||||
}
|
||||
} else if (UNEXPECTED((const_value = zend_get_constant_ex(Z_STR_P(p), scope, Z_CONST_FLAGS_P(p))) == NULL)) {
|
||||
char *actual = Z_STRVAL_P(p);
|
||||
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
RESET_CONSTANT_VISITED(p);
|
||||
return FAILURE;
|
||||
@@ -582,38 +584,46 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
|
||||
return FAILURE;
|
||||
} else {
|
||||
zend_string *save = Z_STR_P(p);
|
||||
char *slash;
|
||||
size_t actual_len = Z_STRLEN_P(p);
|
||||
if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) && (slash = (char *)zend_memrchr(actual, '\\', actual_len))) {
|
||||
actual = slash + 1;
|
||||
actual_len -= (actual - Z_STRVAL_P(p));
|
||||
if (inline_change) {
|
||||
zend_string *s = zend_string_init(actual, actual_len, 0);
|
||||
Z_STR_P(p) = s;
|
||||
Z_TYPE_FLAGS_P(p) = IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE;
|
||||
}
|
||||
}
|
||||
if (actual[0] == '\\') {
|
||||
if (inline_change) {
|
||||
memmove(Z_STRVAL_P(p), Z_STRVAL_P(p)+1, Z_STRLEN_P(p));
|
||||
--Z_STRLEN_P(p);
|
||||
} else {
|
||||
++actual;
|
||||
}
|
||||
--actual_len;
|
||||
}
|
||||
if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) == 0) {
|
||||
if (ZSTR_VAL(save)[0] == '\\') {
|
||||
zend_throw_error(NULL, "Undefined constant '%s'", ZSTR_VAL(save) + 1);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Undefined constant '%s'", ZSTR_VAL(save));
|
||||
}
|
||||
if (inline_change) {
|
||||
zend_string_release(save);
|
||||
}
|
||||
RESET_CONSTANT_VISITED(p);
|
||||
return FAILURE;
|
||||
} else {
|
||||
char *actual = Z_STRVAL_P(p);
|
||||
size_t actual_len = Z_STRLEN_P(p);
|
||||
char *slash = (char *) zend_memrchr(actual, '\\', actual_len);
|
||||
if (slash) {
|
||||
actual = slash + 1;
|
||||
actual_len -= (actual - Z_STRVAL_P(p));
|
||||
}
|
||||
|
||||
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
|
||||
if (EG(exception)) {
|
||||
RESET_CONSTANT_VISITED(p);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
|
||||
if (!inline_change) {
|
||||
ZVAL_STRINGL(p, actual, actual_len);
|
||||
} else {
|
||||
if (slash) {
|
||||
ZVAL_STRINGL(p, actual, actual_len);
|
||||
Z_TYPE_INFO_P(p) = Z_REFCOUNTED_P(p) ?
|
||||
IS_STRING_EX : IS_INTERNED_STRING_EX;
|
||||
if (save && ZSTR_VAL(save) != actual) {
|
||||
zend_string_release(save);
|
||||
} else {
|
||||
Z_TYPE_INFO_P(p) = Z_REFCOUNTED_P(p) ?
|
||||
IS_STRING_EX : IS_INTERNED_STRING_EX;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -852,11 +862,8 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
||||
EG(scope) = func->common.scope;
|
||||
call->symbol_table = fci->symbol_table;
|
||||
if (EXPECTED((func->op_array.fn_flags & ZEND_ACC_GENERATOR) == 0)) {
|
||||
const zend_op *current_opline_before_exception = EG(opline_before_exception);
|
||||
|
||||
zend_init_execute_data(call, &func->op_array, fci->retval);
|
||||
zend_execute_ex(call);
|
||||
EG(opline_before_exception) = current_opline_before_exception;
|
||||
} else {
|
||||
zend_generator_create_zval(call, &func->op_array, fci->retval);
|
||||
}
|
||||
|
||||
@@ -1097,7 +1097,6 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
|
||||
if (EG(objects_store).object_buckets &&
|
||||
IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle])) {
|
||||
EG(objects_store).object_buckets[obj->handle] = SET_OBJ_INVALID(obj);
|
||||
GC_TYPE(obj) = IS_NULL;
|
||||
if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
|
||||
GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
|
||||
|
||||
+13
-12
@@ -297,8 +297,6 @@ ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_
|
||||
|
||||
static void zend_generator_throw_exception(zend_generator *generator, zval *exception)
|
||||
{
|
||||
zend_execute_data *original_execute_data = EG(current_execute_data);
|
||||
|
||||
/* 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);
|
||||
@@ -307,6 +305,7 @@ static void zend_generator_throw_exception(zend_generator *generator, zval *exce
|
||||
|
||||
/* 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);
|
||||
EG(current_execute_data) = generator->execute_data;
|
||||
generator->execute_data->opline--;
|
||||
if (exception) {
|
||||
@@ -522,16 +521,6 @@ ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator
|
||||
zend_throw_exception(zend_ce_ClosedGeneratorException, "Generator yielded from aborted, no return value available", 0);
|
||||
|
||||
EG(current_execute_data) = original_execute_data;
|
||||
|
||||
if (!((old_root ? old_root : generator)->flags & ZEND_GENERATOR_CURRENTLY_RUNNING)) {
|
||||
leaf->node.ptr.root = root;
|
||||
root->node.parent = NULL;
|
||||
if (old_root) {
|
||||
OBJ_RELEASE(&old_root->std);
|
||||
}
|
||||
zend_generator_resume(leaf);
|
||||
return leaf->node.ptr.root; /* this may be updated during zend_generator_resume! */
|
||||
}
|
||||
} else {
|
||||
zval_ptr_dtor(&root->value);
|
||||
ZVAL_COPY(&root->value, &root->node.parent->value);
|
||||
@@ -872,9 +861,15 @@ ZEND_METHOD(Generator, send)
|
||||
zval *value;
|
||||
zend_generator *generator, *root;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ZVAL(value)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
generator = (zend_generator *) Z_OBJ_P(getThis());
|
||||
|
||||
@@ -910,9 +905,15 @@ ZEND_METHOD(Generator, throw)
|
||||
zval *exception, exception_copy;
|
||||
zend_generator *generator;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &exception) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ZVAL(exception)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
ZVAL_DUP(&exception_copy, exception);
|
||||
|
||||
|
||||
+3
-6
@@ -1447,17 +1447,13 @@ ZEND_API void ZEND_FASTCALL zend_symtable_clean(HashTable *ht)
|
||||
} else if (ht->nNumUsed == ht->nNumOfElements) {
|
||||
do {
|
||||
i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC);
|
||||
if (EXPECTED(p->key)) {
|
||||
zend_string_release(p->key);
|
||||
}
|
||||
zend_string_release(p->key);
|
||||
} while (++p != end);
|
||||
} else {
|
||||
do {
|
||||
if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
|
||||
i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC);
|
||||
if (EXPECTED(p->key)) {
|
||||
zend_string_release(p->key);
|
||||
}
|
||||
zend_string_release(p->key);
|
||||
}
|
||||
} while (++p != end);
|
||||
}
|
||||
@@ -2469,6 +2465,7 @@ ZEND_API int ZEND_FASTCALL _zend_handle_numeric_str_ex(const char *key, size_t l
|
||||
register const char *tmp = key;
|
||||
|
||||
const char *end = key + length;
|
||||
ZEND_ASSERT(*end == '\0');
|
||||
|
||||
if (*tmp == '-') {
|
||||
tmp++;
|
||||
|
||||
@@ -268,8 +268,8 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* If the prototype method is private do not enforce a signature */
|
||||
if (proto->common.fn_flags & ZEND_ACC_PRIVATE) {
|
||||
/* If both methods are private do not enforce a signature */
|
||||
if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -660,8 +660,7 @@ static void do_inherit_property(zend_property_info *parent_info, zend_string *ke
|
||||
int parent_num = OBJ_PROP_TO_NUM(parent_info->offset);
|
||||
int child_num = OBJ_PROP_TO_NUM(child_info->offset);
|
||||
|
||||
/* Don't keep default properties in GC (thry may be freed by opcache) */
|
||||
zval_ptr_dtor_nogc(&(ce->default_properties_table[parent_num]));
|
||||
zval_ptr_dtor(&(ce->default_properties_table[parent_num]));
|
||||
ce->default_properties_table[parent_num] = ce->default_properties_table[child_num];
|
||||
ZVAL_UNDEF(&ce->default_properties_table[child_num]);
|
||||
child_info->offset = parent_info->offset;
|
||||
@@ -1180,7 +1179,6 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
|
||||
function_add_ref(fn);
|
||||
new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
|
||||
memcpy(new_fn, fn, sizeof(zend_op_array));
|
||||
new_fn->common.fn_flags |= ZEND_ACC_ARENA_ALLOCATED;
|
||||
fn = zend_hash_update_ptr(&ce->function_table, key, new_fn);
|
||||
zend_add_magic_methods(ce, key, fn);
|
||||
}
|
||||
|
||||
+8
-20
@@ -46,8 +46,6 @@ int ini_parse(void);
|
||||
#define YYFREE free
|
||||
#endif
|
||||
|
||||
#define ZEND_SYSTEM_INI CG(ini_parser_unbuffered_errors)
|
||||
|
||||
/* {{{ zend_ini_do_op()
|
||||
*/
|
||||
static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
@@ -88,7 +86,7 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
}
|
||||
|
||||
str_len = zend_sprintf(str_result, "%d", i_result);
|
||||
ZVAL_NEW_STR(result, zend_string_init(str_result, str_len, ZEND_SYSTEM_INI));
|
||||
ZVAL_PSTRINGL(result, str_result, str_len);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -96,11 +94,7 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
*/
|
||||
static void zend_ini_init_string(zval *result)
|
||||
{
|
||||
if (ZEND_SYSTEM_INI) {
|
||||
ZVAL_EMPTY_PSTRING(result);
|
||||
} else {
|
||||
ZVAL_EMPTY_STRING(result);
|
||||
}
|
||||
ZVAL_EMPTY_PSTRING(result);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -113,12 +107,8 @@ 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);
|
||||
/* ZEND_ASSERT(!Z_REFCOUNTED_P(op1)); */
|
||||
if (ZEND_SYSTEM_INI) {
|
||||
ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str));
|
||||
zend_string_release(str);
|
||||
} else {
|
||||
ZVAL_STR(op1, str);
|
||||
}
|
||||
ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str));
|
||||
zend_string_release(str);
|
||||
}
|
||||
op1_len = (int)Z_STRLEN_P(op1);
|
||||
|
||||
@@ -127,7 +117,7 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
|
||||
}
|
||||
length = op1_len + (int)Z_STRLEN_P(op2);
|
||||
|
||||
ZVAL_NEW_STR(result, zend_string_extend(Z_STR_P(op1), length, ZEND_SYSTEM_INI));
|
||||
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) + 1);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -150,7 +140,7 @@ static void zend_ini_get_constant(zval *result, zval *name)
|
||||
convert_to_string(&tmp);
|
||||
c = &tmp;
|
||||
}
|
||||
ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(c), Z_STRLEN_P(c), ZEND_SYSTEM_INI));
|
||||
ZVAL_PSTRINGL(result, Z_STRVAL_P(c), Z_STRLEN_P(c));
|
||||
if (c == &tmp) {
|
||||
zend_string_release(Z_STR(tmp));
|
||||
}
|
||||
@@ -170,11 +160,11 @@ static void zend_ini_get_var(zval *result, zval *name)
|
||||
|
||||
/* Fetch configuration option value */
|
||||
if ((curval = zend_get_configuration_directive(Z_STR_P(name))) != NULL) {
|
||||
ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(curval), Z_STRLEN_P(curval), ZEND_SYSTEM_INI));
|
||||
ZVAL_PSTRINGL(result, Z_STRVAL_P(curval), Z_STRLEN_P(curval));
|
||||
/* ..or if not found, try ENV */
|
||||
} else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name))) != NULL ||
|
||||
(envvar = getenv(Z_STRVAL_P(name))) != NULL) {
|
||||
ZVAL_NEW_STR(result, zend_string_init(envvar, strlen(envvar), ZEND_SYSTEM_INI));
|
||||
ZVAL_PSTRING(result, envvar);
|
||||
} else {
|
||||
zend_ini_init_string(result);
|
||||
}
|
||||
@@ -292,8 +282,6 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s
|
||||
%left '|' '&' '^'
|
||||
%right '~' '!'
|
||||
|
||||
%destructor { zval_ptr_dtor(&$$); } TC_RAW TC_CONSTANT TC_NUMBER TC_STRING TC_WHITESPACE TC_LABEL TC_OFFSET TC_VARNAME BOOL_TRUE BOOL_FALSE NULL_NULL
|
||||
|
||||
%%
|
||||
|
||||
statement_list:
|
||||
|
||||
+2109
-2121
File diff suppressed because it is too large.
Load diff
@@ -110,8 +110,6 @@ ZEND_API ts_rsrc_id ini_scanner_globals_id;
|
||||
ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
#endif
|
||||
|
||||
#define ZEND_SYSTEM_INI CG(ini_parser_unbuffered_errors)
|
||||
|
||||
/* Eat leading whitespace */
|
||||
#define EAT_LEADING_WHITESPACE() \
|
||||
while (yyleng) { \
|
||||
@@ -139,7 +137,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
#define EAT_TRAILING_WHITESPACE() EAT_TRAILING_WHITESPACE_EX('X')
|
||||
|
||||
#define zend_ini_copy_value(retval, str, len) \
|
||||
ZVAL_NEW_STR(retval, zend_string_init(str, len, ZEND_SYSTEM_INI))
|
||||
ZVAL_NEW_STR(retval, zend_string_init(str, len, 1))
|
||||
|
||||
|
||||
#define RETURN_TOKEN(type, str, len) { \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.14.3 */
|
||||
/* Generated by re2c 0.13.5 */
|
||||
#line 3 "Zend/zend_ini_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
+5077
-5245
File diff suppressed because it is too large.
Load diff
@@ -63,6 +63,7 @@ typedef struct _zend_heredoc_label {
|
||||
} zend_heredoc_label;
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2);
|
||||
ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state);
|
||||
ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state);
|
||||
ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename);
|
||||
|
||||
@@ -589,7 +589,6 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type)
|
||||
CG(ast) = NULL;
|
||||
CG(ast_arena) = zend_arena_create(1024 * 32);
|
||||
if (!zendparse()) {
|
||||
int last_lineno = CG(zend_lineno);
|
||||
zval retval_zv;
|
||||
zend_file_context original_file_context;
|
||||
zend_oparray_context original_oparray_context;
|
||||
@@ -606,10 +605,9 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type)
|
||||
zend_file_context_begin(&original_file_context);
|
||||
zend_oparray_context_begin(&original_oparray_context);
|
||||
zend_compile_top_stmt(CG(ast));
|
||||
CG(zend_lineno) = last_lineno;
|
||||
zend_emit_final_return(&retval_zv);
|
||||
op_array->line_start = 1;
|
||||
op_array->line_end = last_lineno;
|
||||
op_array->line_end = CG(zend_lineno);
|
||||
pass_two(op_array);
|
||||
zend_oparray_context_end(&original_oparray_context);
|
||||
zend_file_context_end(&original_file_context);
|
||||
@@ -758,7 +756,6 @@ zend_op_array *compile_string(zval *source_string, char *filename)
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
|
||||
if (!zendparse()) {
|
||||
int last_lineno = CG(zend_lineno);
|
||||
zend_file_context original_file_context;
|
||||
zend_oparray_context original_oparray_context;
|
||||
zend_op_array *original_active_op_array = CG(active_op_array);
|
||||
@@ -773,10 +770,9 @@ zend_op_array *compile_string(zval *source_string, char *filename)
|
||||
zend_file_context_begin(&original_file_context);
|
||||
zend_oparray_context_begin(&original_oparray_context);
|
||||
zend_compile_top_stmt(CG(ast));
|
||||
CG(zend_lineno) = last_lineno;
|
||||
zend_emit_final_return(NULL);
|
||||
op_array->line_start = 1;
|
||||
op_array->line_end = last_lineno;
|
||||
op_array->line_end = CG(zend_lineno);
|
||||
pass_two(op_array);
|
||||
zend_oparray_context_end(&original_oparray_context);
|
||||
zend_file_context_end(&original_file_context);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.16 */
|
||||
/* Generated by re2c 0.13.5 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -266,31 +266,6 @@ static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, si
|
||||
}
|
||||
#endif
|
||||
|
||||
static zend_always_inline size_t zend_safe_address_guarded(size_t nmemb, size_t size, size_t offset)
|
||||
{
|
||||
int overflow;
|
||||
size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
|
||||
|
||||
if (UNEXPECTED(overflow)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
|
||||
return 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* A bit more generic version of the same */
|
||||
static zend_always_inline size_t zend_safe_addmult(size_t nmemb, size_t size, size_t offset, const char *message)
|
||||
{
|
||||
int overflow;
|
||||
size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
|
||||
|
||||
if (UNEXPECTED(overflow)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in %s (%zu * %zu + %zu)", message, nmemb, size, offset);
|
||||
return 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* ZEND_MULTIPLY_H */
|
||||
|
||||
/*
|
||||
|
||||
@@ -197,7 +197,11 @@ static void zend_std_call_getter(zval *object, zval *member, zval *retval) /* {{
|
||||
|
||||
it should return whether the call was successful or not
|
||||
*/
|
||||
if (Z_REFCOUNTED_P(member)) Z_ADDREF_P(member);
|
||||
|
||||
zend_call_method_with_1_params(object, ce, &ce->__get, ZEND_GET_FUNC_NAME, retval, member);
|
||||
|
||||
zval_ptr_dtor(member);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -207,6 +211,9 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{
|
||||
int result;
|
||||
zend_class_entry *ce = Z_OBJCE_P(object);
|
||||
|
||||
if (Z_REFCOUNTED_P(member)) Z_ADDREF_P(member);
|
||||
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
|
||||
|
||||
/* __set handler is called with two arguments:
|
||||
property name
|
||||
value to be set
|
||||
@@ -215,6 +222,9 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{
|
||||
*/
|
||||
zend_call_method_with_2_params(object, ce, &ce->__set, ZEND_SET_FUNC_NAME, &retval, member, value);
|
||||
|
||||
zval_ptr_dtor(member);
|
||||
zval_ptr_dtor(value);
|
||||
|
||||
if (Z_TYPE(retval) != IS_UNDEF) {
|
||||
result = i_zend_is_true(&retval) ? SUCCESS : FAILURE;
|
||||
zval_ptr_dtor(&retval);
|
||||
@@ -736,11 +746,9 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /*
|
||||
if (type == BP_VAR_IS) {
|
||||
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", rv, offset);
|
||||
if (UNEXPECTED(Z_ISUNDEF_P(rv))) {
|
||||
zval_ptr_dtor(offset);
|
||||
return NULL;
|
||||
}
|
||||
if (!i_zend_is_true(rv)) {
|
||||
zval_ptr_dtor(offset);
|
||||
zval_ptr_dtor(rv);
|
||||
return &EG(uninitialized_zval);
|
||||
}
|
||||
@@ -1060,7 +1068,6 @@ ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope)
|
||||
|
||||
ZEND_API zend_function *zend_get_call_trampoline_func(zend_class_entry *ce, zend_string *method_name, int is_static) /* {{{ */
|
||||
{
|
||||
size_t mname_len;
|
||||
zend_op_array *func;
|
||||
zend_function *fbc = is_static ? ce->__callstatic : ce->__call;
|
||||
|
||||
@@ -1093,8 +1100,8 @@ ZEND_API zend_function *zend_get_call_trampoline_func(zend_class_entry *ce, zend
|
||||
|
||||
//??? keep compatibility for "\0" characters
|
||||
//??? see: Zend/tests/bug46238.phpt
|
||||
if (UNEXPECTED((mname_len = strlen(ZSTR_VAL(method_name))) != ZSTR_LEN(method_name))) {
|
||||
func->function_name = zend_string_init(ZSTR_VAL(method_name), mname_len, 0);
|
||||
if (UNEXPECTED(strlen(ZSTR_VAL(method_name)) != ZSTR_LEN(method_name))) {
|
||||
func->function_name = zend_string_init(ZSTR_VAL(method_name), strlen(ZSTR_VAL(method_name)), 0);
|
||||
} else {
|
||||
func->function_name = zend_string_copy(method_name);
|
||||
}
|
||||
|
||||
@@ -2927,9 +2927,6 @@ ZEND_API const char* ZEND_FASTCALL zend_memnstr_ex(const char *haystack, const c
|
||||
if (i == needle_len) {
|
||||
return p;
|
||||
}
|
||||
if (UNEXPECTED(p == end)) {
|
||||
return NULL;
|
||||
}
|
||||
p += td[(unsigned char)(p[needle_len])];
|
||||
}
|
||||
|
||||
|
||||
@@ -510,10 +510,7 @@ static zend_always_inline void fast_long_decrement_function(zval *op1)
|
||||
|
||||
static zend_always_inline void fast_long_add_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
#if defined(__GNUC__) && defined(__i386__) \
|
||||
&& !(4 == __GNUC__ && 8 == __GNUC_MINOR__) \
|
||||
&& !(4 == __GNUC__ && 9 == __GNUC_MINOR__ && (defined(__PIC__) || defined(__PIE__)))
|
||||
/* Position-independent builds fail with gcc-4.9.x */
|
||||
#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
|
||||
__asm__(
|
||||
"movl (%1), %%eax\n\t"
|
||||
"addl (%2), %%eax\n\t"
|
||||
@@ -599,10 +596,7 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o
|
||||
|
||||
static zend_always_inline void fast_long_sub_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
#if defined(__GNUC__) && defined(__i386__) && \
|
||||
!(4 == __GNUC__ && 8 == __GNUC_MINOR__) && \
|
||||
!(4 == __GNUC__ && 9 == __GNUC_MINOR__ && (defined(__PIC__) || defined(__PIE__)))
|
||||
/* Position-independent builds fail with gcc-4.9.x */
|
||||
#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
|
||||
__asm__(
|
||||
"movl (%1), %%eax\n\t"
|
||||
"subl (%2), %%eax\n\t"
|
||||
|
||||
@@ -125,8 +125,6 @@
|
||||
# define ZEND_IGNORE_VALUE(x) ((void) (x))
|
||||
#endif
|
||||
|
||||
#define zend_quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__))
|
||||
|
||||
/* all HAVE_XXX test have to be after the include of zend_config above */
|
||||
|
||||
#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
|
||||
|
||||
+4
-12
@@ -2677,14 +2677,6 @@ zend_strtod
|
||||
}
|
||||
}
|
||||
dig_done:
|
||||
if (nd < 0) {
|
||||
/* overflow */
|
||||
nd = DBL_DIG + 2;
|
||||
}
|
||||
if (nf < 0) {
|
||||
/* overflow */
|
||||
nf = DBL_DIG + 2;
|
||||
}
|
||||
e = 0;
|
||||
if (c == 'e' || c == 'E') {
|
||||
if (!nd && !nz && !nz0) {
|
||||
@@ -4424,7 +4416,7 @@ ZEND_API double zend_hex_strtod(const char *str, const char **endptr)
|
||||
int any = 0;
|
||||
double value = 0;
|
||||
|
||||
if (s[0] == '\0' || s[1] == '\0') {
|
||||
if (strlen(str) < 2) {
|
||||
if (endptr != NULL) {
|
||||
*endptr = str;
|
||||
}
|
||||
@@ -4464,7 +4456,7 @@ ZEND_API double zend_oct_strtod(const char *str, const char **endptr)
|
||||
double value = 0;
|
||||
int any = 0;
|
||||
|
||||
if (str[0] == '\0') {
|
||||
if (strlen(str) < 1) {
|
||||
if (endptr != NULL) {
|
||||
*endptr = str;
|
||||
}
|
||||
@@ -4499,7 +4491,7 @@ ZEND_API double zend_bin_strtod(const char *str, const char **endptr)
|
||||
double value = 0;
|
||||
int any = 0;
|
||||
|
||||
if (str[0] == '\0' || str[1] == '\0') {
|
||||
if (strlen(str) < 2) {
|
||||
if (endptr != NULL) {
|
||||
*endptr = str;
|
||||
}
|
||||
@@ -4551,7 +4543,7 @@ static void destroy_freelist(void)
|
||||
}
|
||||
freelist[i] = NULL;
|
||||
}
|
||||
FREE_DTOA_LOCK(0)
|
||||
FREE_DTOA_LOCK(0)
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -64,12 +64,8 @@ typedef unsigned long int uint32_t;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_LOCALE
|
||||
#undef USE_LOCALE
|
||||
#endif
|
||||
|
||||
#ifndef NO_INFNAN_CHECK
|
||||
#define NO_INFNAN_CHECK
|
||||
#ifdef HAVE_LOCALE_H
|
||||
#define USE_LOCALE 1
|
||||
#endif
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
|
||||
+11
-10
@@ -30,20 +30,17 @@
|
||||
|
||||
ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
|
||||
{
|
||||
if (--GC_REFCOUNT(p)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (GC_TYPE(p)) {
|
||||
case IS_STRING:
|
||||
case IS_CONSTANT: {
|
||||
zend_string *str = (zend_string*)p;
|
||||
CHECK_ZVAL_STRING_REL(str);
|
||||
zend_string_free(str);
|
||||
zend_string_release(str);
|
||||
break;
|
||||
}
|
||||
case IS_ARRAY: {
|
||||
zend_array *arr = (zend_array*)p;
|
||||
ZEND_ASSERT(GC_REFCOUNT(arr) <= 1);
|
||||
zend_array_destroy(arr);
|
||||
break;
|
||||
}
|
||||
@@ -57,21 +54,25 @@ ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC
|
||||
case IS_OBJECT: {
|
||||
zend_object *obj = (zend_object*)p;
|
||||
|
||||
zend_objects_store_del(obj);
|
||||
OBJ_RELEASE(obj);
|
||||
break;
|
||||
}
|
||||
case IS_RESOURCE: {
|
||||
zend_resource *res = (zend_resource*)p;
|
||||
|
||||
/* destroy resource */
|
||||
zend_list_free(res);
|
||||
if (--GC_REFCOUNT(res) == 0) {
|
||||
/* destroy resource */
|
||||
zend_list_free(res);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case IS_REFERENCE: {
|
||||
zend_reference *ref = (zend_reference*)p;
|
||||
if (--GC_REFCOUNT(ref) == 0) {
|
||||
|
||||
i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC);
|
||||
efree_size(ref, sizeof(zend_reference));
|
||||
i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC);
|
||||
efree_size(ref, sizeof(zend_reference));
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -915,7 +915,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
|
||||
pbuffer = (REPARSE_DATA_BUFFER *)do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large);
|
||||
if (pbuffer == NULL) {
|
||||
CloseHandle(hLink);
|
||||
return -1;
|
||||
}
|
||||
if(!DeviceIoControl(hLink, FSCTL_GET_REPARSE_POINT, NULL, 0, pbuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &retlength, NULL)) {
|
||||
@@ -1187,7 +1186,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
int add_slash;
|
||||
void *tmp;
|
||||
|
||||
if (path_length <= 0 || path_length >= MAXPATHLEN-1) {
|
||||
if (path_length == 0 || path_length >= MAXPATHLEN-1) {
|
||||
#ifdef ZEND_WIN32
|
||||
_set_errno(EINVAL);
|
||||
#else
|
||||
@@ -1854,7 +1853,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
|
||||
#else /* Unix */
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
|
||||
{
|
||||
size_t command_length;
|
||||
int command_length;
|
||||
int dir_length, extra = 0;
|
||||
char *command_line;
|
||||
char *ptr, *dir;
|
||||
|
||||
+90
-118
@@ -2312,7 +2312,6 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
|
||||
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) &&
|
||||
UNEXPECTED(!Z_ISREF_P(EX_VAR(opline->op1.var)))) {
|
||||
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");
|
||||
FREE_UNFETCHED_OP1();
|
||||
FREE_OP2_VAR_PTR();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -3012,19 +3011,15 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, CONST|TMPVAR|UNUSED|CV, CONST|TMPVAR
|
||||
GC_REFCOUNT(obj)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
FREE_OP2();
|
||||
FREE_OP1();
|
||||
|
||||
if ((OP1_TYPE & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, obj);
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
FREE_OP2();
|
||||
FREE_OP1();
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSED|CV)
|
||||
@@ -3165,7 +3160,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST)
|
||||
@@ -3287,6 +3282,7 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
called_scope = NULL;
|
||||
object = NULL;
|
||||
}
|
||||
FREE_OP2();
|
||||
} else if (OP2_TYPE != IS_CONST &&
|
||||
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
|
||||
Z_OBJ_HANDLER_P(function_name, get_closure) &&
|
||||
@@ -3300,6 +3296,7 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
call_info |= ZEND_CALL_RELEASE_THIS;
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
FREE_OP2();
|
||||
} else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
|
||||
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
|
||||
zval *obj;
|
||||
@@ -3383,6 +3380,7 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
}
|
||||
FREE_OP2();
|
||||
} else if ((OP2_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(function_name) == IS_REFERENCE) {
|
||||
function_name = Z_REFVAL_P(function_name);
|
||||
ZEND_VM_C_GOTO(try_function_name);
|
||||
@@ -3397,18 +3395,6 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
FREE_OP2();
|
||||
if ((OP2_TYPE & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
if (call_info & ZEND_CALL_RELEASE_THIS) {
|
||||
zend_object_release(object);
|
||||
}
|
||||
if (fbc->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
|
||||
zend_string_release(fbc->common.function_name);
|
||||
zend_free_trampoline(fbc);
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
fbc, opline->extended_value, called_scope, object);
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -3434,19 +3420,6 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV)
|
||||
function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
|
||||
func = fcc.function_handler;
|
||||
called_scope = fcc.called_scope;
|
||||
object = fcc.object;
|
||||
if (error) {
|
||||
efree(error);
|
||||
/* This is the only soft error is_callable() can generate */
|
||||
zend_error(E_DEPRECATED,
|
||||
"Non-static method %s::%s() should not be called statically",
|
||||
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
FREE_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
}
|
||||
if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
|
||||
/* Delay closure destruction until its invocation */
|
||||
if (OP2_TYPE & (IS_VAR|IS_CV)) {
|
||||
@@ -3456,28 +3429,25 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV)
|
||||
GC_REFCOUNT((zend_object*)func->common.prototype)++;
|
||||
call_info |= ZEND_CALL_CLOSURE;
|
||||
}
|
||||
called_scope = fcc.called_scope;
|
||||
object = fcc.object;
|
||||
if (object) {
|
||||
call_info |= ZEND_CALL_RELEASE_THIS;
|
||||
GC_REFCOUNT(object)++; /* For $this pointer */
|
||||
}
|
||||
|
||||
FREE_OP2();
|
||||
if ((OP2_TYPE & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) {
|
||||
if (call_info & ZEND_CALL_CLOSURE) {
|
||||
zend_object_release((zend_object*)func->common.prototype);
|
||||
if (error) {
|
||||
efree(error);
|
||||
/* This is the only soft error is_callable() can generate */
|
||||
zend_error(E_DEPRECATED,
|
||||
"Non-static method %s::%s() should not be called statically",
|
||||
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (call_info & ZEND_CALL_RELEASE_THIS) {
|
||||
zend_object_release(object);
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else {
|
||||
zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
|
||||
efree(error);
|
||||
FREE_OP2();
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
func = (zend_function*)&zend_pass_function;
|
||||
called_scope = NULL;
|
||||
object = NULL;
|
||||
@@ -3488,7 +3458,8 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV)
|
||||
call->prev_execute_data = EX(call);
|
||||
EX(call) = call;
|
||||
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
FREE_OP2();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST)
|
||||
@@ -4182,7 +4153,6 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
|
||||
USE_OPLINE
|
||||
zend_class_entry *ce, *catch_ce;
|
||||
zend_object *exception;
|
||||
zval *ex;
|
||||
|
||||
SAVE_OPLINE();
|
||||
/* Check whether an exception has been thrown, if not, jump over code */
|
||||
@@ -4217,12 +4187,8 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
|
||||
}
|
||||
|
||||
exception = EG(exception);
|
||||
ex = EX_VAR(opline->op2.var);
|
||||
if (UNEXPECTED(Z_ISREF_P(ex))) {
|
||||
ex = Z_REFVAL_P(ex);
|
||||
}
|
||||
zval_ptr_dtor(ex);
|
||||
ZVAL_OBJ(ex, EG(exception));
|
||||
zval_ptr_dtor(EX_VAR(opline->op2.var));
|
||||
ZVAL_OBJ(EX_VAR(opline->op2.var), EG(exception));
|
||||
if (UNEXPECTED(EG(exception) != exception)) {
|
||||
GC_REFCOUNT(EG(exception))++;
|
||||
HANDLE_EXCEPTION();
|
||||
@@ -4333,24 +4299,27 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR, ANY)
|
||||
|
||||
varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (EXPECTED(Z_ISREF_P(varptr) ||
|
||||
((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
|
||||
(opline->extended_value & ZEND_ARG_SEND_SILENT) :
|
||||
ARG_MAY_BE_SENT_BY_REF(EX(call)->func, opline->op2.num
|
||||
)))) {
|
||||
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
|
||||
ZVAL_COPY_VALUE(arg, varptr);
|
||||
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
|
||||
(Z_VAR_FLAGS_P(varptr) & IS_VAR_RET_REF)) &&
|
||||
(Z_ISREF_P(varptr) || Z_TYPE_P(varptr) == IS_OBJECT)) {
|
||||
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZVAL_MAKE_REF(varptr);
|
||||
} else {
|
||||
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
|
||||
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
|
||||
SAVE_OPLINE();
|
||||
zend_error(E_NOTICE, "Only variables should be passed by reference");
|
||||
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
|
||||
ZVAL_COPY_VALUE(arg, varptr);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
}
|
||||
|
||||
SAVE_OPLINE();
|
||||
zend_error(E_NOTICE, "Only variables should be passed by reference");
|
||||
|
||||
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
|
||||
ZVAL_COPY_VALUE(arg, varptr);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
|
||||
@@ -4456,7 +4425,7 @@ ZEND_VM_C_LABEL(send_again):
|
||||
|
||||
zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht));
|
||||
|
||||
if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_REFCOUNT_P(args) > 1) {
|
||||
if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
|
||||
uint32_t i;
|
||||
int separate = 0;
|
||||
|
||||
@@ -4468,7 +4437,7 @@ ZEND_VM_C_LABEL(send_again):
|
||||
}
|
||||
}
|
||||
if (separate) {
|
||||
SEPARATE_ARRAY(args);
|
||||
zval_copy_ctor(args);
|
||||
ht = Z_ARRVAL_P(args);
|
||||
}
|
||||
}
|
||||
@@ -4482,7 +4451,7 @@ ZEND_VM_C_LABEL(send_again):
|
||||
|
||||
top = ZEND_CALL_ARG(EX(call), arg_num);
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
|
||||
if (Z_REFCOUNT_P(args) == 1) {
|
||||
if (!Z_IMMUTABLE_P(args)) {
|
||||
ZVAL_MAKE_REF(arg);
|
||||
Z_ADDREF_P(arg);
|
||||
ZVAL_REF(top, Z_REF_P(arg));
|
||||
@@ -4625,7 +4594,6 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY)
|
||||
EX(call)->func = (zend_function*)&zend_pass_function;
|
||||
EX(call)->called_scope = NULL;
|
||||
Z_OBJ(EX(call)->This) = NULL;
|
||||
ZEND_SET_CALL_INFO(EX(call), ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS);
|
||||
} else {
|
||||
uint32_t arg_num;
|
||||
HashTable *ht;
|
||||
@@ -4635,6 +4603,22 @@ ZEND_VM_C_LABEL(send_array):
|
||||
ht = Z_ARRVAL_P(args);
|
||||
zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht));
|
||||
|
||||
if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
|
||||
int separate = 0;
|
||||
|
||||
/* check if any of arguments are going to be passed by reference */
|
||||
for (arg_num = 0; arg_num < zend_hash_num_elements(ht); arg_num++) {
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num + 1)) {
|
||||
separate = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (separate) {
|
||||
zval_copy_ctor(args);
|
||||
ht = Z_ARRVAL_P(args);
|
||||
}
|
||||
}
|
||||
|
||||
arg_num = 1;
|
||||
param = ZEND_CALL_ARG(EX(call), 1);
|
||||
ZEND_HASH_FOREACH_VAL(ht, arg) {
|
||||
@@ -4657,18 +4641,24 @@ ZEND_VM_C_LABEL(send_array):
|
||||
EX(call)->func = (zend_function*)&zend_pass_function;
|
||||
EX(call)->called_scope = NULL;
|
||||
Z_OBJ(EX(call)->This) = NULL;
|
||||
ZEND_SET_CALL_INFO(EX(call), ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
ZVAL_NEW_REF(arg, arg);
|
||||
}
|
||||
} else {
|
||||
Z_ADDREF_P(arg);
|
||||
} else{
|
||||
if (Z_ISREF_P(arg) &&
|
||||
!(EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
|
||||
/* don't separate references for __call */
|
||||
arg = Z_REFVAL_P(arg);
|
||||
}
|
||||
if (Z_OPT_REFCOUNTED_P(arg)) {
|
||||
Z_ADDREF_P(arg);
|
||||
}
|
||||
}
|
||||
ZVAL_COPY(param, arg);
|
||||
ZVAL_COPY_VALUE(param, arg);
|
||||
ZEND_CALL_NUM_ARGS(EX(call))++;
|
||||
arg_num++;
|
||||
param++;
|
||||
@@ -4690,6 +4680,7 @@ ZEND_VM_HANDLER(120, ZEND_SEND_USER, VAR|CV, ANY)
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
|
||||
if (UNEXPECTED(!Z_ISREF_P(arg))) {
|
||||
|
||||
if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
|
||||
|
||||
zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given",
|
||||
@@ -4708,20 +4699,25 @@ ZEND_VM_HANDLER(120, ZEND_SEND_USER, VAR|CV, ANY)
|
||||
EX(call)->func = (zend_function*)&zend_pass_function;
|
||||
EX(call)->called_scope = NULL;
|
||||
Z_OBJ(EX(call)->This) = NULL;
|
||||
ZEND_SET_CALL_INFO(EX(call), ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS);
|
||||
|
||||
FREE_OP1();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
ZVAL_NEW_REF(arg, arg);
|
||||
}
|
||||
Z_ADDREF_P(arg);
|
||||
} else {
|
||||
if (Z_ISREF_P(arg) &&
|
||||
!(EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
|
||||
/* don't separate references for __call */
|
||||
arg = Z_REFVAL_P(arg);
|
||||
}
|
||||
if (Z_OPT_REFCOUNTED_P(arg)) {
|
||||
Z_ADDREF_P(arg);
|
||||
}
|
||||
}
|
||||
ZVAL_COPY(param, arg);
|
||||
ZVAL_COPY_VALUE(param, arg);
|
||||
|
||||
FREE_OP1();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -4740,7 +4736,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
|
||||
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
|
||||
|
||||
SAVE_OPLINE();
|
||||
if (UNEXPECTED(!zend_verify_arg_type(EX(func), arg_num, param, NULL, CACHE_ADDR(opline->op2.num)) || EG(exception))) {
|
||||
if (UNEXPECTED(!zend_verify_arg_type(EX(func), arg_num, param, NULL, CACHE_ADDR(opline->op2.num)))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
}
|
||||
@@ -4778,7 +4774,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
|
||||
zval *default_value = EX_CONSTANT(opline->op2);
|
||||
|
||||
SAVE_OPLINE();
|
||||
if (UNEXPECTED(!zend_verify_arg_type(EX(func), arg_num, param, default_value, CACHE_ADDR(Z_CACHE_SLOT_P(default_value))) || EG(exception))) {
|
||||
if (UNEXPECTED(!zend_verify_arg_type(EX(func), arg_num, param, default_value, CACHE_ADDR(Z_CACHE_SLOT_P(default_value))))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
}
|
||||
@@ -4974,7 +4970,7 @@ ZEND_VM_HANDLER(68, ZEND_NEW, CONST|VAR, ANY)
|
||||
ZVAL_COPY(EX_VAR(opline->result.var), &object_zval);
|
||||
}
|
||||
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5260,10 +5256,7 @@ ZEND_VM_C_LABEL(num_index):
|
||||
}
|
||||
FREE_OP2();
|
||||
} else {
|
||||
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
|
||||
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
|
||||
zval_ptr_dtor(expr_ptr);
|
||||
}
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
@@ -5486,10 +5479,6 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY)
|
||||
}
|
||||
FREE_OP1();
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (new_op_array != NULL) {
|
||||
destroy_op_array(new_op_array);
|
||||
efree_size(new_op_array, sizeof(zend_op_array));
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (EXPECTED(new_op_array != NULL)) {
|
||||
zval *return_value = NULL;
|
||||
@@ -6789,10 +6778,9 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY)
|
||||
} else if (OP1_TYPE == IS_VAR && ref) {
|
||||
zend_reference *r = Z_REF_P(ref);
|
||||
|
||||
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
|
||||
if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
|
||||
efree_size(r, sizeof(zend_reference));
|
||||
} else if (Z_OPT_REFCOUNTED_P(value)) {
|
||||
Z_ADDREF_P(value);
|
||||
}
|
||||
}
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
@@ -6830,10 +6818,9 @@ ZEND_VM_HANDLER(169, ZEND_COALESCE, CONST|TMP|VAR|CV, ANY)
|
||||
} else if (OP1_TYPE == IS_VAR && ref) {
|
||||
zend_reference *r = Z_REF_P(ref);
|
||||
|
||||
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
|
||||
if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
|
||||
efree_size(r, sizeof(zend_reference));
|
||||
} else if (Z_OPT_REFCOUNTED_P(value)) {
|
||||
Z_ADDREF_P(value);
|
||||
}
|
||||
}
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
@@ -6848,36 +6835,30 @@ ZEND_VM_HANDLER(22, ZEND_QM_ASSIGN, CONST|TMP|VAR|CV, ANY)
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval *value;
|
||||
zval *result = EX_VAR(opline->result.var);
|
||||
|
||||
value = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(value, BP_VAR_R);
|
||||
ZVAL_NULL(result);
|
||||
ZVAL_NULL(EX_VAR(opline->result.var));
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
if (OP1_TYPE == IS_CV) {
|
||||
ZVAL_DEREF(value);
|
||||
ZVAL_COPY(result, value);
|
||||
} else if (OP1_TYPE == IS_VAR) {
|
||||
if (UNEXPECTED(Z_ISREF_P(value))) {
|
||||
ZVAL_COPY_VALUE(result, Z_REFVAL_P(value));
|
||||
if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) && Z_ISREF_P(value)) {
|
||||
ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value));
|
||||
if (OP1_TYPE == IS_VAR) {
|
||||
if (UNEXPECTED(Z_DELREF_P(value) == 0)) {
|
||||
efree_size(Z_REF_P(value), sizeof(zend_reference));
|
||||
} else if (Z_OPT_REFCOUNTED_P(result)) {
|
||||
Z_ADDREF_P(result);
|
||||
}
|
||||
} else {
|
||||
ZVAL_COPY_VALUE(result, value);
|
||||
}
|
||||
} else {
|
||||
ZVAL_COPY_VALUE(result, value);
|
||||
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
|
||||
if (OP1_TYPE == IS_CONST) {
|
||||
if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
|
||||
zval_copy_ctor_func(result);
|
||||
zval_copy_ctor_func(EX_VAR(opline->result.var));
|
||||
}
|
||||
} else if (OP1_TYPE == IS_CV) {
|
||||
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
|
||||
}
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
@@ -7320,12 +7301,11 @@ ZEND_VM_HANDLER(156, ZEND_SEPARATE, VAR, UNUSED)
|
||||
if (UNEXPECTED(Z_ISREF_P(var_ptr))) {
|
||||
if (UNEXPECTED(Z_REFCOUNT_P(var_ptr) == 1)) {
|
||||
ZVAL_UNREF(var_ptr);
|
||||
} else if (!(Z_VAR_FLAGS_P(var_ptr) & IS_VAR_RET_REF)) {
|
||||
Z_DELREF_P(var_ptr);
|
||||
ZVAL_COPY(var_ptr, Z_REFVAL_P(var_ptr));
|
||||
}
|
||||
} else if (Z_COPYABLE_P(var_ptr) && Z_REFCOUNT_P(var_ptr) > 1) {
|
||||
Z_DELREF_P(var_ptr);
|
||||
ZVAL_DUP(EX_VAR(opline->op1.var), var_ptr);
|
||||
}
|
||||
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
@@ -7483,12 +7463,6 @@ ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
|
||||
SAVE_OPLINE();
|
||||
val = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R);
|
||||
|
||||
if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
|
||||
zend_throw_error(NULL, "Cannot use \"yield from\" in a force-closed generator");
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(val) == IS_ARRAY) {
|
||||
ZVAL_COPY_VALUE(&generator->values, val);
|
||||
if (OP1_TYPE != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
|
||||
@@ -7510,14 +7484,12 @@ ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
|
||||
if (Z_ISUNDEF(new_gen->retval)) {
|
||||
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
|
||||
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
|
||||
zval_ptr_dtor(val);
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
zend_generator_yield_from(generator, new_gen);
|
||||
}
|
||||
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
|
||||
zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
|
||||
zval_ptr_dtor(val);
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
|
||||
+206
-422
File diff suppressed because it is too large.
Load diff
+1
-6
@@ -2672,14 +2672,10 @@ AC_DEFUN([PHP_CONFIG_NICE],[
|
||||
|
||||
EOF
|
||||
|
||||
clean_configure_args=$ac_configure_args
|
||||
for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS EXTRA_LDFLAGS_PROGRAM LIBS CC CXX; do
|
||||
eval val=\$$var
|
||||
if test -n "$val"; then
|
||||
echo "$var='$val' \\" >> $1
|
||||
if test `expr "X$ac_configure_args" : ".*${var}.*"` != 0; then
|
||||
clean_configure_args=$(echo $clean_configure_args | sed -e "s#'$var=$val'##")
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -2689,8 +2685,7 @@ EOF
|
||||
else
|
||||
CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0"
|
||||
fi
|
||||
|
||||
for arg in $clean_configure_args; do
|
||||
for arg in $ac_configure_args; do
|
||||
if test `expr -- $arg : "'.*"` = 0; then
|
||||
if test `expr -- $arg : "-.*"` = 0 && test `expr -- $arg : ".*=.*"` = 0; then
|
||||
continue;
|
||||
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=0
|
||||
PHP_RELEASE_VERSION=14
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_RELEASE_VERSION=6
|
||||
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`
|
||||
|
||||
|
||||
@@ -49,10 +49,7 @@ _bc_new_num_ex (length, scale, persistent)
|
||||
int length, scale, persistent;
|
||||
{
|
||||
bc_num temp;
|
||||
/* PHP Change: add length check */
|
||||
if ((size_t)length+(size_t)scale > INT_MAX) {
|
||||
zend_error(E_ERROR, "Result too long, max is %d", INT_MAX);
|
||||
}
|
||||
|
||||
/* PHP Change: malloc() -> pemalloc(), removed free_list code */
|
||||
temp = (bc_num) safe_pemalloc (1, sizeof(bc_struct)+length, scale, persistent);
|
||||
#if 0
|
||||
|
||||
@@ -41,5 +41,6 @@
|
||||
|
||||
void bc_out_of_memory (void)
|
||||
{
|
||||
zend_error(E_ERROR, "bcmath: out of memory!");
|
||||
(void) fprintf (stderr, "bcmath: out of memory!\n");
|
||||
exit (1);
|
||||
}
|
||||
Loaded 100 of 807 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user