mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 11:10:49 +00:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e000b401ac | ||
|
|
5c34a30bdb | ||
|
|
8a0c388e11 | ||
|
|
49e9ae1fc1 | ||
|
|
76b2f2ff5d | ||
|
|
d699a81277 | ||
|
|
892f2e5120 |
No files matched your search
+3
-2
@@ -18,12 +18,13 @@ clone_depth: 64
|
||||
|
||||
cache:
|
||||
- c:\build-cache
|
||||
- c:\build-cache\sdk -> .appveyor.yml
|
||||
|
||||
environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.13
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.0beta1
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
@@ -42,7 +43,7 @@ environment:
|
||||
services:
|
||||
# the setup scripts have to be touched, once some other db version is used
|
||||
- mysql
|
||||
- postgresql96
|
||||
- postgresql95
|
||||
|
||||
platform:
|
||||
- x64
|
||||
|
||||
+6
-25
@@ -1,35 +1,16 @@
|
||||
# http://editorconfig.org/
|
||||
; http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*.{c,h,awk,w32,bat,mk,frag}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
[*.{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
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{php,phpt}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{yml,m4,sh}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
[*.yml]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = true
|
||||
@@ -15,8 +15,11 @@ ext/dba/libflatfile/flatfile.c ident
|
||||
ext/dba/libcdb/cdb_make.c ident
|
||||
ext/dba/libcdb/cdb.c ident
|
||||
ext/filter/filter.c ident
|
||||
ext/zip/php_zip.c ident
|
||||
README.input_filter ident
|
||||
run-tests.php ident
|
||||
sapi/nsapi/nsapi.c ident
|
||||
sapi/continuity/capi.c ident
|
||||
Zend/RFCs/002.txt ident
|
||||
Zend/RFCs/003.txt ident
|
||||
ext/exif/exif.c ident
|
||||
@@ -29,6 +32,7 @@ UPGRADING.INTERNALS merge=NEWS
|
||||
/ext/bz2/tests/with_strings.phpt -crlf
|
||||
/ext/dom/tests/bug40836.phpt -crlf
|
||||
/ext/dom/tests/domelement.phpt -crlf
|
||||
/ext/ereg/tests/eregi_basic_002.phpt -crlf
|
||||
/ext/iconv/tests/iconv004.phpt -crlf
|
||||
/ext/iconv/tests/iconv_basic.phpt -crlf
|
||||
/ext/iconv/tests/iconv_strpos.phpt -crlf
|
||||
|
||||
@@ -262,7 +262,9 @@ pear/phpize
|
||||
pear/run-tests
|
||||
pear/php-config
|
||||
pear/scripts
|
||||
sapi/apache/libphp7.module
|
||||
sapi/apache2handler/libphp7.module
|
||||
sapi/apache_hooks/libphp7.module
|
||||
sapi/cgi/php-cgi
|
||||
sapi/cgi/php-cgi.1
|
||||
sapi/cli/php.1
|
||||
|
||||
+1
-2
@@ -1,4 +1,3 @@
|
||||
dist: trusty
|
||||
language: c
|
||||
sudo: false
|
||||
addons:
|
||||
@@ -58,4 +57,4 @@ before_script:
|
||||
|
||||
# Run PHPs run-tests.php
|
||||
script:
|
||||
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120
|
||||
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php $(if [ $ENABLE_DEBUG == 1 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120
|
||||
+5
-5
@@ -5,7 +5,7 @@ INSTALL_DATA = $(INSTALL) -m 644
|
||||
DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
|
||||
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
|
||||
|
||||
all: $(all_targets)
|
||||
all: $(all_targets)
|
||||
@echo
|
||||
@echo "Build complete."
|
||||
@echo "Don't forget to run 'make test'."
|
||||
@@ -53,7 +53,7 @@ install-headers:
|
||||
paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \
|
||||
done; \
|
||||
$(mkinstalldirs) $$paths && \
|
||||
echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
|
||||
echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
|
||||
for i in `echo $(INSTALL_HEADERS)`; do \
|
||||
if test "$(PHP_PECL_EXTENSION)"; then \
|
||||
src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \
|
||||
@@ -112,13 +112,13 @@ test: all
|
||||
clean:
|
||||
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
|
||||
find . -name \*.lo -o -name \*.o | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.so | xargs rm -f
|
||||
find . -name .libs -a -type d|xargs rm -rf
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f php7.spec main/build-defs.h scripts/phpize
|
||||
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
|
||||
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
|
||||
@@ -135,7 +135,7 @@ prof-gen:
|
||||
|
||||
prof-clean:
|
||||
find . -name \*.lo -o -name \*.o | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.so | xargs rm -f
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
|
||||
@@ -1,653 +1,5 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
07 Dec 2017, PHP 7.1.13RC1
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75573 (Segmentation fault in 7.1.12 and 7.0.26). (Laruence)
|
||||
. Fixed bug #75384 (PHP seems incompatible with OneDrive files on demand).
|
||||
(Anatol)
|
||||
. Fixed bug #74862 (Unable to clone instance when private __clone defined).
|
||||
(Daniel Ciochiu)
|
||||
. Fixed bug #75074 (php-process crash when is_file() is used with strings
|
||||
longer 260 chars). (Anatol)
|
||||
|
||||
- CLI Server:
|
||||
. Fixed bug #60471 (Random "Invalid request (unexpected EOF)" using a router
|
||||
script). (SammyK)
|
||||
. Fixed bug #73830 (Directory does not exist). (Anatol)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #64938 (libxml_disable_entity_loader setting is shared between
|
||||
requests). (Remi)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #75608 ("Narrowing occurred during type inference" error).
|
||||
(Laruence, Dmitry)
|
||||
. Fixed bug #75570 ("Narrowing occurred during type inference" error).
|
||||
(Dmitry)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #74183 (preg_last_error not returning error code after error).
|
||||
(Andrew Nester)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #75511 (fread not free unused buffer). (Laruence)
|
||||
. Fixed bug #75514 (mt_rand returns value outside [$min,$max]+ on 32-bit)
|
||||
(Remi)
|
||||
. Fixed bug #75535 (Inappropriately parsing HTTP response leads to PHP
|
||||
segment fault). (Nikita)
|
||||
. Fixed bug #75409 (accept EFAULT in addition to ENOSYS as indicator
|
||||
that getrandom() is missing). (sarciszewski)
|
||||
. Fixed bug #73124 (php_ini_scanned_files() not reporting correctly).
|
||||
(John Stevenson)
|
||||
. Fixed bug #75574 (putenv does not work properly if parameter contains
|
||||
non-ASCII unicode character). (Anatol)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #75540 (Segfault with libzip 1.3.1). (Remi)
|
||||
|
||||
23 Nov 2017, PHP 7.1.12
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75420 (Crash when modifing property name in __isset for
|
||||
BP_VAR_IS). (Laruence)
|
||||
. Fixed bug #75368 (mmap/munmap trashing on unlucky allocations). (Nikita,
|
||||
Dmitry)
|
||||
|
||||
- CLI:
|
||||
. Fixed bug #75287 (Builtin webserver crash after chdir in a shutdown
|
||||
function). (Laruence)
|
||||
|
||||
- Enchant:
|
||||
. Fixed bug #53070 (enchant_broker_get_path crashes if no path is set). (jelle
|
||||
van der Waa, cmb)
|
||||
. Fixed bug #75365 (Enchant still reports version 1.1.0). (cmb)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #75301 (Exif extension has built in revision version). (Peter
|
||||
Kokot)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #65148 (imagerotate may alter image dimensions). (cmb)
|
||||
. Fixed bug #75437 (Wrong reflection on imagewebp). (Fabien Villepinte)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #75317 (UConverter::setDestinationEncoding changes source instead
|
||||
of destination). (andrewnester)
|
||||
|
||||
- interbase:
|
||||
. Fixed bug #75453 (Incorrect reflection for ibase_[p]connect). (villfa)
|
||||
|
||||
- Mysqli:
|
||||
. Fixed bug #75434 (Wrong reflection for mysqli_fetch_all function). (Fabien
|
||||
Villepinte)
|
||||
|
||||
- OCI8:
|
||||
. Fixed valgrind issue. (Tianfang Yang)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #75363 (openssl_x509_parse leaks memory). (Bob, Jakub Zelenka)
|
||||
. Fixed bug #75307 (Wrong reflection for openssl_open function). (villfa)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #75373 (Warning Internal error: wrong size calculation). (Laruence, Dmitry)
|
||||
|
||||
- PGSQL:
|
||||
. Fixed bug #75419 (Default link incorrectly cleared/linked by pg_close()). (Sara)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #75464 (Wrong reflection on SoapClient::__setSoapHeaders). (villfa)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #75299 (Wrong reflection on inflate_init and inflate_add). (Fabien
|
||||
Villepinte)
|
||||
|
||||
26 Oct 2017, PHP 7.1.11
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
|
||||
(Laruence)
|
||||
. Fixed bug #75236 (infinite loop when printing an error-message). (Andrea)
|
||||
. Fixed bug #75252 (Incorrect token formatting on two parse errors in one
|
||||
request). (Nikita)
|
||||
. Fixed bug #75220 (Segfault when calling is_callable on parent).
|
||||
(andrewnester)
|
||||
. Fixed bug #75290 (debug info of Closures of internal functions contain
|
||||
garbage argument names). (Andrea)
|
||||
|
||||
- Apache2Handler:
|
||||
. Fixed bug #75311 (error: 'zend_hash_key' has no member named 'arKey' in
|
||||
apache2handler). (mcarbonneaux)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #75055 (Out-Of-Bounds Read in timelib_meridian()). (Derick)
|
||||
|
||||
- Hash:
|
||||
. Fixed bug #75303 (sha3 hangs on bigendian). (Remi)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #75318 (The parameter of UConverter::getAliases() is not
|
||||
optional). (cmb)
|
||||
|
||||
- litespeed:
|
||||
. Fixed bug #75248 (Binary directory doesn't get created when building
|
||||
only litespeed SAPI). (petk)
|
||||
. Fixed bug #75251 (Missing program prefix and suffix). (petk)
|
||||
|
||||
- mcrypt:
|
||||
. Fixed bug #72535 (arcfour encryption stream filter crashes php). (Leigh)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #75018 (Data corruption when reading fields of bit type). (Anatol)
|
||||
|
||||
- OCI8:
|
||||
. Fixed incorrect reference counting. (Dmitry, Tianfang Yang)
|
||||
|
||||
- Opcache
|
||||
. Fixed bug #75255 (Request hangs and not finish). (Dmitry)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #75207 (applied upstream patch for CVE-2016-1283). (Anatol)
|
||||
|
||||
- PDO_mysql:
|
||||
. Fixed bug #75177 (Type 'bit' is fetched as unexpected string). (Anatol)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags).
|
||||
(J. Jeising, cmb)
|
||||
|
||||
28 Sep 2017, PHP 7.1.10
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75042 (run-tests.php issues with EXTENSION block). (John Boehr)
|
||||
|
||||
- BCMath:
|
||||
. Fixed bug #44995 (bcpowmod() fails if scale != 0). (cmb)
|
||||
. Fixed bug #46781 (BC math handles minus zero incorrectly). (cmb)
|
||||
. Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1). (okano1220, cmb)
|
||||
. Fixed bug #75178 (bcpowmod() misbehaves for non-integer base or modulus). (cmb)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #70470 (Built-in server truncates headers spanning over TCP
|
||||
packets). (bouk)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #75093 (OpenSSL support not detected). (Remi)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #75124 (gdImageGrayScale() may produce colors). (cmb)
|
||||
. Fixed bug #75139 (libgd/gd_interpolation.c:1786: suspicious if ?). (cmb)
|
||||
|
||||
- Gettext:
|
||||
. Fixed bug #73730 (textdomain(null) throws in strict mode). (cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #75090 (IntlGregorianCalendar doesn't have constants from parent
|
||||
class). (tpunt)
|
||||
. Fixed bug #75193 (segfault in collator_convert_object_to_string). (Remi)
|
||||
|
||||
- PDO_OCI:
|
||||
. Fixed bug #74631 (PDO_PCO with PHP-FPM: OCI environment initialized
|
||||
before PHP-FPM sets it up). (Ingmar Runge)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #75155 (AppendIterator::append() is broken when appending another
|
||||
AppendIterator). (Nikita)
|
||||
. Fixed bug #75173 (incorrect behavior of AppendIterator::append in foreach loop).
|
||||
(jhdxr)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #75152 (signed integer overflow in parse_iv). (Laruence)
|
||||
. Fixed bug #75097 (gethostname fails if your host name is 64 chars long). (Andrea)
|
||||
|
||||
31 Aug 2017, PHP 7.1.9
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74947 (Segfault in scanner on INF number). (Laruence)
|
||||
. Fixed bug #74954 (null deref and segfault in zend_generator_resume()). (Bob)
|
||||
. Fixed bug #74725 (html_errors=1 breaks unhandled exceptions). (Andrea)
|
||||
. Fixed bug #75063 (Main CWD initialized with wrong codepage). (Anatol)
|
||||
. Fixed bug #75349 (NAN comparison). (Sara)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #74125 (Fixed finding CURL on systems with multiarch support).
|
||||
(cebe)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #75002 (Null Pointer Dereference in timelib_time_clone). (Derick)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #74993 (Wrong reflection on some locale_* functions). (Sara)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #71606 (Segmentation fault mb_strcut with HTML-ENTITIES encoding).
|
||||
(cmb)
|
||||
. Fixed bug #62934 (mb_convert_kana() does not convert iteration marks).
|
||||
(Nikita)
|
||||
. Fixed bug #75001 (Wrong reflection on mb_eregi_replace). (Fabien
|
||||
Villepinte)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #74968 (PHP crashes when calling mysqli_result::fetch_object with
|
||||
an abstract class). (Anatol)
|
||||
|
||||
- OCI8:
|
||||
. Expose oci_unregister_taf_callback() (Tianfang Yang)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74980 (Narrowing occurred during type inference). (Laruence)
|
||||
|
||||
- phar:
|
||||
. Fixed bug #74991 (include_path has a 4096 char limit in some cases).
|
||||
(bwbroersma)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #74949 (null pointer dereference in _function_string). (Laruence)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #74892 (Url Rewriting (trans_sid) not working on urls that start
|
||||
with "#"). (Andrew Nester)
|
||||
. Fixed bug #74833 (SID constant created with wrong module number). (Anatol)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #74950 (nullpointer deref in simplexml_element_getDocNamespaces).
|
||||
(Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #75049 (spl_autoload_unregister can't handle
|
||||
spl_autoload_functions results). (Laruence)
|
||||
. Fixed bug #74669 (Unserialize ArrayIterator broken). (Andrew Nester)
|
||||
. Fixed bug #74977 (Appending AppendIterator leads to segfault).
|
||||
(Andrew Nester)
|
||||
. Fixed bug #75015 (Crash in recursive iterator destructors). (Julien)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #75075 (unpack with X* causes infinity loop). (Laruence)
|
||||
. Fixed bug #74103 (heap-use-after-free when unserializing invalid array
|
||||
size). (Nikita)
|
||||
. Fixed bug #75054 (A Denial of Service Vulnerability was found when
|
||||
performing deserialization). (Nikita)
|
||||
|
||||
- WDDX:
|
||||
. Fixed bug #73793 (WDDX uses wrong decimal seperator). (cmb)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #74975 (Incorrect xmlrpc serialization for classes with declared
|
||||
properties). (blar)
|
||||
|
||||
03 Aug 2017, PHP 7.1.8
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74832 (Loading PHP extension with already registered function
|
||||
name leads to a crash). (jpauli)
|
||||
. Fixed bug #74780 (parse_url() broken when query string contains colon).
|
||||
(jhdxr)
|
||||
. Fixed bug #74761 (Unary operator expected error on some systems). (petk)
|
||||
. Fixed bug #73900 (Use After Free in unserialize() SplFixedArray). (nikic)
|
||||
. Fixed bug #74923 (Crash when crawling through network share). (Anatol)
|
||||
. Fixed bug #74913 (fixed incorrect poll.h include). (petk)
|
||||
. Fixed bug #74906 (fixed incorrect errno.h include). (petk)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #74852 (property_exists returns true on unknown DateInterval
|
||||
property). (jhdxr)
|
||||
|
||||
- OCI8:
|
||||
. Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74623 (Infinite loop in type inference when using HTMLPurifier).
|
||||
(nikic)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #74798 (pkcs7_en/decrypt does not work if \x0a is used in content).
|
||||
(Anatol)
|
||||
. Added OPENSSL_DONT_ZERO_PAD_KEY constant to prevent key padding and fix bug
|
||||
#71917 (openssl_open() returns junk on envelope < 16 bytes) and bug #72362
|
||||
(OpenSSL Blowfish encryption is incorrect for short keys). (Jakub Zelenka)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #69356 (PDOStatement::debugDumpParams() truncates query). (Adam
|
||||
Baratz)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #73471 (PHP freezes with AppendIterator). (jhdxr)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #74883 (SQLite3::__construct() produces "out of memory" exception
|
||||
with invalid flags). (Anatol)
|
||||
|
||||
- Wddx:
|
||||
. Fixed bug #73173 (huge memleak when wddx_unserialize).
|
||||
(tloi at fortinet dot com)
|
||||
|
||||
- zlib:
|
||||
. Fixed bug #73944 (dictionary option of inflate_init() does not work).
|
||||
(wapmorgan)
|
||||
|
||||
06 Jul 2017, PHP 7.1.7
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74738 (Multiple [PATH=] and [HOST=] sections not properly
|
||||
parsed). (Manuel Mausz)
|
||||
. Fixed bug #74658 (Undefined constants in array properties result in broken
|
||||
properties). (Laruence)
|
||||
. Fixed misparsing of abstract unix domain socket names. (Sara)
|
||||
. Fixed bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability).
|
||||
(Stas)
|
||||
. Fixed bug #74101, bug #74614 (Unserialize Heap Use-After-Free (READ: 1) in
|
||||
zval_get_type). (Nikita)
|
||||
. Fixed bug #74111 (Heap buffer overread (READ: 1) finish_nested_data from
|
||||
unserialize). (Nikita)
|
||||
. Fixed bug #74819 (wddx_deserialize() heap out-of-bound read via
|
||||
php_parse_date()). (Derick)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #74639 (implement clone for DatePeriod and DateInterval).
|
||||
(andrewnester)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #69373 (References to deleted XPath query results). (ttoohey)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #74435 (Buffer over-read into uninitialized memory). (cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #73473 (Stack Buffer Overflow in msgfmt_parse_message). (libnex)
|
||||
. Fixed bug #74705 (Wrong reflection on Collator::getSortKey and
|
||||
collator_get_sort_key). (Tyson Andre, Remi)
|
||||
|
||||
- Mbstring:
|
||||
. Add oniguruma upstream fix (CVE-2017-9224, CVE-2017-9226, CVE-2017-9227,
|
||||
CVE-2017-9228, CVE-2017-9229) (Remi, Mamoru TASAKA)
|
||||
|
||||
- OCI8:
|
||||
. Add TAF callback (PR #2459). (KoenigsKind)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74663 (Segfault with opcache.memory_protect and
|
||||
validate_timestamp). (Laruence)
|
||||
. Revert opcache.enable_cli to default disabled. (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #74720 (pkcs7_en/decrypt does not work if \x1a is used in
|
||||
content). (Anatol)
|
||||
. Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
|
||||
(Stas)
|
||||
|
||||
- PDO_OCI:
|
||||
. Support Instant Client 12.2 in --with-pdo-oci configure option.
|
||||
(Tianfang Yang)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #74673 (Segfault when cast Reflection object to string with
|
||||
undefined constant). (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #74478 (null coalescing operator failing with SplFixedArray).
|
||||
(jhdxr)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #74598 (ftp:// wrapper ignores context arg). (Sara)
|
||||
|
||||
- PHAR:
|
||||
. Fixed bug #74386 (Phar::__construct reflection incorrect). (villfa)
|
||||
|
||||
- SOAP
|
||||
. Fixed bug #74679 (Incorrect conversion array with WSDL_CACHE_MEMORY).
|
||||
(Dmitry)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #74556 (stream_socket_get_name() returns '\0'). (Sara)
|
||||
|
||||
8 Jun 2017, PHP 7.1.6
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74600 (crash (SIGSEGV) in _zend_hash_add_or_update_i).
|
||||
(Laruence)
|
||||
. Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST).
|
||||
(Laruence)
|
||||
. Fixed bug #74589 (__DIR__ wrong for unicode character). (Anatol)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #74468 (wrong reflection on Collator::sortWithSortKeys). (villfa)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #74547 (mysqli::change_user() doesn't accept null as $database
|
||||
argument w/strict_types). (Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74596 (SIGSEGV with opcache.revalidate_path enabled). (Laruence)
|
||||
|
||||
- phar:
|
||||
. Fixed bug #51918 (Phar::webPhar() does not handle requests sent through PUT
|
||||
and DELETE method). (Christian Weiske)
|
||||
|
||||
- Readline:
|
||||
. Fixed bug #74490 (readline() moves the cursor to the beginning of the line).
|
||||
(Anatol)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #74510 (win32/sendmail.c anchors CC header but not BCC).
|
||||
(Damian Wadley, Anatol)
|
||||
|
||||
- xmlreader:
|
||||
. Fixed bug #74457 (Wrong reflection on XMLReader::expand). (villfa)
|
||||
|
||||
11 May 2017, PHP 7.1.5
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74408 (Endless loop bypassing execution time limit). (Laruence)
|
||||
. Fixed bug #74353 (Segfault when killing within bash script trap code).
|
||||
(Laruence)
|
||||
. Fixed bug #74340 (Magic function __get has different behavior in php 7.1.x).
|
||||
(Nikita)
|
||||
. Fixed bug #74188 (Null coalescing operator fails for undeclared static
|
||||
class properties). (tpunt)
|
||||
. Fixed bug #74444 (multiple catch freezes in some cases). (David Matějka)
|
||||
. Fixed bug #74410 (stream_select() is broken on Windows Nanoserver).
|
||||
(Matt Ficken)
|
||||
. Fixed bug #74337 (php-cgi.exe crash on facebook callback).
|
||||
(Anton Serbulov)
|
||||
. Patch for bug #74216 was reverted. (Anatol)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #74404 (Wrong reflection on DateTimeZone::getTransitions).
|
||||
(krakjoe)
|
||||
. Fixed bug #74080 (add constant for RFC7231 format datetime). (duncan3dc)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #74416 (Wrong reflection on DOMNode::cloneNode).
|
||||
(Remi, Fabien Villepinte)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #74379 (syntax error compile error in libmagic/apprentice.c).
|
||||
(Laruence)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #74343 (compile fails on solaris 11 with system gd2 library).
|
||||
(krakjoe)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #74432 (mysqli_connect adding ":3306" to $host if $port parameter
|
||||
not given). (Anatol)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #74376 (Invalid free of persistent results on error/connection
|
||||
loss). (Yussuf Khalil)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #65683 (Intl does not support DateTimeImmutable). (Ben Scholzen)
|
||||
. Fixed bug #74298 (IntlDateFormatter->format() doesn't return
|
||||
microseconds/fractions). (Andrew Nester)
|
||||
. Fixed bug #74433 (wrong reflection for Normalizer methods). (villfa)
|
||||
. Fixed bug #74439 (wrong reflection for Locale methods). (villfa)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74456 (Segmentation error while running a script in CLI mode).
|
||||
(Laruence)
|
||||
. Fixed bug #74431 (foreach infinite loop). (Nikita)
|
||||
. Fixed bug #74442 (Opcached version produces a nested array). (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #73833 (null character not allowed in openssl_pkey_get_private).
|
||||
(Jakub Zelenka)
|
||||
. Fixed bug #73711 (Segfault in openssl_pkey_new when generating DSA or DH
|
||||
key). (Jakub Zelenka)
|
||||
. Fixed bug #74341 (openssl_x509_parse fails to parse ASN.1 UTCTime without
|
||||
seconds). (Moritz Fain)
|
||||
. Fixed bug #73808 (iv length warning too restrictive for aes-128-ccm).
|
||||
(Jakub Zelenka)
|
||||
|
||||
- phar:
|
||||
. Fixed bug #74383 (phar method parameters reflection correction).
|
||||
(mhagstrand)
|
||||
|
||||
- Readline:
|
||||
. Fixed bug #74489 (readline() immediately returns false in interactive
|
||||
console mode). (Anatol)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #72071 (setcookie allows max-age to be negative). (Craig Duncan)
|
||||
. Fixed bug #74361 (Compaction in array_rand() violates COW). (Nikita)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #74429 (Remote socket URI with unique persistence identifier
|
||||
broken). (Sara)
|
||||
|
||||
13 Apr 2017, PHP 7.1.4
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74149 (static embed SAPI linkage error). (krakjoe)
|
||||
. Fixed bug #73370 (falsely exits with "Out of Memory" when using
|
||||
USE_ZEND_ALLOC=0). (Nikita)
|
||||
. Fixed bug #73960 (Leak with instance method calling static method with
|
||||
referenced return). (Nikita)
|
||||
. Fixed bug #69676 (Resolution of self::FOO in class constants not correct).
|
||||
(Nikita)
|
||||
. Fixed bug #74265 (Build problems after 7.0.17 release: undefined reference
|
||||
to `isfinite'). (Nikita)
|
||||
. Fixed bug #74302 (yield fromLABEL is over-greedy). (Sara)
|
||||
|
||||
- Apache:
|
||||
. Reverted patch for bug #61471, fixes bug #74318. (Anatol)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #72096 (Swatch time value incorrect for dates before 1970). (mcq8)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #74004 (LIBXML_NOWARNING flag ingnored on loadHTML*).
|
||||
(somedaysummer)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #74230 (iconv fails to fail on surrogates). (Anatol)
|
||||
|
||||
- OCI8:
|
||||
. Fixed uninitialized data causing random crash. (Dmitry)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74250 (OPcache compilation performance regression in PHP 5.6/7
|
||||
with huge classes). (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #72333 (fwrite() on non-blocking SSL sockets doesn't work).
|
||||
(Jakub Zelenka)
|
||||
|
||||
- PDO MySQL:
|
||||
. Fixed bug #71003 (Expose MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT to PDO
|
||||
interface). (Thomas Orozco)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #74058 (ArrayObject can not notice changes). (Andrew Nester)
|
||||
|
||||
- Sqlite:
|
||||
. Implemented FR #74217 (Allow creation of deterministic sqlite functions).
|
||||
(Andrew Nester)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #74216 (Correctly fail on invalid IP address ports). (Sara)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #74240 (deflate_add can allocate too much memory). (Matt Bonneau)
|
||||
|
||||
16 Mar 2017, PHP 7.1.3
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74157 (Segfault with nested generators). (Laruence)
|
||||
. Fixed bug #74164 (PHP hangs when an invalid value is dynamically passed to
|
||||
typehinted by-ref arg). (Laruence)
|
||||
. Fixed bug #74093 (Maximum execution time of n+2 seconds exceed not written
|
||||
in error_log). (Laruence)
|
||||
. Fixed bug #73989 (PHP 7.1 Segfaults within Symfony test suite).
|
||||
(Dmitry, Laruence)
|
||||
. Fixed bug #74084 (Out of bound read - zend_mm_alloc_small). (Laruence)
|
||||
. Fixed bug #73807 (Performance problem with processing large post request).
|
||||
(Nikita)
|
||||
. Fixed bug #73998 (array_key_exists fails on arrays created by
|
||||
get_object_vars). (mhagstrand)
|
||||
. Fixed bug #73954 (NAN check fails on Alpine Linux with musl). (Andrea)
|
||||
. Fixed bug #73677 (Generating phar.phar core dump with gcc ASAN enabled
|
||||
build). (ondrej)
|
||||
|
||||
- Apache:
|
||||
. Fixed bug #61471 (Incomplete POST does not timeout but is passed to PHP).
|
||||
(Zheng Shao)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #73837 ("new DateTime()" sometimes returns 1 second ago value).
|
||||
(Derick)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #69860 (php-fpm process accounting is broken with keepalive).
|
||||
(Denis Yeldandi)
|
||||
|
||||
- Hash:
|
||||
. Fixed bug #73127 (gost-crypto hash incorrect if input data contains long
|
||||
0xFF sequence). (Grundik)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #74031 (ReflectionFunction for imagepng is missing last two
|
||||
parameters). (finwe)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #74021 (fetch_array broken data. Data more then MEDIUMBLOB).
|
||||
(Andrew Nester, Nikita)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74152 (if statement says true to a null variable). (Laruence)
|
||||
. Fixed bug #74019 (Segfault with list). (Laruence)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #74022 (PHP Fast CGI crashes when reading from a pfx file).
|
||||
(Anatol)
|
||||
. Fixed bug #74099 (Memory leak with openssl_encrypt()). (Andrew Nester)
|
||||
. Fixed bug #74159 (Writing a large buffer to a non-blocking encrypted stream
|
||||
fails with "bad write retry"). (trowski)
|
||||
|
||||
- PDO_OCI:
|
||||
. Fixed bug #54379 (PDO_OCI: UTF-8 output gets truncated). (gureedo / Oracle)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #74413 (incorrect reflection for SQLite3::enableExceptions).
|
||||
(krakjoe)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #74005 (mail.add_x_header causes RFC-breaking lone line feed).
|
||||
(Anatol)
|
||||
. Fixed bug #74041 (substr_count with length=0 broken). (Nikita)
|
||||
. Fixed bug #73118 (is_callable callable name reports misleading value for
|
||||
anonymous classes). (Adam Saponara)
|
||||
. Fixed bug #74105 (PHP on Linux should use /dev/urandom when getrandom is
|
||||
not available). (Benjamin Robin)
|
||||
. Fixed bug #74708 (Invalid Reflection signatures for random_bytes and
|
||||
random_int). (Tyson Andre, Remi)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #73496 (Invalid memory access in zend_inline_hash_func).
|
||||
(Laruence)
|
||||
. Fixed bug #74090 (stream_get_contents maxlength>-1 returns empty string).
|
||||
(Anatol)
|
||||
|
||||
16 Feb 2017, PHP 7.1.2
|
||||
|
||||
- Core:
|
||||
|
||||
+3
-2
@@ -721,6 +721,7 @@ 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;
|
||||
@@ -728,8 +729,8 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
if (NULL == shm->addr) {
|
||||
int err = GetLastError();
|
||||
err = GetLastError();
|
||||
if (err) {
|
||||
SET_ERRNO_FROM_WIN32_CODE(err);
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ AC_FUNC_ALLOCA
|
||||
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp)
|
||||
AC_ZEND_BROKEN_SPRINTF
|
||||
|
||||
AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include <math.h>]])
|
||||
AC_CHECK_FUNCS(finite isfinite isinf isnan)
|
||||
|
||||
ZEND_FP_EXCEPT
|
||||
|
||||
|
||||
+8
-8
@@ -64,33 +64,33 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
/* To enable the is_nan, is_infinite and is_finite PHP functions */
|
||||
#ifdef NETWARE
|
||||
#define HAVE_DECL_ISNAN 1
|
||||
#define HAVE_DECL_ISINF 1
|
||||
#define HAVE_DECL_ISFINITE 1
|
||||
#define HAVE_ISNAN 1
|
||||
#define HAVE_ISINF 1
|
||||
#define HAVE_ISFINITE 1
|
||||
#endif
|
||||
|
||||
#ifndef zend_isnan
|
||||
#if HAVE_DECL_ISNAN
|
||||
#ifdef HAVE_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
#else
|
||||
#define zend_isnan(a) ((a) != (a))
|
||||
#define zend_isnan(a) 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISINF
|
||||
#ifdef HAVE_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISFINITE
|
||||
#if defined(HAVE_ISFINITE) || defined(isfinite)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(HAVE_FINITE)
|
||||
#define zend_finite(a) finite(a)
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69676: Resolution of self::FOO in class constants not correct (variation)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
const A = 'Foo::A';
|
||||
const B = self::A . ' and ' . self::C;
|
||||
const C = 'Foo::C';
|
||||
|
||||
}
|
||||
|
||||
class Bar extends Foo {
|
||||
const A = 'Bar::A';
|
||||
const C = 'Bar::C';
|
||||
}
|
||||
|
||||
var_dump(Bar::B);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(17) "Foo::A and Foo::C"
|
||||
@@ -1,69 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69676: Resolution of self::FOO in class constants not correct (variation)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class P {
|
||||
const N = 'P';
|
||||
}
|
||||
class A extends P {
|
||||
const selfN = self::N;
|
||||
const parentN = parent::N;
|
||||
const N = 'A';
|
||||
}
|
||||
class B extends A {
|
||||
const N = 'B';
|
||||
}
|
||||
|
||||
var_dump(B::selfN); // A
|
||||
var_dump(B::parentN); // P
|
||||
|
||||
class A2 {
|
||||
const selfN = self::N;
|
||||
const N = 'A2';
|
||||
}
|
||||
class B2 extends A2 {
|
||||
const indSelfN = self::selfN;
|
||||
const N = 'B2';
|
||||
}
|
||||
class C2 extends B2 {
|
||||
const N = 'C2';
|
||||
}
|
||||
|
||||
var_dump(C2::indSelfN); // A2
|
||||
|
||||
class A3 {
|
||||
const selfN = self::N;
|
||||
const N = 'A3';
|
||||
}
|
||||
class B3 extends A3 {
|
||||
const exprSelfN = "expr" . self::selfN;
|
||||
const N = 'B3';
|
||||
}
|
||||
class C3 extends B3 {
|
||||
const N = 'C3';
|
||||
}
|
||||
|
||||
var_dump(C3::exprSelfN); // exprA3
|
||||
|
||||
class A4 {
|
||||
const selfN = self::N;
|
||||
const N = 'A4';
|
||||
}
|
||||
class B4 extends A4 {
|
||||
const N = 'B4';
|
||||
public $prop = self::selfN;
|
||||
}
|
||||
class C4 extends B4 {
|
||||
const N = 'C4';
|
||||
}
|
||||
|
||||
var_dump((new C4)->prop); // A4
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "A"
|
||||
string(1) "P"
|
||||
string(2) "A2"
|
||||
string(6) "exprA3"
|
||||
string(2) "A4"
|
||||
@@ -18,7 +18,7 @@ object(ReflectionClass)#4 (1) {
|
||||
}
|
||||
Parameter #0 [ <required> stdClass $x ]
|
||||
stdClass
|
||||
Method [ <internal> public method __invoke ] {
|
||||
Method [ <internal, prototype Closure> public method __invoke ] {
|
||||
|
||||
- Parameters [1] {
|
||||
Parameter #0 [ <required> stdClass $x ]
|
||||
@@ -53,43 +53,27 @@ string(3) "1st"
|
||||
string(3) "2nd"
|
||||
NULL
|
||||
string(3) "4th"
|
||||
array(4) {
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(3) "1st"
|
||||
[1]=>
|
||||
&string(3) "2nd"
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
NULL
|
||||
array(2) {
|
||||
[1]=>
|
||||
string(3) "2nd"
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
NULL
|
||||
array(2) {
|
||||
[1]=>
|
||||
&string(3) "2nd"
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
NULL
|
||||
[1]=>
|
||||
NULL
|
||||
[2]=>
|
||||
NULL
|
||||
array(1) {
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ 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(52): PHPUnit_Framework_MockObject_InvocationMocker->invoke(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,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73900: Use After Free in unserialize() SplFixedArray
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = new stdClass;
|
||||
$b = new SplFixedArray(1);
|
||||
$b[0] = $a;
|
||||
$c = &$b[0];
|
||||
var_dump($c);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (0) {
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73954 (NAN check fails on Alpine Linux with musl)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(NAN);
|
||||
var_dump(is_nan(NAN));
|
||||
|
||||
function takes_int(int $int) {
|
||||
}
|
||||
|
||||
takes_int(log(tan(3.14)));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
float(NAN)
|
||||
bool(true)
|
||||
|
||||
Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type integer, float given, called in %s on line 9 and defined in %s:6
|
||||
Stack trace:
|
||||
#0 %s(9): takes_int(NAN)
|
||||
#1 {main}
|
||||
thrown in %s on line 6
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73960: Leak with instance method calling static method with referenced return
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$value = 'one';
|
||||
$array = array($value);
|
||||
$array = $ref =& $array;
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "one"
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73989 (PHP 7.1 Segfaults within Symfony test suite)
|
||||
--FILE--
|
||||
<?php
|
||||
class Cycle
|
||||
{
|
||||
private $thing;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$obj = $this;
|
||||
$this->thing = function() use($obj) {};
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
($this->thing)();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 10000; ++$i) {
|
||||
$obj = new Cycle();
|
||||
}
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73998 (array_key_exists fails on arrays created by get_object_vars)
|
||||
--DESCRIPTION--
|
||||
Properties of objects with numeric names should be accessible
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new stdClass;
|
||||
$a->{1234} = "Numeric";
|
||||
$a->a1234 = "String";
|
||||
|
||||
$properties = get_object_vars($a);
|
||||
var_dump(array_key_exists(1234, $properties));
|
||||
echo "Value: {$properties[1234]}\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
Value: Numeric
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74084 (Out of bound read - zend_mm_alloc_small)
|
||||
--INI--
|
||||
error_reporting=0
|
||||
--FILE--
|
||||
<?php
|
||||
$$A += $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A -= $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A *= $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A /= $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A **= $$B->a = &$$C;
|
||||
var_dump($$A);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
if (PHP_ZTS) die("skip only for no-zts build");
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip not for Windows");
|
||||
?>
|
||||
--INI--
|
||||
memory_limit=1G
|
||||
max_execution_time=1
|
||||
hard_timeout=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a1 = range(1, 1000000);
|
||||
$a2 = range(100000, 1999999);
|
||||
array_intersect($a1, $a2);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Maximum execution time of 1+1 seconds exceeded %s
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74164 (PHP hangs when an invalid value is dynamically passed to typehinted by-ref arg)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
|
||||
set_error_handler(function ($type, $msg) {
|
||||
throw new \Exception($msg);
|
||||
});
|
||||
|
||||
call_user_func(function (array &$ref) {var_dump("xxx");}, 'not_an_array_variable');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: Parameter 1 to Foo\{closure}() expected to be a reference, value given in %sbug74164.php:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: Foo\{closure}(%s)
|
||||
#1 %sbug74164.php(%d): call_user_func(%s)
|
||||
#2 {main}
|
||||
thrown in %sbug74164.php on line %d
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Fixes bug 74188 (undeclared static variables emit a warning with ?? operator)
|
||||
--FILE--
|
||||
<?php
|
||||
abstract class Test
|
||||
{
|
||||
public static function get()
|
||||
{
|
||||
static::$a ?? true;
|
||||
}
|
||||
}
|
||||
Test::get();
|
||||
?>
|
||||
--EXPECT--
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74340: Magic function __get has different behavior in php 7.1.x
|
||||
--FILE--
|
||||
<?php
|
||||
class Test
|
||||
{
|
||||
public function __get($var)
|
||||
{
|
||||
static $first = true;
|
||||
echo '__get '.$var.PHP_EOL;
|
||||
if ($first) {
|
||||
$first = false;
|
||||
$this->$var;
|
||||
$this->{$var.'2'};
|
||||
$this->$var;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
$test->test;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
__get test
|
||||
|
||||
Notice: Undefined property: Test::$test in %s on line %d
|
||||
__get test2
|
||||
|
||||
Notice: Undefined property: Test::$test in %s on line %d
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74408 (Endless loop bypassing execution time limit)
|
||||
--INI--
|
||||
error_reporting = E_ALL | E_DEPRECATED | E_STRICT
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
//php.ini: error_reporting = E_ALL | E_DEPRECATED | E_STRICT
|
||||
|
||||
class ErrorHandling {
|
||||
|
||||
public function error_handler($errno, $errstr, $errfile, $errline) {
|
||||
$bla = new NonExistingClass2();
|
||||
}
|
||||
|
||||
public function exception_handler(Error $e) {
|
||||
echo "Caught, exception: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
set_error_handler('ErrorHandling::error_handler');
|
||||
set_exception_handler('ErrorHandling::exception_handler');
|
||||
|
||||
$blubb = new NonExistingClass();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
|
||||
|
||||
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
|
||||
|
||||
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in Unknown on line 0
|
||||
|
||||
Fatal error: Uncaught Error: Class 'NonExistingClass2' not found in %sbug74408.php:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: ErrorHandling::error_handler(8192, 'Non-static meth...', '%s', %d, Array)
|
||||
#1 %sbug74408.php(%d): set_exception_handler('ErrorHandling::...')
|
||||
#2 {main}
|
||||
thrown in %sbug74408.php on line %d
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
|
||||
--FILE--
|
||||
<?php
|
||||
"000000"[0]::d;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Class '0' not found in %sbug74546.php:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sbug74546.php on line %d
|
||||
@@ -1 +0,0 @@
|
||||
0=0&~2000000000
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_MAX !== 2147483647)
|
||||
die('skip for 32-bit only');
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(parse_ini_file(__DIR__ . "/bug74603.ini", true, INI_SCANNER_NORMAL));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "0"
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74657 (Undefined constants in array properties result in broken properties)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface I {
|
||||
}
|
||||
|
||||
class C {
|
||||
const FOO = I::FOO;
|
||||
|
||||
public $options = [self::FOO => "bar"];
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump((new C)->options);
|
||||
} catch (Throwable $e) {}
|
||||
|
||||
var_dump((new C)->options);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Undefined class constant 'I::FOO' in %sbug74657.php:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sbug74657.php on line %d
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74840: Opcache overwrites argument of GENERATOR_RETURN within finally
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$g = (function($a) {
|
||||
try {
|
||||
return $a + 1;
|
||||
} finally {
|
||||
$b = $a + 2;
|
||||
var_dump($b);
|
||||
}
|
||||
yield; // Generator
|
||||
})(1);
|
||||
$g->next();
|
||||
var_dump($g->getReturn());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(3)
|
||||
int(2)
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74862 (Unable to clone instance when private __clone defined)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a {
|
||||
private function __clone()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function getInstance()
|
||||
{
|
||||
return new static();
|
||||
}
|
||||
|
||||
public function cloneIt()
|
||||
{
|
||||
$a = clone $this;
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
|
||||
class c extends a {
|
||||
|
||||
}
|
||||
|
||||
// private constructor
|
||||
$d = c::getInstance();
|
||||
|
||||
// private clone
|
||||
$e = $d->cloneIt();
|
||||
var_dump($e);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(c)#2 (0) {
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74862 (Unable to clone instance when private __clone defined in a child class)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class main {
|
||||
}
|
||||
|
||||
class a extends main {
|
||||
private function __clone()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function getInstance()
|
||||
{
|
||||
return new static();
|
||||
}
|
||||
|
||||
public function cloneIt()
|
||||
{
|
||||
$a = clone $this;
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
|
||||
class c extends a {
|
||||
|
||||
}
|
||||
|
||||
// private constructor
|
||||
$d = c::getInstance();
|
||||
|
||||
// private clone
|
||||
$e = $d->cloneIt();
|
||||
var_dump($e);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(c)#2 (0) {
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74947 (Segfault in scanner on INF number)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo 200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
echo -200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
INF-INF
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75241 (Null pointer dereference in zend_mm_alloc_small())
|
||||
--FILE--
|
||||
<?php
|
||||
function eh(){}
|
||||
|
||||
set_error_handler('eh');
|
||||
|
||||
$d->d = &$d + $d->d/=0;
|
||||
var_dump($d);
|
||||
?>
|
||||
--EXPECT--
|
||||
float(INF)
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75252: Incorrect token formatting on two parse errors in one request
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$code = <<<'CODE'
|
||||
function test_missing_semicolon() : string {
|
||||
$x = []
|
||||
FOO
|
||||
}
|
||||
CODE;
|
||||
|
||||
try {
|
||||
eval($code);
|
||||
} catch (ParseError $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
eval($code);
|
||||
} catch (ParseError $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
|
||||
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75290 (debug info of Closures of internal functions contain garbage argument names)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump((new ReflectionFunction('sin'))->getClosure());
|
||||
|
||||
var_dump(function ($someThing) {});
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Closure)#2 (1) {
|
||||
["parameter"]=>
|
||||
array(1) {
|
||||
["$number"]=>
|
||||
string(10) "<required>"
|
||||
}
|
||||
}
|
||||
object(Closure)#2 (1) {
|
||||
["parameter"]=>
|
||||
array(1) {
|
||||
["$someThing"]=>
|
||||
string(10) "<required>"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.1 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj->$name ?? 12);
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.10 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
var_dump($obj[$name] ?? 12);
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.11 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump(empty($obj[$name]));
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.12 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
var_dump(empty($obj[$name]));
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.13 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["obj"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj[$name] ?? 12);
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.14 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["obj"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump(empty($obj[$name]));
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.15 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { }
|
||||
public function offsetGet($x) { }
|
||||
public function offsetSet($x, $y) { $GLOBALS["name"] = 24; var_dump($x); }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
$obj[$name] = 1;
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.16 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { }
|
||||
public function offsetGet($x) { }
|
||||
public function offsetSet($x, $y) { $GLOBALS["obj"] = 24; var_dump($this); }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$obj[$name] = 1;
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.2 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
var_dump($obj->$name ?? 12);
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
int(42)
|
||||
int(24)
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.3 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump(empty($obj->$name));
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.4 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
var_dump(empty($obj->$name));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
bool(false)
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.5 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["obj"] = 24; return true; }
|
||||
public function __get($x) { var_dump($this); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj->$name ?? 12);
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.6 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["obj"] = 24; return true; }
|
||||
public function __get($x) { var_dump($this); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump(empty($obj->$name));
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.7 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __set($x,$v) { $GLOBALS["name"] = 24; var_dump($x); }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
$obj->$name = 1;
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
int(24)
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.8 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __set($x,$v) { $GLOBALS["obj"] = 24; var_dump($this); }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$obj->$name = 1;
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.9 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj[$name] ?? 12);
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420 (Crash when modifing property name in __isset for BP_VAR_IS)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj->$name ?? 12);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(42)
|
||||
@@ -1,64 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75573 (Segmentation fault in 7.1.12 and 7.0.26)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A
|
||||
{
|
||||
var $_stdObject;
|
||||
function initialize($properties = FALSE) {
|
||||
$this->_stdObject = $properties ? (object) $properties : new stdClass();
|
||||
parent::initialize();
|
||||
}
|
||||
function &__get($property)
|
||||
{
|
||||
if (isset($this->_stdObject->{$property})) {
|
||||
$retval =& $this->_stdObject->{$property};
|
||||
return $retval;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
function &__set($property, $value)
|
||||
{
|
||||
return $this->_stdObject->{$property} = $value;
|
||||
}
|
||||
function __isset($property_name)
|
||||
{
|
||||
return isset($this->_stdObject->{$property_name});
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A
|
||||
{
|
||||
function initialize($properties = array())
|
||||
{
|
||||
parent::initialize($properties);
|
||||
}
|
||||
function &__get($property)
|
||||
{
|
||||
if (isset($this->settings) && isset($this->settings[$property])) {
|
||||
$retval =& $this->settings[$property];
|
||||
return $retval;
|
||||
} else {
|
||||
return parent::__get($property);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$b = new B();
|
||||
$b->settings = [ "foo" => "bar", "name" => "abc" ];
|
||||
var_dump($b->name);
|
||||
var_dump($b->settings);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Creating default object from empty value in %sbug75573.php on line %d
|
||||
|
||||
Notice: Only variable references should be returned by reference in %sbug75573.php on line %d
|
||||
string(3) "abc"
|
||||
array(2) {
|
||||
["foo"]=>
|
||||
string(3) "bar"
|
||||
["name"]=>
|
||||
string(3) "abc"
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Use of non-literals in declare ticks values crashes compiler
|
||||
--FILE--
|
||||
<?php
|
||||
declare(ticks = UNKNOWN_CONST) {
|
||||
echo 'Done';
|
||||
}
|
||||
--EXPECTF--
|
||||
|
||||
Fatal error: declare(ticks) value must be a literal in %sdeclare_006.php on line 2
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74157 (Segfault with nested generators)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function a() {
|
||||
$a = $b = $c = 2;
|
||||
foreach(range(1, 5) as $v) {
|
||||
yield $v;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (a(range(1, 3)) as $a) {
|
||||
var_dump($a);
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(4)
|
||||
int(5)
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74606 (Segfault within try/catch/finally nesting in Generators)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
$array = ["foo"];
|
||||
$array[] = "bar";
|
||||
|
||||
foreach ($array as $item) {
|
||||
try {
|
||||
try {
|
||||
yield;
|
||||
} finally {
|
||||
echo "fin $item\n";
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
echo "catch\n";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
gen()->throw(new Exception);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
fin foo
|
||||
catch
|
||||
fin bar
|
||||
@@ -1,45 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74954 (crash after update of generator yielding from finished generator)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function from() {
|
||||
yield 1;
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
function gen($gen) {
|
||||
try {
|
||||
var_dump(yield from $gen);
|
||||
} catch (Exception $e) { print "Caught exception!\n$e\n"; }
|
||||
}
|
||||
|
||||
$gen = from();
|
||||
$gens[] = gen($gen);
|
||||
$gens[] = gen($gen);
|
||||
|
||||
foreach ($gens as $g) {
|
||||
$g->current();
|
||||
}
|
||||
|
||||
do {
|
||||
foreach ($gens as $i => $g) {
|
||||
$g->next();
|
||||
}
|
||||
} while($gens[0]->valid());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Caught exception!
|
||||
Exception in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): from()
|
||||
#1 [internal function]: gen(Object(Generator))
|
||||
#2 %s(%d): Generator->next()
|
||||
#3 {main}
|
||||
Caught exception!
|
||||
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: gen(Object(Generator))
|
||||
#1 %s(%d): Generator->next()
|
||||
#2 {main}
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
yield from parses too greedily
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function from1234($x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
function bar() {
|
||||
yield 24;
|
||||
}
|
||||
|
||||
function foo() {
|
||||
yield from1234(42);
|
||||
yield from(bar());
|
||||
}
|
||||
|
||||
foreach (foo() as $value) {
|
||||
var_dump($value);
|
||||
}
|
||||
--EXPECT--
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -1,77 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74444 (multiple catch freezes in some cases)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo()
|
||||
{
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
echo '';
|
||||
try {
|
||||
throw new \RuntimeException();
|
||||
} catch (\FooEx | \RuntimeException $e) {
|
||||
echo 1;
|
||||
}
|
||||
echo 2;
|
||||
}
|
||||
|
||||
foo();
|
||||
|
||||
--EXPECT--
|
||||
12
|
||||
+1
-8
@@ -580,7 +580,6 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{
|
||||
#ifdef ZEND_WIN32
|
||||
zend_get_windows_version_info(&executor_globals->windows_version_info);
|
||||
#endif
|
||||
executor_globals->valid_symbol_table = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -660,10 +659,6 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
|
||||
extern zend_php_scanner_globals language_scanner_globals;
|
||||
#endif
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
php_win32_cp_set_by_id(65001);
|
||||
#endif
|
||||
|
||||
start_memory_manager();
|
||||
|
||||
virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */
|
||||
@@ -716,7 +711,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
|
||||
zend_compile_file = compile_file;
|
||||
zend_execute_ex = execute_ex;
|
||||
zend_execute_internal = NULL;
|
||||
#endif /* HAVE_DTRACE */
|
||||
#endif /* HAVE_SYS_SDT_H */
|
||||
zend_compile_string = compile_string;
|
||||
zend_throw_exception_hook = NULL;
|
||||
|
||||
@@ -916,8 +911,6 @@ void zend_set_utility_values(zend_utility_values *utility_values) /* {{{ */
|
||||
/* this should be compatible with the standard zenderror */
|
||||
ZEND_COLD void zenderror(const char *error) /* {{{ */
|
||||
{
|
||||
CG(parse_error) = 0;
|
||||
|
||||
if (EG(exception)) {
|
||||
/* An exception was thrown in the lexer, don't throw another in the parser. */
|
||||
return;
|
||||
|
||||
@@ -279,6 +279,7 @@ ZEND_COLD void zenderror(const char *error);
|
||||
#define ZEND_STANDARD_CLASS_DEF_PTR zend_standard_class_def
|
||||
extern ZEND_API zend_class_entry *zend_standard_class_def;
|
||||
extern ZEND_API zend_utility_values zend_uv;
|
||||
extern ZEND_API zval zval_used_for_init;
|
||||
|
||||
/* If DTrace is available and enabled */
|
||||
extern ZEND_API zend_bool zend_dtrace_enabled;
|
||||
|
||||
+7
-12
@@ -1088,6 +1088,8 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties) /* {{{ */
|
||||
ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
|
||||
{
|
||||
if (!(class_type->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) {
|
||||
class_type->ce_flags |= ZEND_ACC_CONSTANTS_UPDATED;
|
||||
|
||||
if (class_type->parent) {
|
||||
if (UNEXPECTED(zend_update_class_constants(class_type->parent) != SUCCESS)) {
|
||||
return FAILURE;
|
||||
@@ -1130,7 +1132,7 @@ ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
|
||||
ZEND_HASH_FOREACH_PTR(&class_type->constants_table, c) {
|
||||
val = &c->value;
|
||||
if (Z_CONSTANT_P(val)) {
|
||||
if (UNEXPECTED(zval_update_constant_ex(val, c->ce) != SUCCESS)) {
|
||||
if (UNEXPECTED(zval_update_constant_ex(val, class_type) != SUCCESS)) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
@@ -1156,9 +1158,7 @@ ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
|
||||
ce = ce->parent;
|
||||
}
|
||||
}
|
||||
class_type->ce_flags |= ZEND_ACC_CONSTANTS_UPDATED;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2024,19 +2024,17 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /
|
||||
zend_string_release(lcname);
|
||||
return NULL;
|
||||
}
|
||||
zend_string_release(lcname);
|
||||
module = module_ptr;
|
||||
EG(current_module) = module;
|
||||
|
||||
if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type)==FAILURE) {
|
||||
zend_hash_del(&module_registry, lcname);
|
||||
zend_string_release(lcname);
|
||||
EG(current_module) = NULL;
|
||||
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EG(current_module) = NULL;
|
||||
zend_string_release(lcname);
|
||||
return module;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -3068,8 +3066,7 @@ get_function_via_handler:
|
||||
(!fcc->function_handler->common.scope ||
|
||||
!instanceof_function(ce_org, fcc->function_handler->common.scope))) {
|
||||
if (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
|
||||
fcc->function_handler->common.function_name) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
|
||||
zend_string_release(fcc->function_handler->common.function_name);
|
||||
}
|
||||
zend_free_trampoline(fcc->function_handler);
|
||||
@@ -3241,8 +3238,7 @@ again:
|
||||
((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) ||
|
||||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
|
||||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
|
||||
fcc->function_handler->common.function_name) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
|
||||
zend_string_release(fcc->function_handler->common.function_name);
|
||||
}
|
||||
zend_free_trampoline(fcc->function_handler);
|
||||
@@ -3329,8 +3325,7 @@ again:
|
||||
((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) ||
|
||||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
|
||||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
|
||||
fcc->function_handler->common.function_name) {
|
||||
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
|
||||
zend_string_release(fcc->function_handler->common.function_name);
|
||||
}
|
||||
zend_free_trampoline(fcc->function_handler);
|
||||
|
||||
+4
-22
@@ -260,8 +260,6 @@ struct _zend_mm_heap {
|
||||
int peak_chunks_count; /* peak number of allocated chunks for current request */
|
||||
int cached_chunks_count; /* number of cached chunks */
|
||||
double avg_chunks_count; /* average number of chunks allocated per request */
|
||||
int last_chunks_delete_boundary; /* numer of chunks after last deletion */
|
||||
int last_chunks_delete_count; /* number of deletion over the last boundary */
|
||||
#if ZEND_MM_CUSTOM
|
||||
union {
|
||||
struct {
|
||||
@@ -285,7 +283,7 @@ struct _zend_mm_chunk {
|
||||
uint32_t free_pages; /* number of free pages */
|
||||
uint32_t free_tail; /* number of free pages at the end of chunk */
|
||||
uint32_t num;
|
||||
char reserve[64 - (sizeof(void*) * 3 + sizeof(uint32_t) * 3)];
|
||||
char reserve[64 - (sizeof(void*) * 3 + sizeof(int) * 3)];
|
||||
zend_mm_heap heap_slot; /* used only in main chunk */
|
||||
zend_mm_page_map free_map; /* 512 bits or 64 bytes */
|
||||
zend_mm_page_info map[ZEND_MM_PAGES]; /* 2 KB = 512 * 4 */
|
||||
@@ -1078,9 +1076,7 @@ static zend_always_inline void zend_mm_delete_chunk(zend_mm_heap *heap, zend_mm_
|
||||
chunk->next->prev = chunk->prev;
|
||||
chunk->prev->next = chunk->next;
|
||||
heap->chunks_count--;
|
||||
if (heap->chunks_count + heap->cached_chunks_count < heap->avg_chunks_count + 0.1
|
||||
|| (heap->chunks_count == heap->last_chunks_delete_boundary
|
||||
&& heap->last_chunks_delete_count >= 4)) {
|
||||
if (heap->chunks_count + heap->cached_chunks_count < heap->avg_chunks_count + 0.1) {
|
||||
/* delay deletion */
|
||||
heap->cached_chunks_count++;
|
||||
chunk->next = heap->cached_chunks;
|
||||
@@ -1089,14 +1085,6 @@ static zend_always_inline void zend_mm_delete_chunk(zend_mm_heap *heap, zend_mm_
|
||||
#if ZEND_MM_STAT || ZEND_MM_LIMIT
|
||||
heap->real_size -= ZEND_MM_CHUNK_SIZE;
|
||||
#endif
|
||||
if (!heap->cached_chunks) {
|
||||
if (heap->chunks_count != heap->last_chunks_delete_boundary) {
|
||||
heap->last_chunks_delete_boundary = heap->chunks_count;
|
||||
heap->last_chunks_delete_count = 0;
|
||||
} else {
|
||||
heap->last_chunks_delete_count++;
|
||||
}
|
||||
}
|
||||
if (!heap->cached_chunks || chunk->num > heap->cached_chunks->num) {
|
||||
zend_mm_chunk_free(heap, chunk, ZEND_MM_CHUNK_SIZE);
|
||||
} else {
|
||||
@@ -1831,8 +1819,6 @@ static zend_mm_heap *zend_mm_init(void)
|
||||
heap->peak_chunks_count = 1;
|
||||
heap->cached_chunks_count = 0;
|
||||
heap->avg_chunks_count = 1.0;
|
||||
heap->last_chunks_delete_boundary = 0;
|
||||
heap->last_chunks_delete_count = 0;
|
||||
#if ZEND_MM_STAT || ZEND_MM_LIMIT
|
||||
heap->real_size = ZEND_MM_CHUNK_SIZE;
|
||||
#endif
|
||||
@@ -2249,8 +2235,6 @@ void zend_mm_shutdown(zend_mm_heap *heap, int full, int silent)
|
||||
p->map[0] = ZEND_MM_LRUN(ZEND_MM_FIRST_PAGE);
|
||||
heap->chunks_count = 1;
|
||||
heap->peak_chunks_count = 1;
|
||||
heap->last_chunks_delete_boundary = 0;
|
||||
heap->last_chunks_delete_count = 0;
|
||||
#if ZEND_MM_STAT || ZEND_MM_LIMIT
|
||||
heap->real_size = ZEND_MM_CHUNK_SIZE;
|
||||
#endif
|
||||
@@ -2783,8 +2767,6 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_handlers *handlers, void
|
||||
heap->peak_chunks_count = 1;
|
||||
heap->cached_chunks_count = 0;
|
||||
heap->avg_chunks_count = 1.0;
|
||||
heap->last_chunks_delete_boundary = 0;
|
||||
heap->last_chunks_delete_count = 0;
|
||||
#if ZEND_MM_STAT || ZEND_MM_LIMIT
|
||||
heap->real_size = ZEND_MM_CHUNK_SIZE;
|
||||
#endif
|
||||
@@ -2836,7 +2818,7 @@ static ZEND_COLD ZEND_NORETURN void zend_out_of_memory(void)
|
||||
ZEND_API void * __zend_malloc(size_t len)
|
||||
{
|
||||
void *tmp = malloc(len);
|
||||
if (EXPECTED(tmp || !len)) {
|
||||
if (EXPECTED(tmp)) {
|
||||
return tmp;
|
||||
}
|
||||
zend_out_of_memory();
|
||||
@@ -2852,7 +2834,7 @@ ZEND_API void * __zend_calloc(size_t nmemb, size_t len)
|
||||
ZEND_API void * __zend_realloc(void *p, size_t len)
|
||||
{
|
||||
p = realloc(p, len);
|
||||
if (EXPECTED(p || !len)) {
|
||||
if (EXPECTED(p)) {
|
||||
return p;
|
||||
}
|
||||
zend_out_of_memory();
|
||||
|
||||
+3
-14
@@ -57,21 +57,17 @@ ZEND_API zend_ast *zend_ast_create_znode(znode *node) {
|
||||
return (zend_ast *) ast;
|
||||
}
|
||||
|
||||
ZEND_API zend_ast *zend_ast_create_zval_with_lineno(zval *zv, zend_ast_attr attr, uint32_t lineno) {
|
||||
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
|
||||
zend_ast_zval *ast;
|
||||
|
||||
ast = zend_ast_alloc(sizeof(zend_ast_zval));
|
||||
ast->kind = ZEND_AST_ZVAL;
|
||||
ast->attr = attr;
|
||||
ZVAL_COPY_VALUE(&ast->val, zv);
|
||||
ast->val.u2.lineno = lineno;
|
||||
ast->val.u2.lineno = CG(zend_lineno);
|
||||
return (zend_ast *) ast;
|
||||
}
|
||||
|
||||
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
|
||||
return zend_ast_create_zval_with_lineno(zv, attr, CG(zend_lineno));
|
||||
}
|
||||
|
||||
ZEND_API zend_ast *zend_ast_create_decl(
|
||||
zend_ast_kind kind, uint32_t flags, uint32_t start_lineno, zend_string *doc_comment,
|
||||
zend_string *name, zend_ast *child0, zend_ast *child1, zend_ast *child2, zend_ast *child3
|
||||
@@ -159,14 +155,7 @@ ZEND_API zend_ast *zend_ast_create_list(uint32_t init_children, zend_ast_kind ki
|
||||
uint32_t i;
|
||||
va_start(va, kind);
|
||||
for (i = 0; i < init_children; ++i) {
|
||||
zend_ast *child = va_arg(va, zend_ast *);
|
||||
ast = zend_ast_list_add(ast, child);
|
||||
if (child != NULL) {
|
||||
uint32_t lineno = zend_ast_get_lineno(child);
|
||||
if (lineno < ast->lineno) {
|
||||
ast->lineno = lineno;
|
||||
}
|
||||
}
|
||||
ast = zend_ast_list_add(ast, va_arg(va, zend_ast *));
|
||||
}
|
||||
va_end(va);
|
||||
}
|
||||
|
||||
@@ -189,7 +189,6 @@ typedef struct _zend_ast_decl {
|
||||
typedef void (*zend_ast_process_t)(zend_ast *ast);
|
||||
extern ZEND_API zend_ast_process_t zend_ast_process;
|
||||
|
||||
ZEND_API zend_ast *zend_ast_create_zval_with_lineno(zval *zv, zend_ast_attr attr, uint32_t lineno);
|
||||
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr);
|
||||
|
||||
ZEND_API zend_ast *zend_ast_create_ex(zend_ast_kind kind, zend_ast_attr attr, ...);
|
||||
|
||||
@@ -220,10 +220,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_set_exception_handler, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, exception_handler)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_get_defined_functions, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, exclude_disabled)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_create_function, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, args)
|
||||
ZEND_ARG_INFO(0, code)
|
||||
@@ -370,7 +366,7 @@ static const zend_function_entry builtin_functions[] = { /* {{{ */
|
||||
ZEND_FE(get_declared_classes, arginfo_zend__void)
|
||||
ZEND_FE(get_declared_traits, arginfo_zend__void)
|
||||
ZEND_FE(get_declared_interfaces, arginfo_zend__void)
|
||||
ZEND_FE(get_defined_functions, arginfo_get_defined_functions)
|
||||
ZEND_FE(get_defined_functions, arginfo_zend__void)
|
||||
ZEND_FE(get_defined_vars, arginfo_zend__void)
|
||||
ZEND_FE(create_function, arginfo_create_function)
|
||||
ZEND_FE(get_resource_type, arginfo_get_resource_type)
|
||||
@@ -578,7 +574,7 @@ ZEND_FUNCTION(func_get_args)
|
||||
{
|
||||
zval *p, *q;
|
||||
uint32_t arg_count, first_extra_arg;
|
||||
uint32_t i;
|
||||
uint32_t i, n;
|
||||
zend_execute_data *ex = EX(prev_execute_data);
|
||||
|
||||
if (ZEND_CALL_INFO(ex) & ZEND_CALL_CODE) {
|
||||
@@ -598,6 +594,7 @@ ZEND_FUNCTION(func_get_args)
|
||||
zend_hash_real_init(Z_ARRVAL_P(return_value), 1);
|
||||
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) {
|
||||
i = 0;
|
||||
n = 0;
|
||||
p = ZEND_CALL_ARG(ex, 1);
|
||||
if (arg_count > first_extra_arg) {
|
||||
while (i < first_extra_arg) {
|
||||
@@ -607,8 +604,7 @@ ZEND_FUNCTION(func_get_args)
|
||||
if (Z_OPT_REFCOUNTED_P(q)) {
|
||||
Z_ADDREF_P(q);
|
||||
}
|
||||
} else {
|
||||
q = &EG(uninitialized_zval);
|
||||
n++;
|
||||
}
|
||||
ZEND_HASH_FILL_ADD(q);
|
||||
p++;
|
||||
@@ -623,15 +619,14 @@ ZEND_FUNCTION(func_get_args)
|
||||
if (Z_OPT_REFCOUNTED_P(q)) {
|
||||
Z_ADDREF_P(q);
|
||||
}
|
||||
} else {
|
||||
q = &EG(uninitialized_zval);
|
||||
n++;
|
||||
}
|
||||
ZEND_HASH_FILL_ADD(q);
|
||||
p++;
|
||||
i++;
|
||||
}
|
||||
} ZEND_HASH_FILL_END();
|
||||
Z_ARRVAL_P(return_value)->nNumOfElements = arg_count;
|
||||
Z_ARRVAL_P(return_value)->nNumOfElements = n;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1228,8 +1223,6 @@ ZEND_FUNCTION(get_object_vars)
|
||||
HashTable *properties;
|
||||
zend_string *key;
|
||||
zend_object *zobj;
|
||||
zend_ulong index;
|
||||
zend_bool fast_copy = 0;
|
||||
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_OBJECT(obj)
|
||||
@@ -1248,17 +1241,7 @@ ZEND_FUNCTION(get_object_vars)
|
||||
zobj = Z_OBJ_P(obj);
|
||||
|
||||
if (!zobj->ce->default_properties_count && properties == zobj->properties && !ZEND_HASH_GET_APPLY_COUNT(properties)) {
|
||||
fast_copy = 1;
|
||||
/* Check if the object has a numeric property, See Bug 73998 */
|
||||
ZEND_HASH_FOREACH_STR_KEY(properties, key) {
|
||||
if (key && ZEND_HANDLE_NUMERIC(key, index)) {
|
||||
fast_copy = 0;
|
||||
break;
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
}
|
||||
|
||||
if (fast_copy) {
|
||||
/* fast copy */
|
||||
if (EXPECTED(zobj->handlers == &std_object_handlers)) {
|
||||
if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) {
|
||||
GC_REFCOUNT(properties)++;
|
||||
@@ -1284,7 +1267,7 @@ ZEND_FUNCTION(get_object_vars)
|
||||
zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_len);
|
||||
zend_hash_str_add_new(Z_ARRVAL_P(return_value), prop_name, prop_len, value);
|
||||
} else {
|
||||
zend_symtable_add_new(Z_ARRVAL_P(return_value), key, value);
|
||||
zend_hash_add_new(Z_ARRVAL_P(return_value), key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2306,6 +2289,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
|
||||
array_init_size(arg_array, num_args);
|
||||
if (num_args) {
|
||||
uint32_t i = 0;
|
||||
uint32_t n = 0;
|
||||
zval *p = ZEND_CALL_ARG(call, 1);
|
||||
|
||||
zend_hash_real_init(Z_ARRVAL_P(arg_array), 1);
|
||||
@@ -2328,9 +2312,12 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
|
||||
if (Z_OPT_REFCOUNTED_P(arg)) {
|
||||
Z_ADDREF_P(arg);
|
||||
}
|
||||
n++;
|
||||
ZEND_HASH_FILL_ADD(arg);
|
||||
} else {
|
||||
ZEND_HASH_FILL_ADD(&EG(uninitialized_zval));
|
||||
zval tmp;
|
||||
ZVAL_UNDEF(&tmp);
|
||||
ZEND_HASH_FILL_ADD(&tmp);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@@ -2340,10 +2327,9 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
|
||||
if (Z_OPT_REFCOUNTED_P(p)) {
|
||||
Z_ADDREF_P(p);
|
||||
}
|
||||
ZEND_HASH_FILL_ADD(p);
|
||||
} else {
|
||||
ZEND_HASH_FILL_ADD(&EG(uninitialized_zval));
|
||||
n++;
|
||||
}
|
||||
ZEND_HASH_FILL_ADD(p);
|
||||
p++;
|
||||
i++;
|
||||
}
|
||||
@@ -2356,15 +2342,14 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
|
||||
if (Z_OPT_REFCOUNTED_P(p)) {
|
||||
Z_ADDREF_P(p);
|
||||
}
|
||||
ZEND_HASH_FILL_ADD(p);
|
||||
} else {
|
||||
ZEND_HASH_FILL_ADD(&EG(uninitialized_zval));
|
||||
n++;
|
||||
}
|
||||
ZEND_HASH_FILL_ADD(p);
|
||||
p++;
|
||||
i++;
|
||||
}
|
||||
} ZEND_HASH_FILL_END();
|
||||
Z_ARRVAL_P(arg_array)->nNumOfElements = num_args;
|
||||
Z_ARRVAL_P(arg_array)->nNumOfElements = n;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+3
-10
@@ -503,7 +503,6 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
|
||||
zval val;
|
||||
struct _zend_arg_info *arg_info = closure->func.common.arg_info;
|
||||
HashTable *debug_info;
|
||||
zend_bool zstr_args = (closure->func.type == ZEND_USER_FUNCTION) || (closure->func.common.fn_flags & ZEND_ACC_USER_ARG_INFO);
|
||||
|
||||
*is_temp = 1;
|
||||
|
||||
@@ -536,15 +535,9 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
|
||||
zend_string *name;
|
||||
zval info;
|
||||
if (arg_info->name) {
|
||||
if (zstr_args) {
|
||||
name = zend_strpprintf(0, "%s$%s",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
ZSTR_VAL(arg_info->name));
|
||||
} else {
|
||||
name = zend_strpprintf(0, "%s$%s",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
((zend_internal_arg_info*)arg_info)->name);
|
||||
}
|
||||
name = zend_strpprintf(0, "%s$%s",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
ZSTR_VAL(arg_info->name));
|
||||
} else {
|
||||
name = zend_strpprintf(0, "%s$param%d",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
|
||||
+7
-26
@@ -1690,7 +1690,6 @@ int zendlex(zend_parser_stack_elem *elem) /* {{{ */
|
||||
{
|
||||
zval zv;
|
||||
int retval;
|
||||
uint32_t start_lineno;
|
||||
|
||||
if (CG(increment_lineno)) {
|
||||
CG(zend_lineno)++;
|
||||
@@ -1699,7 +1698,6 @@ int zendlex(zend_parser_stack_elem *elem) /* {{{ */
|
||||
|
||||
again:
|
||||
ZVAL_UNDEF(&zv);
|
||||
start_lineno = CG(zend_lineno);
|
||||
retval = lex_scan(&zv);
|
||||
if (EG(exception)) {
|
||||
return T_ERROR;
|
||||
@@ -1723,7 +1721,7 @@ again:
|
||||
break;
|
||||
}
|
||||
if (Z_TYPE(zv) != IS_UNDEF) {
|
||||
elem->ast = zend_ast_create_zval_with_lineno(&zv, 0, start_lineno);
|
||||
elem->ast = zend_ast_create_zval(&zv);
|
||||
}
|
||||
|
||||
return retval;
|
||||
@@ -4810,7 +4808,6 @@ void zend_compile_try(zend_ast *ast) /* {{{ */
|
||||
|
||||
if (!is_last_class) {
|
||||
jmp_multicatch[j] = zend_emit_jump(0);
|
||||
opline = &CG(active_op_array)->opcodes[opnum_catch];
|
||||
opline->extended_value = get_next_op_number(CG(active_op_array));
|
||||
}
|
||||
}
|
||||
@@ -4968,12 +4965,8 @@ void zend_compile_declare(zend_ast *ast) /* {{{ */
|
||||
zend_ast *declare_ast = declares->child[i];
|
||||
zend_ast *name_ast = declare_ast->child[0];
|
||||
zend_ast *value_ast = declare_ast->child[1];
|
||||
|
||||
zend_string *name = zend_ast_get_str(name_ast);
|
||||
|
||||
if (value_ast->kind != ZEND_AST_ZVAL) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "declare(%s) value must be a literal", ZSTR_VAL(name));
|
||||
}
|
||||
|
||||
if (zend_string_equals_literal_ci(name, "ticks")) {
|
||||
zval value_zv;
|
||||
zend_const_expr_to_zval(&value_zv, value_ast);
|
||||
@@ -6261,7 +6254,7 @@ void zend_compile_use(zend_ast *ast) /* {{{ */
|
||||
zend_string *ns_name = zend_string_alloc(ZSTR_LEN(current_ns) + 1 + ZSTR_LEN(new_name), 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(ns_name), ZSTR_VAL(current_ns), ZSTR_LEN(current_ns));
|
||||
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) + 1);
|
||||
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);
|
||||
|
||||
@@ -6455,11 +6448,7 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_string *filename = CG(compiled_filename);
|
||||
zend_string *dirname = zend_string_init(ZSTR_VAL(filename), ZSTR_LEN(filename), 0);
|
||||
#ifdef ZEND_WIN32
|
||||
php_win32_ioutil_dirname(ZSTR_VAL(dirname), ZSTR_LEN(dirname));
|
||||
#else
|
||||
zend_dirname(ZSTR_VAL(dirname), ZSTR_LEN(dirname));
|
||||
#endif
|
||||
|
||||
if (strcmp(ZSTR_VAL(dirname), ".") == 0) {
|
||||
dirname = zend_string_extend(dirname, MAXPATHLEN, 0);
|
||||
@@ -7374,11 +7363,8 @@ void zend_compile_class_const(znode *result, zend_ast *ast) /* {{{ */
|
||||
return;
|
||||
}
|
||||
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
|
||||
class_ast = ast->child[0];
|
||||
const_ast = ast->child[1];
|
||||
zend_eval_const_expr(&class_ast);
|
||||
zend_eval_const_expr(&const_ast);
|
||||
|
||||
if (class_ast->kind == ZEND_AST_ZVAL) {
|
||||
zend_string *resolved_name;
|
||||
@@ -8018,8 +8004,6 @@ void zend_compile_expr(znode *result, zend_ast *ast) /* {{{ */
|
||||
|
||||
void zend_compile_var(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
|
||||
{
|
||||
CG(zend_lineno) = zend_ast_get_lineno(ast);
|
||||
|
||||
switch (ast->kind) {
|
||||
case ZEND_AST_VAR:
|
||||
zend_compile_simple_var(result, ast, type, 0);
|
||||
@@ -8316,11 +8300,8 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||
break;
|
||||
}
|
||||
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
|
||||
class_ast = ast->child[0];
|
||||
name_ast = ast->child[1];
|
||||
zend_eval_const_expr(&class_ast);
|
||||
zend_eval_const_expr(&name_ast);
|
||||
|
||||
if (name_ast->kind == ZEND_AST_ZVAL && zend_string_equals_literal_ci(zend_ast_get_str(name_ast), "class")) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR,
|
||||
|
||||
@@ -327,7 +327,6 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
|
||||
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);
|
||||
zend_class_constant *c = NULL;
|
||||
zval *ret_constant = NULL;
|
||||
|
||||
if (zend_string_equals_literal_ci(class_name, "self")) {
|
||||
@@ -356,7 +355,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
|
||||
ce = zend_fetch_class(class_name, flags);
|
||||
}
|
||||
if (ce) {
|
||||
c = zend_hash_find_ptr(&ce->constants_table, constant_name);
|
||||
zend_class_constant *c = zend_hash_find_ptr(&ce->constants_table, constant_name);
|
||||
if (c == 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));
|
||||
@@ -381,7 +380,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
|
||||
}
|
||||
MARK_CONSTANT_VISITED(ret_constant);
|
||||
}
|
||||
if (UNEXPECTED(zval_update_constant_ex(ret_constant, c->ce) != SUCCESS)) {
|
||||
if (UNEXPECTED(zval_update_constant_ex(ret_constant, ce) != SUCCESS)) {
|
||||
RESET_CONSTANT_VISITED(ret_constant);
|
||||
ret_constant = NULL;
|
||||
goto failure;
|
||||
|
||||
@@ -521,8 +521,8 @@ static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */
|
||||
break;
|
||||
case IS_DOUBLE: {
|
||||
double dval = Z_DVAL_P(arg);
|
||||
char *s_tmp;
|
||||
size_t l_tmp = zend_spprintf(&s_tmp, MAX_LENGTH_OF_DOUBLE + EG(precision) + 1, "%.*G", (int) EG(precision), dval); /* SAFE */
|
||||
char *s_tmp = emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
|
||||
int l_tmp = zend_sprintf(s_tmp, "%.*G", (int) EG(precision), dval); /* SAFE */
|
||||
smart_str_appendl(str, s_tmp, l_tmp);
|
||||
smart_str_appends(str, ", ");
|
||||
efree(s_tmp);
|
||||
|
||||
+10
-3
@@ -1720,9 +1720,16 @@ fetch_from_array:
|
||||
zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name));
|
||||
} else if (EXPECTED(retval && Z_TYPE_P(retval) != IS_UNDEF)) {
|
||||
if (!Z_ISREF_P(retval)) {
|
||||
if (result != retval) {
|
||||
ZVAL_COPY(result, retval);
|
||||
retval = result;
|
||||
if (Z_REFCOUNTED_P(retval) &&
|
||||
Z_REFCOUNT_P(retval) > 1) {
|
||||
if (Z_TYPE_P(retval) != IS_OBJECT) {
|
||||
Z_DELREF_P(retval);
|
||||
ZVAL_DUP(result, retval);
|
||||
retval = result;
|
||||
} else {
|
||||
ZVAL_COPY_VALUE(result, retval);
|
||||
retval = result;
|
||||
}
|
||||
}
|
||||
if (Z_TYPE_P(retval) != IS_OBJECT) {
|
||||
zend_class_entry *ce = Z_OBJCE_P(container);
|
||||
|
||||
@@ -81,10 +81,6 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
|
||||
return variable_ptr;
|
||||
}
|
||||
if (ZEND_CONST_COND(value_type & (IS_VAR|IS_CV), 1) && variable_ptr == value) {
|
||||
if (value_type == IS_VAR && ref) {
|
||||
ZEND_ASSERT(GC_REFCOUNT(ref) > 1);
|
||||
--GC_REFCOUNT(ref);
|
||||
}
|
||||
return variable_ptr;
|
||||
}
|
||||
garbage = Z_COUNTED_P(variable_ptr);
|
||||
|
||||
+1
-28
@@ -748,15 +748,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
||||
}
|
||||
zend_error(E_DEPRECATED, "%s", error);
|
||||
efree(error);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (callable_name) {
|
||||
zend_string_release(callable_name);
|
||||
}
|
||||
if (EG(current_execute_data) == &dummy_execute_data) {
|
||||
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
zend_string_release(callable_name);
|
||||
}
|
||||
@@ -770,7 +761,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
||||
if (fci->object &&
|
||||
(!EG(objects_store).object_buckets ||
|
||||
!IS_OBJ_VALID(EG(objects_store).object_buckets[fci->object->handle]))) {
|
||||
zend_vm_stack_free_call_frame(call);
|
||||
if (EG(current_execute_data) == &dummy_execute_data) {
|
||||
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
|
||||
}
|
||||
@@ -780,7 +770,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
||||
if (func->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
|
||||
if (func->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
|
||||
zend_vm_stack_free_call_frame(call);
|
||||
if (EG(current_execute_data) == &dummy_execute_data) {
|
||||
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
|
||||
}
|
||||
@@ -791,13 +780,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
||||
func->common.scope ? ZSTR_VAL(func->common.scope->name) : "",
|
||||
func->common.scope ? "::" : "",
|
||||
ZSTR_VAL(func->common.function_name));
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
zend_vm_stack_free_call_frame(call);
|
||||
if (EG(current_execute_data) == &dummy_execute_data) {
|
||||
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -818,15 +800,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
||||
func->common.scope ? ZSTR_VAL(func->common.scope->name) : "",
|
||||
func->common.scope ? "::" : "",
|
||||
ZSTR_VAL(func->common.function_name));
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
ZEND_CALL_NUM_ARGS(call) = i;
|
||||
zend_vm_stack_free_args(call);
|
||||
zend_vm_stack_free_call_frame(call);
|
||||
if (EG(current_execute_data) == &dummy_execute_data) {
|
||||
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1230,7 +1203,7 @@ static void zend_timeout_handler(int dummy) /* {{{ */
|
||||
if (output_len > 0) {
|
||||
write(2, log_buffer, MIN(output_len, sizeof(log_buffer)));
|
||||
}
|
||||
_exit(124);
|
||||
_exit(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+52
-74
@@ -75,12 +75,26 @@
|
||||
/* one (0) is reserved */
|
||||
#define GC_ROOT_BUFFER_MAX_ENTRIES 10001
|
||||
|
||||
#define GC_FAKE_BUFFER_FLAG 0x80
|
||||
#define GC_TYPE_MASK 0x7f
|
||||
|
||||
#define GC_HAS_DESTRUCTORS (1<<0)
|
||||
|
||||
#ifndef ZEND_GC_DEBUG
|
||||
# define ZEND_GC_DEBUG 0
|
||||
#endif
|
||||
|
||||
#define GC_NUM_ADDITIONAL_ENTRIES \
|
||||
((4096 - ZEND_MM_OVERHEAD - sizeof(void*) * 2) / sizeof(gc_root_buffer))
|
||||
|
||||
typedef struct _gc_addtional_bufer gc_additional_buffer;
|
||||
|
||||
struct _gc_addtional_bufer {
|
||||
uint32_t used;
|
||||
gc_additional_buffer *next;
|
||||
gc_root_buffer buf[GC_NUM_ADDITIONAL_ENTRIES];
|
||||
};
|
||||
|
||||
#ifdef ZTS
|
||||
ZEND_API int gc_globals_id;
|
||||
#else
|
||||
@@ -89,6 +103,9 @@ ZEND_API zend_gc_globals gc_globals;
|
||||
|
||||
ZEND_API int (*gc_collect_cycles)(void);
|
||||
|
||||
#define GC_REMOVE_FROM_ROOTS(current) \
|
||||
gc_remove_from_roots((current))
|
||||
|
||||
#if ZEND_GC_DEBUG > 1
|
||||
# define GC_TRACE(format, ...) fprintf(stderr, format "\n", ##__VA_ARGS__);
|
||||
# define GC_TRACE_REF(ref, format, ...) \
|
||||
@@ -156,12 +173,6 @@ static zend_always_inline void gc_remove_from_roots(gc_root_buffer *root)
|
||||
GC_BENCH_DEC(root_buf_length);
|
||||
}
|
||||
|
||||
static zend_always_inline void gc_remove_from_additional_roots(gc_root_buffer *root)
|
||||
{
|
||||
root->next->prev = root->prev;
|
||||
root->prev->next = root->next;
|
||||
}
|
||||
|
||||
static void root_buffer_dtor(zend_gc_globals *gc_globals)
|
||||
{
|
||||
if (gc_globals->buf) {
|
||||
@@ -188,8 +199,6 @@ static void gc_globals_ctor_ex(zend_gc_globals *gc_globals)
|
||||
gc_globals->gc_runs = 0;
|
||||
gc_globals->collected = 0;
|
||||
|
||||
gc_globals->additional_buffer = NULL;
|
||||
|
||||
#if GC_BENCH
|
||||
gc_globals->root_buf_length = 0;
|
||||
gc_globals->root_buf_peak = 0;
|
||||
@@ -245,8 +254,6 @@ ZEND_API void gc_reset(void)
|
||||
GC_G(first_unused) = NULL;
|
||||
GC_G(last_unused) = NULL;
|
||||
}
|
||||
|
||||
GC_G(additional_buffer) = NULL;
|
||||
}
|
||||
|
||||
ZEND_API void gc_init(void)
|
||||
@@ -319,45 +326,21 @@ ZEND_API void ZEND_FASTCALL gc_possible_root(zend_refcounted *ref)
|
||||
GC_BENCH_PEAK(root_buf_peak, root_buf_length);
|
||||
}
|
||||
|
||||
static zend_always_inline gc_root_buffer* gc_find_additional_buffer(zend_refcounted *ref)
|
||||
{
|
||||
gc_additional_buffer *additional_buffer = GC_G(additional_buffer);
|
||||
|
||||
/* We have to check each additional_buffer to find which one holds the ref */
|
||||
while (additional_buffer) {
|
||||
uint32_t idx = GC_ADDRESS(GC_INFO(ref)) - GC_ROOT_BUFFER_MAX_ENTRIES;
|
||||
if (idx < additional_buffer->used) {
|
||||
gc_root_buffer *root = additional_buffer->buf + idx;
|
||||
if (root->ref == ref) {
|
||||
return root;
|
||||
}
|
||||
}
|
||||
additional_buffer = additional_buffer->next;
|
||||
}
|
||||
|
||||
ZEND_ASSERT(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ZEND_API void ZEND_FASTCALL gc_remove_from_buffer(zend_refcounted *ref)
|
||||
{
|
||||
gc_root_buffer *root;
|
||||
|
||||
ZEND_ASSERT(GC_ADDRESS(GC_INFO(ref)));
|
||||
ZEND_ASSERT(GC_ADDRESS(GC_INFO(ref)) < GC_ROOT_BUFFER_MAX_ENTRIES);
|
||||
|
||||
GC_BENCH_INC(zval_remove_from_buffer);
|
||||
|
||||
if (EXPECTED(GC_ADDRESS(GC_INFO(ref)) < GC_ROOT_BUFFER_MAX_ENTRIES)) {
|
||||
root = GC_G(buf) + GC_ADDRESS(GC_INFO(ref));
|
||||
gc_remove_from_roots(root);
|
||||
} else {
|
||||
root = gc_find_additional_buffer(ref);
|
||||
gc_remove_from_additional_roots(root);
|
||||
}
|
||||
root = GC_G(buf) + GC_ADDRESS(GC_INFO(ref));
|
||||
if (GC_REF_GET_COLOR(ref) != GC_BLACK) {
|
||||
GC_TRACE_SET_COLOR(ref, GC_PURPLE);
|
||||
}
|
||||
GC_INFO(ref) = 0;
|
||||
GC_REMOVE_FROM_ROOTS(root);
|
||||
|
||||
/* updete next root that is going to be freed */
|
||||
if (GC_G(next_to_free) == root) {
|
||||
@@ -708,7 +691,7 @@ static void gc_scan_roots(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void gc_add_garbage(zend_refcounted *ref)
|
||||
static void gc_add_garbage(zend_refcounted *ref, gc_additional_buffer **additional_buffer)
|
||||
{
|
||||
gc_root_buffer *buf = GC_G(unused);
|
||||
|
||||
@@ -731,23 +714,25 @@ static void gc_add_garbage(zend_refcounted *ref)
|
||||
#endif
|
||||
} else {
|
||||
/* If we don't have free slots in the buffer, allocate a new one and
|
||||
* set it's address above GC_ROOT_BUFFER_MAX_ENTRIES that have special
|
||||
* set it's address to GC_ROOT_BUFFER_MAX_ENTRIES that have special
|
||||
* meaning.
|
||||
*/
|
||||
if (!GC_G(additional_buffer) || GC_G(additional_buffer)->used == GC_NUM_ADDITIONAL_ENTRIES) {
|
||||
if (!*additional_buffer || (*additional_buffer)->used == GC_NUM_ADDITIONAL_ENTRIES) {
|
||||
gc_additional_buffer *new_buffer = emalloc(sizeof(gc_additional_buffer));
|
||||
new_buffer->used = 0;
|
||||
new_buffer->next = GC_G(additional_buffer);
|
||||
GC_G(additional_buffer) = new_buffer;
|
||||
new_buffer->next = *additional_buffer;
|
||||
*additional_buffer = new_buffer;
|
||||
}
|
||||
buf = GC_G(additional_buffer)->buf + GC_G(additional_buffer)->used;
|
||||
buf = (*additional_buffer)->buf + (*additional_buffer)->used;
|
||||
(*additional_buffer)->used++;
|
||||
#if 1
|
||||
/* optimization: color is already GC_BLACK (0) */
|
||||
GC_INFO(ref) = GC_ROOT_BUFFER_MAX_ENTRIES + GC_G(additional_buffer)->used;
|
||||
GC_INFO(ref) = GC_ROOT_BUFFER_MAX_ENTRIES;
|
||||
#else
|
||||
GC_REF_SET_ADDRESS(ref, GC_ROOT_BUFFER_MAX_ENTRIES) + GC_G(additional_buffer)->used;
|
||||
GC_REF_SET_ADDRESS(ref, GC_ROOT_BUFFER_MAX_ENTRIES);
|
||||
#endif
|
||||
GC_G(additional_buffer)->used++;
|
||||
/* modify type to prevent indirect destruction */
|
||||
GC_TYPE(ref) |= GC_FAKE_BUFFER_FLAG;
|
||||
}
|
||||
if (buf) {
|
||||
buf->ref = ref;
|
||||
@@ -758,7 +743,7 @@ static void gc_add_garbage(zend_refcounted *ref)
|
||||
}
|
||||
}
|
||||
|
||||
static int gc_collect_white(zend_refcounted *ref, uint32_t *flags)
|
||||
static int gc_collect_white(zend_refcounted *ref, uint32_t *flags, gc_additional_buffer **additional_buffer)
|
||||
{
|
||||
int count = 0;
|
||||
HashTable *ht;
|
||||
@@ -791,7 +776,7 @@ tail_call:
|
||||
#else
|
||||
if (!GC_ADDRESS(GC_INFO(ref))) {
|
||||
#endif
|
||||
gc_add_garbage(ref);
|
||||
gc_add_garbage(ref, additional_buffer);
|
||||
}
|
||||
if (obj->handlers->dtor_obj &&
|
||||
((obj->handlers->dtor_obj != zend_objects_destroy_object) ||
|
||||
@@ -815,7 +800,7 @@ tail_call:
|
||||
if (Z_REFCOUNTED_P(zv)) {
|
||||
ref = Z_COUNTED_P(zv);
|
||||
GC_REFCOUNT(ref)++;
|
||||
count += gc_collect_white(ref, flags);
|
||||
count += gc_collect_white(ref, flags, additional_buffer);
|
||||
/* count non-refcounted for compatibility ??? */
|
||||
} else if (Z_TYPE_P(zv) != IS_UNDEF) {
|
||||
count++;
|
||||
@@ -837,7 +822,7 @@ tail_call:
|
||||
#else
|
||||
if (!GC_ADDRESS(GC_INFO(ref))) {
|
||||
#endif
|
||||
gc_add_garbage(ref);
|
||||
gc_add_garbage(ref, additional_buffer);
|
||||
}
|
||||
ht = (zend_array*)ref;
|
||||
} else if (GC_TYPE(ref) == IS_REFERENCE) {
|
||||
@@ -877,7 +862,7 @@ tail_call:
|
||||
if (Z_REFCOUNTED_P(zv)) {
|
||||
ref = Z_COUNTED_P(zv);
|
||||
GC_REFCOUNT(ref)++;
|
||||
count += gc_collect_white(ref, flags);
|
||||
count += gc_collect_white(ref, flags, additional_buffer);
|
||||
/* count non-refcounted for compatibility ??? */
|
||||
} else if (Z_TYPE_P(zv) != IS_UNDEF) {
|
||||
count++;
|
||||
@@ -895,7 +880,7 @@ tail_call:
|
||||
return count;
|
||||
}
|
||||
|
||||
static int gc_collect_roots(uint32_t *flags)
|
||||
static int gc_collect_roots(uint32_t *flags, gc_additional_buffer **additional_buffer)
|
||||
{
|
||||
int count = 0;
|
||||
gc_root_buffer *current = GC_G(roots).next;
|
||||
@@ -904,12 +889,8 @@ static int gc_collect_roots(uint32_t *flags)
|
||||
while (current != &GC_G(roots)) {
|
||||
gc_root_buffer *next = current->next;
|
||||
if (GC_REF_GET_COLOR(current->ref) == GC_BLACK) {
|
||||
if (EXPECTED(GC_ADDRESS(GC_INFO(current->ref)) < GC_ROOT_BUFFER_MAX_ENTRIES)) {
|
||||
gc_remove_from_roots(current);
|
||||
} else {
|
||||
gc_remove_from_additional_roots(current);
|
||||
}
|
||||
GC_INFO(current->ref) = 0; /* reset GC_ADDRESS() and keep GC_BLACK */
|
||||
GC_REMOVE_FROM_ROOTS(current);
|
||||
}
|
||||
current = next;
|
||||
}
|
||||
@@ -917,7 +898,7 @@ static int gc_collect_roots(uint32_t *flags)
|
||||
current = GC_G(roots).next;
|
||||
while (current != &GC_G(roots)) {
|
||||
if (GC_REF_GET_COLOR(current->ref) == GC_WHITE) {
|
||||
count += gc_collect_white(current->ref, flags);
|
||||
count += gc_collect_white(current->ref, flags, additional_buffer);
|
||||
}
|
||||
current = current->next;
|
||||
}
|
||||
@@ -953,15 +934,12 @@ static void gc_remove_nested_data_from_buffer(zend_refcounted *ref, gc_root_buff
|
||||
tail_call:
|
||||
if (root ||
|
||||
(GC_ADDRESS(GC_INFO(ref)) != 0 &&
|
||||
GC_REF_GET_COLOR(ref) == GC_BLACK)) {
|
||||
GC_REF_GET_COLOR(ref) == GC_BLACK &&
|
||||
GC_ADDRESS(GC_INFO(ref)) != GC_ROOT_BUFFER_MAX_ENTRIES)) {
|
||||
GC_TRACE_REF(ref, "removing from buffer");
|
||||
if (root) {
|
||||
if (EXPECTED(GC_ADDRESS(GC_INFO(root->ref)) < GC_ROOT_BUFFER_MAX_ENTRIES)) {
|
||||
gc_remove_from_roots(root);
|
||||
} else {
|
||||
gc_remove_from_additional_roots(root);
|
||||
}
|
||||
GC_INFO(ref) = 0;
|
||||
GC_REMOVE_FROM_ROOTS(root);
|
||||
root = NULL;
|
||||
} else {
|
||||
GC_REMOVE_FROM_BUFFER(ref);
|
||||
@@ -1055,7 +1033,7 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
zend_refcounted *p;
|
||||
gc_root_buffer to_free;
|
||||
uint32_t gc_flags = 0;
|
||||
gc_additional_buffer *additional_buffer_snapshot;
|
||||
gc_additional_buffer *additional_buffer;
|
||||
#if ZEND_GC_DEBUG
|
||||
zend_bool orig_gc_full;
|
||||
#endif
|
||||
@@ -1079,8 +1057,8 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
#endif
|
||||
|
||||
GC_TRACE("Collecting roots");
|
||||
additional_buffer_snapshot = GC_G(additional_buffer);
|
||||
count = gc_collect_roots(&gc_flags);
|
||||
additional_buffer = NULL;
|
||||
count = gc_collect_roots(&gc_flags, &additional_buffer);
|
||||
#if ZEND_GC_DEBUG
|
||||
GC_G(gc_full) = orig_gc_full;
|
||||
#endif
|
||||
@@ -1124,7 +1102,7 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
while (current != &to_free) {
|
||||
p = current->ref;
|
||||
GC_G(next_to_free) = current->next;
|
||||
if (GC_TYPE(p) == IS_OBJECT) {
|
||||
if ((GC_TYPE(p) & GC_TYPE_MASK) == IS_OBJECT) {
|
||||
zend_object *obj = (zend_object*)p;
|
||||
|
||||
if (IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) &&
|
||||
@@ -1161,7 +1139,7 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
p = current->ref;
|
||||
GC_G(next_to_free) = current->next;
|
||||
GC_TRACE_REF(p, "destroying");
|
||||
if (GC_TYPE(p) == IS_OBJECT) {
|
||||
if ((GC_TYPE(p) & GC_TYPE_MASK) == IS_OBJECT) {
|
||||
zend_object *obj = (zend_object*)p;
|
||||
|
||||
if (EG(objects_store).object_buckets &&
|
||||
@@ -1180,7 +1158,7 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
EG(objects_store).free_list_head = obj->handle;
|
||||
p = current->ref = (zend_refcounted*)(((char*)obj) - obj->handlers->offset);
|
||||
}
|
||||
} else if (GC_TYPE(p) == IS_ARRAY) {
|
||||
} else if ((GC_TYPE(p) & GC_TYPE_MASK) == IS_ARRAY) {
|
||||
zend_array *arr = (zend_array*)p;
|
||||
|
||||
GC_TYPE(arr) = IS_NULL;
|
||||
@@ -1202,10 +1180,10 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
current = next;
|
||||
}
|
||||
|
||||
while (GC_G(additional_buffer) != additional_buffer_snapshot) {
|
||||
gc_additional_buffer *next = GC_G(additional_buffer)->next;
|
||||
efree(GC_G(additional_buffer));
|
||||
GC_G(additional_buffer) = next;
|
||||
while (additional_buffer != NULL) {
|
||||
gc_additional_buffer *next = additional_buffer->next;
|
||||
efree(additional_buffer);
|
||||
additional_buffer = next;
|
||||
}
|
||||
|
||||
GC_TRACE("Collection finished");
|
||||
|
||||
@@ -67,17 +67,6 @@ typedef struct _gc_root_buffer {
|
||||
uint32_t refcount;
|
||||
} gc_root_buffer;
|
||||
|
||||
#define GC_NUM_ADDITIONAL_ENTRIES \
|
||||
((4096 - ZEND_MM_OVERHEAD - sizeof(void*) * 2) / sizeof(gc_root_buffer))
|
||||
|
||||
typedef struct _gc_additional_bufer gc_additional_buffer;
|
||||
|
||||
struct _gc_additional_bufer {
|
||||
uint32_t used;
|
||||
gc_additional_buffer *next;
|
||||
gc_root_buffer buf[GC_NUM_ADDITIONAL_ENTRIES];
|
||||
};
|
||||
|
||||
typedef struct _zend_gc_globals {
|
||||
zend_bool gc_enabled;
|
||||
zend_bool gc_active;
|
||||
@@ -104,8 +93,6 @@ typedef struct _zend_gc_globals {
|
||||
uint32_t zval_marked_grey;
|
||||
#endif
|
||||
|
||||
gc_additional_buffer *additional_buffer;
|
||||
|
||||
} zend_gc_globals;
|
||||
|
||||
#ifdef ZTS
|
||||
|
||||
@@ -108,7 +108,7 @@ static void zend_generator_cleanup_unfinished_execution(
|
||||
if (UNEXPECTED(generator->frozen_call_stack)) {
|
||||
zend_generator_restore_call_stack(generator);
|
||||
}
|
||||
zend_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
|
||||
zend_cleanup_unfinished_execution(execute_data, op_num, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -757,13 +757,15 @@ failure:
|
||||
|
||||
ZEND_API void zend_generator_resume(zend_generator *orig_generator) /* {{{ */
|
||||
{
|
||||
zend_generator *generator = zend_generator_get_current(orig_generator);
|
||||
zend_generator *generator;
|
||||
|
||||
/* The generator is already closed, thus can't resume */
|
||||
if (UNEXPECTED(!generator->execute_data)) {
|
||||
if (UNEXPECTED(!orig_generator->execute_data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
generator = zend_generator_get_current(orig_generator);
|
||||
|
||||
try_again:
|
||||
if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) {
|
||||
zend_throw_error(NULL, "Cannot resume an already running generator");
|
||||
|
||||
@@ -279,6 +279,7 @@ static uint32_t zend_array_recalc_elements(HashTable *ht)
|
||||
uint32_t num = ht->nNumOfElements;
|
||||
|
||||
ZEND_HASH_FOREACH_VAL(ht, val) {
|
||||
if (Z_TYPE_P(val) == IS_UNDEF) continue;
|
||||
if (Z_TYPE_P(val) == IS_INDIRECT) {
|
||||
if (UNEXPECTED(Z_TYPE_P(Z_INDIRECT_P(val)) == IS_UNDEF)) {
|
||||
num--;
|
||||
|
||||
@@ -337,20 +337,6 @@ static zend_always_inline int zend_hash_str_exists_ind(const HashTable *ht, cons
|
||||
Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF);
|
||||
}
|
||||
|
||||
static zend_always_inline zval *zend_symtable_add_new(HashTable *ht, zend_string *key, zval *pData)
|
||||
{
|
||||
zend_ulong idx;
|
||||
|
||||
if (ZEND_HANDLE_NUMERIC(key, idx)) {
|
||||
return zend_hash_index_add_new(ht, idx, pData);
|
||||
} else {
|
||||
return zend_hash_add_new(ht, key, pData);
|
||||
}
|
||||
}
|
||||
|
||||
/* This typo snuck into 7.0.17 and 7.1.3, this define exists for BC */
|
||||
#define zend_symbtable_add_new(ht, key, pData) \
|
||||
zend_symtable_add_new(ht, key, pData)
|
||||
|
||||
static zend_always_inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData)
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
int i_result;
|
||||
int i_op1, i_op2;
|
||||
int str_len;
|
||||
char str_result[MAX_LENGTH_OF_LONG+1];
|
||||
char str_result[MAX_LENGTH_OF_LONG];
|
||||
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
zend_string_free(Z_STR_P(op1));
|
||||
|
||||
@@ -36,6 +36,8 @@ ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_fun
|
||||
int result;
|
||||
zend_fcall_info fci;
|
||||
zval retval;
|
||||
HashTable *function_table;
|
||||
|
||||
zval params[2];
|
||||
|
||||
if (param_count > 0) {
|
||||
|
||||
+4958
-5144
File diff suppressed because it is too large.
Load diff
@@ -1142,8 +1142,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
RETURN_TOKEN(T_RETURN);
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"yield"{WHITESPACE}"from"[^a-zA-Z0-9_\x80-\xff] {
|
||||
yyless(yyleng - 1);
|
||||
<ST_IN_SCRIPTING>"yield"{WHITESPACE}"from" {
|
||||
HANDLE_NEWLINES(yytext, yyleng);
|
||||
RETURN_TOKEN(T_YIELD_FROM);
|
||||
}
|
||||
@@ -1663,6 +1662,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
if (errno == ERANGE) { /* Overflow */
|
||||
errno = 0;
|
||||
if (yytext[0] == '0') { /* octal overflow */
|
||||
errno = 0;
|
||||
ZVAL_DOUBLE(zendlval, zend_oct_strtod(yytext, (const char **)&end));
|
||||
} else {
|
||||
ZVAL_DOUBLE(zendlval, zend_strtod(yytext, (const char **)&end));
|
||||
@@ -1674,6 +1674,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
ZVAL_UNDEF(zendlval);
|
||||
RETURN_TOKEN(T_DNUMBER);
|
||||
}
|
||||
ZEND_ASSERT(!errno);
|
||||
RETURN_TOKEN(T_DNUMBER);
|
||||
}
|
||||
/* Also not an assert for the same reason */
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -122,13 +122,11 @@ struct _zend_module_dep {
|
||||
unsigned char type; /* dependency type */
|
||||
};
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
extern ZEND_API HashTable module_registry;
|
||||
|
||||
void module_destructor(zend_module_entry *module);
|
||||
int module_registry_request_startup(zend_module_entry *module);
|
||||
int module_registry_unload_temp(const zend_module_entry *module);
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
__asm__("mul %0, %2, %3\n" \
|
||||
"smulh %1, %2, %3\n" \
|
||||
"sub %1, %1, %0, asr #63\n" \
|
||||
: "=&r"(__tmpvar), "=&r"(usedval) \
|
||||
: "r"(a), "r"(b)); \
|
||||
: "=X"(__tmpvar), "=X"(usedval) \
|
||||
: "X"(a), "X"(b)); \
|
||||
if (usedval) (dval) = (double) (a) * (double) (b); \
|
||||
else (lval) = __tmpvar; \
|
||||
} while (0)
|
||||
|
||||
+38
-65
@@ -545,7 +545,7 @@ ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *membe
|
||||
ALLOC_HASHTABLE(guards);
|
||||
zend_hash_init(guards, 8, NULL, zend_property_guard_dtor, 0);
|
||||
/* mark pointer as "special" using low bit */
|
||||
zend_hash_add_new_ptr(guards, str,
|
||||
zend_hash_add_new_ptr(guards, member,
|
||||
(void*)(((zend_uintptr_t)&zv->u2.property_guard) | 1));
|
||||
zend_string_release(Z_STR_P(zv));
|
||||
ZVAL_ARR(zv, guards);
|
||||
@@ -574,10 +574,9 @@ ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *membe
|
||||
zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
|
||||
{
|
||||
zend_object *zobj;
|
||||
zval tmp_member, tmp_object;
|
||||
zval tmp_member;
|
||||
zval *retval;
|
||||
uint32_t property_offset;
|
||||
uint32_t *guard = NULL;
|
||||
|
||||
zobj = Z_OBJ_P(object);
|
||||
|
||||
@@ -610,18 +609,12 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ZVAL_UNDEF(&tmp_object);
|
||||
|
||||
/* magic isset */
|
||||
if ((type == BP_VAR_IS) && zobj->ce->__isset) {
|
||||
zval tmp_result;
|
||||
guard = zend_get_property_guard(zobj, Z_STR_P(member));
|
||||
zval tmp_object, tmp_result;
|
||||
uint32_t *guard = zend_get_property_guard(zobj, Z_STR_P(member));
|
||||
|
||||
if (!((*guard) & IN_ISSET)) {
|
||||
if (Z_TYPE(tmp_member) == IS_UNDEF) {
|
||||
ZVAL_COPY(&tmp_member, member);
|
||||
member = &tmp_member;
|
||||
}
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
ZVAL_UNDEF(&tmp_result);
|
||||
|
||||
@@ -636,20 +629,19 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
|
||||
goto exit;
|
||||
}
|
||||
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_result);
|
||||
}
|
||||
}
|
||||
|
||||
/* magic get */
|
||||
if (zobj->ce->__get) {
|
||||
if (guard == NULL) {
|
||||
guard = zend_get_property_guard(zobj, Z_STR_P(member));
|
||||
}
|
||||
uint32_t *guard = zend_get_property_guard(zobj, Z_STR_P(member));
|
||||
if (!((*guard) & IN_GET)) {
|
||||
zval tmp_object;
|
||||
|
||||
/* have getter - try with it! */
|
||||
if (Z_TYPE(tmp_object) == IS_UNDEF) {
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
}
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
*guard |= IN_GET; /* prevent circular getting */
|
||||
zend_std_call_getter(&tmp_object, member, rv);
|
||||
*guard &= ~IN_GET;
|
||||
@@ -668,16 +660,14 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
|
||||
}
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
goto exit;
|
||||
} else if (Z_STRVAL_P(member)[0] == '\0' && Z_STRLEN_P(member) != 0) {
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zend_throw_error(NULL, "Cannot access property started with '\\0'");
|
||||
retval = &EG(uninitialized_zval);
|
||||
goto exit;
|
||||
} else {
|
||||
if (Z_STRVAL_P(member)[0] == '\0' && Z_STRLEN_P(member) != 0) {
|
||||
zend_throw_error(NULL, "Cannot access property started with '\\0'");
|
||||
retval = &EG(uninitialized_zval);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
|
||||
if ((type != BP_VAR_IS)) {
|
||||
zend_error(E_NOTICE,"Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), Z_STRVAL_P(member));
|
||||
}
|
||||
@@ -788,38 +778,34 @@ exit:
|
||||
zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = Z_OBJCE_P(object);
|
||||
zval tmp_offset, tmp_object;
|
||||
zval tmp;
|
||||
|
||||
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
|
||||
if (offset == NULL) {
|
||||
/* [] construct */
|
||||
ZVAL_NULL(&tmp_offset);
|
||||
ZVAL_NULL(&tmp);
|
||||
offset = &tmp;
|
||||
} else {
|
||||
ZVAL_DEREF(offset);
|
||||
ZVAL_COPY(&tmp_offset, offset);
|
||||
SEPARATE_ARG_IF_REF(offset);
|
||||
}
|
||||
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
if (type == BP_VAR_IS) {
|
||||
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetexists", rv, &tmp_offset);
|
||||
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", rv, offset);
|
||||
if (UNEXPECTED(Z_ISUNDEF_P(rv))) {
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_offset);
|
||||
zval_ptr_dtor(offset);
|
||||
return NULL;
|
||||
}
|
||||
if (!i_zend_is_true(rv)) {
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_offset);
|
||||
zval_ptr_dtor(offset);
|
||||
zval_ptr_dtor(rv);
|
||||
return &EG(uninitialized_zval);
|
||||
}
|
||||
zval_ptr_dtor(rv);
|
||||
}
|
||||
|
||||
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetget", rv, &tmp_offset);
|
||||
zend_call_method_with_1_params(object, ce, NULL, "offsetget", rv, offset);
|
||||
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_offset);
|
||||
zval_ptr_dtor(offset);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(rv) == IS_UNDEF)) {
|
||||
if (UNEXPECTED(!EG(exception))) {
|
||||
@@ -838,19 +824,17 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /*
|
||||
static void zend_std_write_dimension(zval *object, zval *offset, zval *value) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = Z_OBJCE_P(object);
|
||||
zval tmp_offset, tmp_object;
|
||||
zval tmp;
|
||||
|
||||
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
|
||||
if (!offset) {
|
||||
ZVAL_NULL(&tmp_offset);
|
||||
ZVAL_NULL(&tmp);
|
||||
offset = &tmp;
|
||||
} else {
|
||||
ZVAL_DEREF(offset);
|
||||
ZVAL_COPY(&tmp_offset, offset);
|
||||
SEPARATE_ARG_IF_REF(offset);
|
||||
}
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
zend_call_method_with_2_params(&tmp_object, ce, NULL, "offsetset", NULL, &tmp_offset, value);
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_offset);
|
||||
zend_call_method_with_2_params(object, ce, NULL, "offsetset", NULL, offset, value);
|
||||
zval_ptr_dtor(offset);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
}
|
||||
@@ -860,19 +844,17 @@ static void zend_std_write_dimension(zval *object, zval *offset, zval *value) /*
|
||||
static int zend_std_has_dimension(zval *object, zval *offset, int check_empty) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = Z_OBJCE_P(object);
|
||||
zval retval, tmp_offset, tmp_object;
|
||||
zval retval;
|
||||
int result;
|
||||
|
||||
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
|
||||
ZVAL_DEREF(offset);
|
||||
ZVAL_COPY(&tmp_offset, offset);
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetexists", &retval, &tmp_offset);
|
||||
SEPARATE_ARG_IF_REF(offset);
|
||||
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", &retval, offset);
|
||||
if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
|
||||
result = i_zend_is_true(&retval);
|
||||
zval_ptr_dtor(&retval);
|
||||
if (check_empty && result && EXPECTED(!EG(exception))) {
|
||||
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetget", &retval, &tmp_offset);
|
||||
zend_call_method_with_1_params(object, ce, NULL, "offsetget", &retval, offset);
|
||||
if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
|
||||
result = i_zend_is_true(&retval);
|
||||
zval_ptr_dtor(&retval);
|
||||
@@ -881,8 +863,7 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty) /
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_offset);
|
||||
zval_ptr_dtor(offset);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
return 0;
|
||||
@@ -1039,15 +1020,11 @@ exit:
|
||||
static void zend_std_unset_dimension(zval *object, zval *offset) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = Z_OBJCE_P(object);
|
||||
zval tmp_offset, tmp_object;
|
||||
|
||||
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1)) {
|
||||
ZVAL_DEREF(offset);
|
||||
ZVAL_COPY(&tmp_offset, offset);
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetunset", NULL, &tmp_offset);
|
||||
zval_ptr_dtor(&tmp_object);
|
||||
zval_ptr_dtor(&tmp_offset);
|
||||
SEPARATE_ARG_IF_REF(offset);
|
||||
zend_call_method_with_1_params(object, ce, NULL, "offsetunset", NULL, offset);
|
||||
zval_ptr_dtor(offset);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
|
||||
}
|
||||
@@ -1601,10 +1578,6 @@ found:
|
||||
zval tmp_object;
|
||||
|
||||
/* have issetter - try with it! */
|
||||
if (Z_TYPE(tmp_member) == IS_UNDEF) {
|
||||
ZVAL_COPY(&tmp_member, member);
|
||||
member = &tmp_member;
|
||||
}
|
||||
ZVAL_COPY(&tmp_object, object);
|
||||
(*guard) |= IN_ISSET; /* prevent circular getting */
|
||||
zend_std_call_issetter(&tmp_object, member, &rv);
|
||||
|
||||
@@ -155,12 +155,12 @@ struct _zend_object_handlers {
|
||||
zend_object_compare_zvals_t compare;
|
||||
};
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
extern ZEND_API zend_object_handlers std_object_handlers;
|
||||
|
||||
#define zend_get_function_root_class(fbc) \
|
||||
((fbc)->common.prototype ? (fbc)->common.prototype->common.scope : (fbc)->common.scope)
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key);
|
||||
ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent);
|
||||
ZEND_API ZEND_COLD zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name);
|
||||
|
||||
+19
-51
@@ -222,10 +222,8 @@ ZEND_API void ZEND_FASTCALL convert_scalar_to_number(zval *op) /* {{{ */
|
||||
if (Z_TYPE(holder) == IS_LONG) { \
|
||||
if (op == result) { \
|
||||
zval_ptr_dtor(op); \
|
||||
ZVAL_LONG(op, Z_LVAL(holder)); \
|
||||
} else { \
|
||||
(op) = &(holder); \
|
||||
} \
|
||||
(op) = &(holder); \
|
||||
} \
|
||||
break; \
|
||||
} \
|
||||
@@ -953,13 +951,8 @@ ZEND_API int ZEND_FASTCALL add_function(zval *result, zval *op1, zval *op2) /* {
|
||||
} else if (!converted) {
|
||||
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_ADD, add_function);
|
||||
|
||||
if (EXPECTED(op1 != op2)) {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result, 0);
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
op2 = op1;
|
||||
}
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result, 0);
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(NULL, "Unsupported operand types");
|
||||
@@ -1000,13 +993,8 @@ ZEND_API int ZEND_FASTCALL sub_function(zval *result, zval *op1, zval *op2) /* {
|
||||
} else if (!converted) {
|
||||
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SUB, sub_function);
|
||||
|
||||
if (EXPECTED(op1 != op2)) {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result, 0);
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
op2 = op1;
|
||||
}
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result, 0);
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(NULL, "Unsupported operand types");
|
||||
@@ -1052,13 +1040,8 @@ ZEND_API int ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *op2) /* {
|
||||
} else if (!converted) {
|
||||
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_MUL, mul_function);
|
||||
|
||||
if (EXPECTED(op1 != op2)) {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result, 0);
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
op2 = op1;
|
||||
}
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result, 0);
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(NULL, "Unsupported operand types");
|
||||
@@ -1135,27 +1118,17 @@ ZEND_API int ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {
|
||||
} else if (!converted) {
|
||||
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_POW, pow_function);
|
||||
|
||||
if (EXPECTED(op1 != op2)) {
|
||||
if (Z_TYPE_P(op1) == IS_ARRAY) {
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
}
|
||||
if (Z_TYPE_P(op2) == IS_ARRAY) {
|
||||
ZVAL_LONG(result, 1L);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result, 0);
|
||||
}
|
||||
if (Z_TYPE_P(op1) == IS_ARRAY) {
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
if (Z_TYPE_P(op1) == IS_ARRAY) {
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
}
|
||||
op2 = op1;
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
}
|
||||
if (Z_TYPE_P(op2) == IS_ARRAY) {
|
||||
ZVAL_LONG(result, 1L);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result, 0);
|
||||
}
|
||||
converted = 1;
|
||||
} else {
|
||||
@@ -1220,13 +1193,8 @@ ZEND_API int ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {
|
||||
} else if (!converted) {
|
||||
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_DIV, div_function);
|
||||
|
||||
if (EXPECTED(op1 != op2)) {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result, 0);
|
||||
} else {
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
op2 = op1;
|
||||
}
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result, 0);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result, 0);
|
||||
converted = 1;
|
||||
} else {
|
||||
zend_throw_error(NULL, "Unsupported operand types");
|
||||
|
||||
+6
-14
@@ -131,12 +131,6 @@
|
||||
|
||||
#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
|
||||
|
||||
# if defined(__has_feature)
|
||||
# if __has_feature(address_sanitizer)
|
||||
# define __SANITIZE_ADDRESS__
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef RTLD_LAZY
|
||||
# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
|
||||
# endif
|
||||
@@ -147,7 +141,7 @@
|
||||
|
||||
# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
|
||||
# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__)
|
||||
# elif defined(RTLD_DEEPBIND)
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
|
||||
# else
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
|
||||
@@ -245,13 +239,11 @@ char *alloca();
|
||||
# define ZEND_FASTCALL
|
||||
#endif
|
||||
|
||||
#ifndef restrict
|
||||
# if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004
|
||||
# else
|
||||
# define __restrict__
|
||||
# endif
|
||||
# define restrict __restrict__
|
||||
#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004
|
||||
#else
|
||||
# define __restrict__
|
||||
#endif
|
||||
#define restrict __restrict__
|
||||
|
||||
#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) || __has_attribute(noreturn)
|
||||
# define HAVE_NORETURN
|
||||
@@ -433,7 +425,7 @@ char *alloca();
|
||||
#define ZEND_STRL(str) (str), (sizeof(str)-1)
|
||||
#define ZEND_STRS(str) (str), (sizeof(str))
|
||||
#define ZEND_NORMALIZE_BOOL(n) \
|
||||
((n) ? (((n)<0) ? -1 : 1) : 0)
|
||||
((n) ? (((n)>0) ? 1 : -1) : 0)
|
||||
#define ZEND_TRUTH(x) ((x) ? 1 : 0)
|
||||
#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b))
|
||||
|
||||
|
||||
+3
-15
@@ -86,17 +86,12 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
|
||||
{
|
||||
int errno_save = errno;
|
||||
zend_signal_queue_t *queue, *qtmp;
|
||||
zend_bool is_handling_safe = 1;
|
||||
|
||||
#ifdef ZTS
|
||||
ZEND_TSRMLS_CACHE_UPDATE();
|
||||
/* A signal could hit after TSRM shutdown, in this case globals are already freed. */
|
||||
if (NULL == TSRMLS_CACHE || NULL == TSRMG_BULK_STATIC(zend_signal_globals_id, zend_signal_globals_t *)) {
|
||||
is_handling_safe = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (EXPECTED(is_handling_safe && SIGG(active))) {
|
||||
if (EXPECTED(SIGG(active))) {
|
||||
if (UNEXPECTED(SIGG(depth) == 0)) { /* try to handle signal */
|
||||
if (UNEXPECTED(SIGG(blocked))) {
|
||||
SIGG(blocked) = 0;
|
||||
@@ -179,14 +174,7 @@ static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context)
|
||||
int errno_save = errno;
|
||||
struct sigaction sa;
|
||||
sigset_t sigset;
|
||||
zend_signal_entry_t p_sig;
|
||||
#ifdef ZTS
|
||||
if (NULL == TSRMLS_CACHE || NULL == TSRMG_BULK_STATIC(zend_signal_globals_id, zend_signal_globals_t *)) {
|
||||
p_sig.flags = 0;
|
||||
p_sig.handler = SIG_DFL;
|
||||
} else
|
||||
#endif
|
||||
p_sig = SIGG(handlers)[signo-1];
|
||||
zend_signal_entry_t p_sig = SIGG(handlers)[signo-1];
|
||||
|
||||
if (p_sig.handler == SIG_DFL) { /* raise default handler */
|
||||
if (sigaction(signo, NULL, &sa) == 0) {
|
||||
@@ -210,7 +198,7 @@ static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} else if (p_sig.handler != SIG_IGN) {
|
||||
} else {
|
||||
if (p_sig.flags & SA_SIGINFO) {
|
||||
if (p_sig.flags & SA_RESETHAND) {
|
||||
SIGG(handlers)[signo-1].flags = 0;
|
||||
|
||||
@@ -88,9 +88,7 @@ END_EXTERN_C()
|
||||
ZEND_API void zend_signal_handler_unblock(void);
|
||||
void zend_signal_activate(void);
|
||||
void zend_signal_deactivate(void);
|
||||
BEGIN_EXTERN_C()
|
||||
void zend_signal_startup(void);
|
||||
END_EXTERN_C()
|
||||
void zend_signal_init(void);
|
||||
|
||||
ZEND_API int zend_signal(int signo, void (*handler)(int));
|
||||
|
||||
@@ -72,10 +72,6 @@ typedef unsigned long int uint32_t;
|
||||
#define NO_INFNAN_CHECK
|
||||
#endif
|
||||
|
||||
#ifndef NO_ERRNO
|
||||
#define NO_ERRNO
|
||||
#endif
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#define IEEE_BIG_ENDIAN 1
|
||||
#else
|
||||
|
||||
+3
-4
@@ -940,10 +940,9 @@ static zend_always_inline uint32_t zval_delref_p(zval* pz) {
|
||||
|
||||
#define SEPARATE_STRING(zv) do { \
|
||||
zval *_zv = (zv); \
|
||||
if (Z_REFCOUNT_P(_zv) > 1) { \
|
||||
if (Z_REFCOUNTED_P(_zv)) { \
|
||||
Z_DELREF_P(_zv); \
|
||||
} \
|
||||
if (Z_REFCOUNTED_P(_zv) && \
|
||||
Z_REFCOUNT_P(_zv) > 1) { \
|
||||
Z_DELREF_P(_zv); \
|
||||
zval_copy_ctor_func(_zv); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
@@ -167,10 +167,8 @@ ZEND_API void ZEND_FASTCALL _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(zvalue) == IS_ARRAY)) {
|
||||
ZVAL_ARR(zvalue, zend_array_dup(Z_ARRVAL_P(zvalue)));
|
||||
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING)) {
|
||||
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
|
||||
ZVAL_NEW_STR(zvalue, zend_string_dup(Z_STR_P(zvalue), 0));
|
||||
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
|
||||
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING) ||
|
||||
EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
|
||||
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
|
||||
Z_STR_P(zvalue) = zend_string_dup(Z_STR_P(zvalue), 0);
|
||||
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT_AST)) {
|
||||
|
||||
+7
-33
@@ -45,19 +45,6 @@
|
||||
# define IO_REPARSE_TAG_DEDUP 0x80000013
|
||||
# endif
|
||||
|
||||
# ifndef IO_REPARSE_TAG_CLOUD
|
||||
# define IO_REPARSE_TAG_CLOUD (0x9000001AL)
|
||||
# endif
|
||||
/* IO_REPARSE_TAG_CLOUD_1 through IO_REPARSE_TAG_CLOUD_F have values of 0x9000101AL
|
||||
to 0x9000F01AL, they can be checked against the mask. */
|
||||
#ifndef IO_REPARSE_TAG_CLOUD_MASK
|
||||
#define IO_REPARSE_TAG_CLOUD_MASK (0x0000F000L)
|
||||
#endif
|
||||
|
||||
#ifndef IO_REPARSE_TAG_ONEDRIVE
|
||||
#define IO_REPARSE_TAG_ONEDRIVE (0x80000021L)
|
||||
#endif
|
||||
|
||||
# ifndef VOLUME_NAME_NT
|
||||
# define VOLUME_NAME_NT 0x2
|
||||
# endif
|
||||
@@ -393,7 +380,7 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{
|
||||
if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
|
||||
size_t len = strlen(path);
|
||||
|
||||
if (len >= 4 && path[len-4] == '.') {
|
||||
if (path[len-4] == '.') {
|
||||
if (_memicmp(path+len-3, "exe", 3) == 0 ||
|
||||
_memicmp(path+len-3, "com", 3) == 0 ||
|
||||
_memicmp(path+len-3, "bat", 3) == 0 ||
|
||||
@@ -458,15 +445,11 @@ static void cwd_globals_dtor(virtual_cwd_globals *cwd_g) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void virtual_cwd_main_cwd_init(uint8_t reinit) /* {{{ */
|
||||
CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
{
|
||||
char cwd[MAXPATHLEN];
|
||||
char *result;
|
||||
|
||||
if (reinit) {
|
||||
free(main_cwd_state.cwd);
|
||||
}
|
||||
|
||||
#ifdef NETWARE
|
||||
result = getcwdpath(cwd, NULL, 1);
|
||||
if(result)
|
||||
@@ -478,10 +461,10 @@ void virtual_cwd_main_cwd_init(uint8_t reinit) /* {{{ */
|
||||
++c;
|
||||
}
|
||||
}
|
||||
#elif defined(ZEND_WIN32)
|
||||
ZeroMemory(&cwd, sizeof(cwd));
|
||||
result = php_win32_ioutil_getcwd(cwd, sizeof(cwd));
|
||||
#else
|
||||
#ifdef ZEND_WIN32
|
||||
ZeroMemory(&cwd, sizeof(cwd));
|
||||
#endif
|
||||
result = getcwd(cwd, sizeof(cwd));
|
||||
#endif
|
||||
if (!result) {
|
||||
@@ -495,12 +478,7 @@ void virtual_cwd_main_cwd_init(uint8_t reinit) /* {{{ */
|
||||
}
|
||||
#endif
|
||||
main_cwd_state.cwd = strdup(cwd);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
{
|
||||
virtual_cwd_main_cwd_init(0);
|
||||
#ifdef ZTS
|
||||
ts_allocate_id(&cwd_globals_id, sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor);
|
||||
#else
|
||||
@@ -949,7 +927,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
return -1;
|
||||
}
|
||||
|
||||
hLink = CreateFileW(pathw, 0, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
||||
hLink = CreateFileW(pathw, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
||||
if(hLink == INVALID_HANDLE_VALUE) {
|
||||
free_alloca(tmp, use_heap);
|
||||
FREE_PATHW()
|
||||
@@ -1042,11 +1020,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP ||
|
||||
/* Starting with 1709. */
|
||||
(pbuffer->ReparseTag & IO_REPARSE_TAG_CLOUD_MASK) != 0 && 0x90001018L != pbuffer->ReparseTag ||
|
||||
IO_REPARSE_TAG_CLOUD == pbuffer->ReparseTag ||
|
||||
IO_REPARSE_TAG_ONEDRIVE == pbuffer->ReparseTag) {
|
||||
else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP) {
|
||||
isabsolute = 1;
|
||||
substitutename = malloc((len + 1) * sizeof(char));
|
||||
if (!substitutename) {
|
||||
|
||||
@@ -251,10 +251,6 @@ CWD_API zend_long realpath_cache_size(void);
|
||||
CWD_API zend_long realpath_cache_max_buckets(void);
|
||||
CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void);
|
||||
|
||||
#ifdef CWD_EXPORTS
|
||||
extern void virtual_cwd_main_cwd_init(uint8_t);
|
||||
#endif
|
||||
|
||||
/* The actual macros to be used in programs using TSRM
|
||||
* If the program defines VIRTUAL_DIR it will use the
|
||||
* virtual_* functions
|
||||
|
||||
+19
-30
@@ -1692,13 +1692,9 @@ ZEND_VM_HELPER(zend_fetch_static_prop_helper, CONST|TMPVAR|CV, UNUSED|CONST|VAR,
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
ZEND_VM_C_GOTO(fetch_static_prop_return);
|
||||
@@ -1733,31 +1729,24 @@ ZEND_VM_HELPER(zend_fetch_static_prop_helper, CONST|TMPVAR|CV, UNUSED|CONST|VAR,
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
ZEND_VM_C_GOTO(fetch_static_prop_return);
|
||||
}
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(retval == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (OP1_TYPE != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (OP1_TYPE != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
} else if (OP1_TYPE == IS_CONST) {
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (OP1_TYPE == IS_CONST && retval) {
|
||||
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
|
||||
}
|
||||
|
||||
@@ -4104,7 +4093,7 @@ ZEND_VM_HANDLER(41, ZEND_GENERATOR_CREATE, ANY, ANY)
|
||||
* is allocated on heap.
|
||||
*/
|
||||
num_args = EX_NUM_ARGS();
|
||||
if (EXPECTED(num_args <= EX(func)->op_array.num_args)) {
|
||||
if (EXPECTED(num_args <= EX(func)->op_array.last_var)) {
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var + EX(func)->op_array.T) * sizeof(zval);
|
||||
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var) * sizeof(zval);
|
||||
@@ -5080,8 +5069,8 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMPVAR|UNUSED|THIS|CV, ANY)
|
||||
/* Ensure that if we're calling a private function, we're allowed to do so.
|
||||
*/
|
||||
scope = EX(func)->op_array.scope;
|
||||
if (!zend_check_private(clone, scope, clone->common.function_name)) {
|
||||
zend_throw_error(NULL, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(clone->common.scope->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
if (UNEXPECTED(ce != scope)) {
|
||||
zend_throw_error(NULL, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(ce->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -5090,7 +5079,7 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMPVAR|UNUSED|THIS|CV, ANY)
|
||||
*/
|
||||
scope = EX(func)->op_array.scope;
|
||||
if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), scope))) {
|
||||
zend_throw_error(NULL, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(clone->common.scope->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
zend_throw_error(NULL, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(ce->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -5202,7 +5191,7 @@ ZEND_VM_HANDLER(181, ZEND_FETCH_CLASS_CONSTANT, VAR|CONST|UNUSED|CLASS_FETCH, CO
|
||||
}
|
||||
value = &c->value;
|
||||
if (Z_CONSTANT_P(value)) {
|
||||
zval_update_constant_ex(value, c->ce);
|
||||
zval_update_constant_ex(value, ce);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
+130
-229
@@ -1179,7 +1179,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER(
|
||||
* is allocated on heap.
|
||||
*/
|
||||
num_args = EX_NUM_ARGS();
|
||||
if (EXPECTED(num_args <= EX(func)->op_array.num_args)) {
|
||||
if (EXPECTED(num_args <= EX(func)->op_array.last_var)) {
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var + EX(func)->op_array.T) * sizeof(zval);
|
||||
gen_execute_data = (zend_execute_data*)emalloc(used_stack);
|
||||
used_stack = (ZEND_CALL_FRAME_SLOT + EX(func)->op_array.last_var) * sizeof(zval);
|
||||
@@ -3307,8 +3307,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_
|
||||
/* Ensure that if we're calling a private function, we're allowed to do so.
|
||||
*/
|
||||
scope = EX(func)->op_array.scope;
|
||||
if (!zend_check_private(clone, scope, clone->common.function_name)) {
|
||||
zend_throw_error(NULL, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(clone->common.scope->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
if (UNEXPECTED(ce != scope)) {
|
||||
zend_throw_error(NULL, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(ce->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -3317,7 +3317,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_
|
||||
*/
|
||||
scope = EX(func)->op_array.scope;
|
||||
if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), scope))) {
|
||||
zend_throw_error(NULL, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(clone->common.scope->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
zend_throw_error(NULL, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(ce->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -4869,13 +4869,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
@@ -4910,31 +4906,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
}
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(retval == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (IS_CONST != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (IS_CONST != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
} else if (IS_CONST == IS_CONST) {
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CONST == IS_CONST && retval) {
|
||||
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
|
||||
}
|
||||
|
||||
@@ -5808,7 +5797,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_CONS
|
||||
}
|
||||
value = &c->value;
|
||||
if (Z_CONSTANT_P(value)) {
|
||||
zval_update_constant_ex(value, c->ce);
|
||||
zval_update_constant_ex(value, ce);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -6733,13 +6722,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
@@ -6774,31 +6759,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
}
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(retval == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (IS_CONST != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (IS_CONST != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
} else if (IS_CONST == IS_CONST) {
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CONST == IS_CONST && retval) {
|
||||
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
|
||||
}
|
||||
|
||||
@@ -7316,13 +7294,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
@@ -7357,31 +7331,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
}
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(retval == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (IS_CONST != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (IS_CONST != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
} else if (IS_CONST == IS_CONST) {
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CONST == IS_CONST && retval) {
|
||||
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
|
||||
}
|
||||
|
||||
@@ -20018,7 +19985,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_
|
||||
}
|
||||
value = &c->value;
|
||||
if (Z_CONSTANT_P(value)) {
|
||||
zval_update_constant_ex(value, c->ce);
|
||||
zval_update_constant_ex(value, ce);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -28031,8 +27998,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND
|
||||
/* Ensure that if we're calling a private function, we're allowed to do so.
|
||||
*/
|
||||
scope = EX(func)->op_array.scope;
|
||||
if (!zend_check_private(clone, scope, clone->common.function_name)) {
|
||||
zend_throw_error(NULL, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(clone->common.scope->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
if (UNEXPECTED(ce != scope)) {
|
||||
zend_throw_error(NULL, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(ce->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -28041,7 +28008,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND
|
||||
*/
|
||||
scope = EX(func)->op_array.scope;
|
||||
if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), scope))) {
|
||||
zend_throw_error(NULL, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(clone->common.scope->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
zend_throw_error(NULL, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(ce->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -29823,7 +29790,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUS
|
||||
}
|
||||
value = &c->value;
|
||||
if (Z_CONSTANT_P(value)) {
|
||||
zval_update_constant_ex(value, c->ce);
|
||||
zval_update_constant_ex(value, ce);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -35361,8 +35328,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPC
|
||||
/* Ensure that if we're calling a private function, we're allowed to do so.
|
||||
*/
|
||||
scope = EX(func)->op_array.scope;
|
||||
if (!zend_check_private(clone, scope, clone->common.function_name)) {
|
||||
zend_throw_error(NULL, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(clone->common.scope->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
if (UNEXPECTED(ce != scope)) {
|
||||
zend_throw_error(NULL, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(ce->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -35371,7 +35338,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPC
|
||||
*/
|
||||
scope = EX(func)->op_array.scope;
|
||||
if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), scope))) {
|
||||
zend_throw_error(NULL, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(clone->common.scope->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
zend_throw_error(NULL, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(ce->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -37975,13 +37942,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
@@ -38016,31 +37979,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
}
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(retval == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (IS_CV != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (IS_CV != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
} else if (IS_CV == IS_CONST) {
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CV == IS_CONST && retval) {
|
||||
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
|
||||
}
|
||||
|
||||
@@ -41049,13 +41005,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
@@ -41090,31 +41042,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
}
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(retval == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (IS_CV != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (IS_CV != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
} else if (IS_CV == IS_CONST) {
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CV == IS_CONST && retval) {
|
||||
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
|
||||
}
|
||||
|
||||
@@ -42108,13 +42053,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
@@ -42149,31 +42090,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
}
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(retval == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (IS_CV != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if (IS_CV != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
} else if (IS_CV == IS_CONST) {
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CV == IS_CONST && retval) {
|
||||
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
|
||||
}
|
||||
|
||||
@@ -51620,8 +51554,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_TMPVAR_HANDLER(ZEND
|
||||
/* Ensure that if we're calling a private function, we're allowed to do so.
|
||||
*/
|
||||
scope = EX(func)->op_array.scope;
|
||||
if (!zend_check_private(clone, scope, clone->common.function_name)) {
|
||||
zend_throw_error(NULL, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(clone->common.scope->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
if (UNEXPECTED(ce != scope)) {
|
||||
zend_throw_error(NULL, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(ce->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -51630,7 +51564,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_TMPVAR_HANDLER(ZEND
|
||||
*/
|
||||
scope = EX(func)->op_array.scope;
|
||||
if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), scope))) {
|
||||
zend_throw_error(NULL, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(clone->common.scope->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
zend_throw_error(NULL, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(ce->name), scope ? ZSTR_VAL(scope->name) : "");
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -52478,13 +52412,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
@@ -52519,31 +52449,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
}
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(retval == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
} else if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) {
|
||||
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
|
||||
}
|
||||
|
||||
@@ -53438,13 +53361,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
@@ -53479,31 +53398,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
}
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(retval == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
} else if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) {
|
||||
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
|
||||
}
|
||||
|
||||
@@ -53937,13 +53849,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
@@ -53978,31 +53886,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
|
||||
|
||||
/* check if static properties were destoyed */
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
goto fetch_static_prop_return;
|
||||
}
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(retval == NULL)) {
|
||||
if (type == BP_VAR_IS) {
|
||||
retval = &EG(uninitialized_zval);
|
||||
} else {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
ZEND_ASSERT(EG(exception));
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
} else if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) {
|
||||
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 690 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user