php-src/Zend/zend.c

1774 lines
50 KiB
C
Raw Normal View History

1999-04-08 02:10:10 +08:00
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
2019-01-30 17:23:29 +08:00
| Copyright (c) Zend Technologies Ltd. (http://www.zend.com) |
1999-04-08 02:10:10 +08:00
+----------------------------------------------------------------------+
2001-12-11 23:16:21 +08:00
| This source file is subject to version 2.00 of the Zend license, |
1999-07-16 22:58:16 +08:00
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
2001-12-11 23:16:21 +08:00
| http://www.zend.com/license/2_00.txt. |
1999-07-16 22:58:16 +08:00
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
1999-04-08 02:10:10 +08:00
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@php.net> |
| Zeev Suraski <zeev@php.net> |
1999-04-08 02:10:10 +08:00
+----------------------------------------------------------------------+
*/
#include "zend.h"
#include "zend_extensions.h"
2001-02-27 02:18:34 +08:00
#include "zend_modules.h"
1999-04-08 02:10:10 +08:00
#include "zend_constants.h"
#include "zend_list.h"
#include "zend_API.h"
#include "zend_exceptions.h"
#include "zend_builtin_functions.h"
#include "zend_ini.h"
#include "zend_vm.h"
2010-04-24 21:32:30 +08:00
#include "zend_dtrace.h"
#include "zend_virtual_cwd.h"
#include "zend_smart_str.h"
#include "zend_smart_string.h"
#include "zend_cpuinfo.h"
1999-04-08 02:10:10 +08:00
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
static size_t global_map_ptr_last = 0;
#ifdef ZTS
ZEND_API int compiler_globals_id;
ZEND_API int executor_globals_id;
ZEND_API size_t compiler_globals_offset;
ZEND_API size_t executor_globals_offset;
static HashTable *global_function_table = NULL;
static HashTable *global_class_table = NULL;
static HashTable *global_constants_table = NULL;
static HashTable *global_auto_globals_table = NULL;
static HashTable *global_persistent_list = NULL;
ZEND_TSRMLS_CACHE_DEFINE()
# define GLOBAL_FUNCTION_TABLE global_function_table
# define GLOBAL_CLASS_TABLE global_class_table
# define GLOBAL_CONSTANTS_TABLE global_constants_table
# define GLOBAL_AUTO_GLOBALS_TABLE global_auto_globals_table
#else
# define GLOBAL_FUNCTION_TABLE CG(function_table)
# define GLOBAL_CLASS_TABLE CG(class_table)
# define GLOBAL_AUTO_GLOBALS_TABLE CG(auto_globals)
# define GLOBAL_CONSTANTS_TABLE EG(zend_constants)
#endif
ZEND_API zend_utility_values zend_uv;
ZEND_API zend_bool zend_dtrace_enabled;
/* version information */
static char *zend_version_info;
static uint32_t zend_version_info_length;
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) Zend Technologies\n"
#define PRINT_ZVAL_INDENT 4
1999-04-08 02:10:10 +08:00
/* true multithread-shared globals */
ZEND_API zend_class_entry *zend_standard_class_def = NULL;
2014-08-26 01:24:55 +08:00
ZEND_API size_t (*zend_printf)(const char *format, ...);
ZEND_API zend_write_func_t zend_write;
ZEND_API FILE *(*zend_fopen)(const char *filename, zend_string **opened_path);
2014-12-14 06:06:14 +08:00
ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle);
ZEND_API void (*zend_ticks_function)(int ticks);
ZEND_API void (*zend_interrupt_function)(zend_execute_data *execute_data);
ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint32_t error_lineno, const char *format, va_list args);
void (*zend_printf_to_smart_string)(smart_string *buf, const char *format, va_list ap);
void (*zend_printf_to_smart_str)(smart_str *buf, const char *format, va_list ap);
2014-12-14 06:06:14 +08:00
ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
ZEND_API zend_string *(*zend_resolve_path)(const char *filename, size_t filename_len);
ZEND_API int (*zend_post_startup_cb)(void) = NULL;
ZEND_API void (*zend_post_shutdown_cb)(void) = NULL;
2014-12-14 06:06:14 +08:00
void (*zend_on_timeout)(int seconds);
2002-09-19 23:58:01 +08:00
2014-12-14 06:06:14 +08:00
static void (*zend_message_dispatcher_p)(zend_long message, const void *data);
static zval *(*zend_get_configuration_directive_p)(zend_string *name);
1999-06-20 04:42:15 +08:00
#if ZEND_RC_DEBUG
ZEND_API zend_bool zend_rc_debug = 0;
#endif
static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
2002-11-20 01:51:30 +08:00
{
if (!new_value) {
2019-08-30 16:31:32 +08:00
EG(error_reporting) = E_ALL;
2002-11-20 01:51:30 +08:00
} else {
EG(error_reporting) = atoi(ZSTR_VAL(new_value));
2002-11-20 01:51:30 +08:00
}
return SUCCESS;
}
/* }}} */
2002-11-20 01:51:30 +08:00
2008-01-22 17:27:48 +08:00
static ZEND_INI_MH(OnUpdateGCEnabled) /* {{{ */
{
zend_bool val;
val = zend_ini_parse_bool(new_value);
2018-03-02 16:02:21 +08:00
gc_enable(val);
2008-01-22 17:27:48 +08:00
return SUCCESS;
}
/* }}} */
static ZEND_INI_DISP(zend_gc_enabled_displayer_cb) /* {{{ */
{
if (gc_enabled()) {
ZEND_PUTS("On");
} else {
ZEND_PUTS("Off");
}
}
/* }}} */
static ZEND_INI_MH(OnUpdateScriptEncoding) /* {{{ */
{
2014-12-24 00:33:30 +08:00
if (!CG(multibyte)) {
return FAILURE;
}
2014-12-14 06:06:14 +08:00
if (!zend_multibyte_get_functions()) {
return SUCCESS;
}
return zend_multibyte_set_script_encoding_by_string(new_value ? ZSTR_VAL(new_value) : NULL, new_value ? ZSTR_LEN(new_value) : 0);
}
/* }}} */
Improved assert() according to expectations RFC. See https://wiki.php.net/rfc/expectations Squashed commit of the following: commit 3f3651a7870738e35ec541e53b53069152135b24 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Mar 2 11:56:33 2015 +0300 opcode 137 is used for ZEND_OP_DATA and con't be reused for ZEND_ASSERT_CHECK commit ca8ecabf2a5f97f9116839c33396c9a7037e4368 Merge: 24328ac 9dac923 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Mar 2 10:49:23 2015 +0300 Merge branch 'master' into assert * master: Update NEWS Fixed bug #69139 (Crash in gc_zval_possible_root on unserialize) windows only test Align entries format Align entries format for 5.6.7 Align entries format for 5.5.23 Bump header year Fixed bug #69144 (strtr not replacing with partly matching replace pairs) Fixed test? Revert mktime()/gmmktime()'s arginfo Update NEWS Fixed bug #69141 Missing arguments in reflection info for some builtin functions Add NEWS entry Remove useless date warning Fix ARG_INFO for levenshtein Fix ARG_INFO for levenshtein fix dir separator in tests Update NEWS Fixed bug #69085 (SoapClient's __call() type confusion through unserialize()). commit 24328ac03f79a0f3b19be7411bf9e173f392abda Merge: 021fd94 1cdee9a Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Feb 27 15:57:13 2015 +0300 Merge branch 'master' into assert * master: Fixed C++ support Fixed bug #69115 crash in mail Reorder Update NEWs Fixed bug #69121 (Segfault in get_current_user when script owner is not in passwd with ZTS build) Update News Fixed bug #69125 (Array numeric string as key) fix bug#68942's patch Fixed ability to build unspecialized executor Fixed bug #69124 (method name could not be used when by ref) Fixed a bug that header value is not terminated by '\0' when accessed through getenv(). Fixed a bug that header value is not terminated by '\0' when accessed through getenv(). commit 021fd94ed1d692d212e6e30c6c1a9767c3f16f7f Merge: 49963eb ace1f82 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Feb 26 11:26:03 2015 +0300 Merge branch 'master' into assert * master: (59 commits) Improved ASSIGN_DIM handler Don't inline slow path Revert a part committted by mistake Fixed compilation warnings Fixed a bug that header value is not terminated by '\0' when accessed through getenv(). better name Improve fix for #69038 Update NEWs Fixed bug #69108 ("Segmentation fault" when (de)serializing SplObjectStorage) Added specialized versions of DO_FCALL handler: DO_ICALL - for internal functions DO_UCALL - for user functions DO_FCALL_BY_NAME - plain, most probably user, funcstions (not methods) Use cache_slot offsets instead of indexes (simplify run-time instructions) Split INIT_FCALL_BY_NAME inti INIT_FCALL_BY_NAME(CONST+STRING) and INIT_DYNAMIC_CALL(CONST-STRING|TMPVAR|CV) Support list($a, $b) = $a Avoid unnecassary check Make zend_array_destroy() to free the corresponding zend_array Eliminate check on the fast path Make current() and key() receive argument by value. Use Firebird default home folder, replace Interbase with Firebird Updated NEWS updated NEWS ... Conflicts: Zend/zend_vm_execute.h Zend/zend_vm_opcodes.c Zend/zend_vm_opcodes.h commit 49963ebf9d2bcd6d2670203dd72884f6ba6c8a4b Merge: 07b1f92 6b77959 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Feb 19 11:13:08 2015 +0300 Merge branch 'master' into assert * master: Implemented AST pretty-printer update NEWS to match the actual stuff in 5.6.6 update NEWS to match the actual stuff in 5.5.22 update NEWS(add missing entry for the enchant fix, and reorder the entries a bit) fix typo in bug# update NEWS fix email format update NEWS update 5.6.6 release date in NEWS Fix bug #69033 (Request may get env. variables from previous requests if PHP works as FastCGI) BFN fix test fix test fix test Fixed bug #65593 (Segfault when calling ob_start from output buffering callback) Updated NEWS add CVE 5.4.39 next Fix associativity to match Perl Blast off to space. Conflicts: Zend/zend_ast.c commit 07b1f92ed662f6fa9309e679b83aff328362c98b Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Feb 18 23:06:32 2015 +0300 fixed pretty-printer (support for "elseif") commit 5a976c8d85078502b48379996ab066e57533a0c3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Feb 18 19:50:08 2015 +0300 Fixed vaeious ptetty-printer issues commit 69491e8e8e692030b0585aab485146906c0fedaf Merge: 8473157 3ddc246 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Feb 18 10:18:32 2015 +0300 Merge branch 'master' into assert * master: Set PHP_JSON_VERSION to 1.4.0 Remove unnecessary resource checks in openssl ext JSON is now maintained commit 8473157fbb12d03fff8d5b602865a4b667522a4d Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Feb 18 10:17:26 2015 +0300 Fixed typo and white spaces commit 96de5ffc8d604df9797d0141ae5ad9c15e1d6c32 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Feb 18 00:28:39 2015 +0300 Fixed assert() in namesapaces commit 5eba069c28e7b6590618707e0b21cdb2dd62a192 Merge: 4a2d9c0 d428bf2 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Feb 17 22:45:55 2015 +0300 Merge branch 'master' into assert * master: (25 commits) improve debugability in TS debug builds More UPGRADING, in particular on foreach Fixed bug #69038 (switch(SOMECONSTANT) misbehaves) for master Replace var is introduced abstain from using xmlCleanupParser fix TS build Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) update news Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) Port for for bug #68552 Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) Update NEWS Fixed bug #69038 (switch(SOMECONSTANT) misbehaves) - BFN Don't read the local php.ini when Generating Phar When building phar shared, you can end up loading a previous phar.so that isn't compatible with the php cli being used to generate Phar here. - Fixed bug #67827 (broken detection of system crypt sha256/sha512 support) Delete json outdated package.xml made ZEND_TSRMLS_CACHE_* macros look like function calls - Fix merge - Fixed bug #67427 (SoapServer cannot handle large messages) patch by: brandt at docoloc dot de ... commit 4a2d9c0953dccd9e78ebee9291e1213419eb9136 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Feb 17 22:45:10 2015 +0300 Implemented AST pretty-printer to capture expression passed to assert() commit 7a059b66d51a65159801bd826346721325b89fec Merge: 9973df7 3892eba Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Feb 16 18:42:28 2015 +0300 Merge branch 'expect' of github.com:krakjoe/php-src into assert * 'expect' of github.com:krakjoe/php-src: import expect Conflicts: Zend/zend_compile.c Zend/zend_execute_API.c Zend/zend_globals.h Zend/zend_vm_def.h Zend/zend_vm_execute.h Zend/zend_vm_opcodes.c Zend/zend_vm_opcodes.h ext/opcache/Optimizer/block_pass.c ext/opcache/Optimizer/pass1_5.c ext/standard/assert.c ext/standard/tests/assert/assert_error3.phpt commit 3892eba2bf56a7699453855c995404106322718d Author: krakjoe <joe.watkins@live.co.uk> Date: Sun Feb 2 12:49:35 2014 +0000 import expect
2015-03-02 17:25:40 +08:00
static ZEND_INI_MH(OnUpdateAssertions) /* {{{ */
{
zend_long *p, val;
#ifndef ZTS
char *base = (char *) mh_arg2;
#else
char *base;
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
p = (zend_long *) (base+(size_t) mh_arg1);
val = zend_atol(ZSTR_VAL(new_value), ZSTR_LEN(new_value));
Improved assert() according to expectations RFC. See https://wiki.php.net/rfc/expectations Squashed commit of the following: commit 3f3651a7870738e35ec541e53b53069152135b24 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Mar 2 11:56:33 2015 +0300 opcode 137 is used for ZEND_OP_DATA and con't be reused for ZEND_ASSERT_CHECK commit ca8ecabf2a5f97f9116839c33396c9a7037e4368 Merge: 24328ac 9dac923 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Mar 2 10:49:23 2015 +0300 Merge branch 'master' into assert * master: Update NEWS Fixed bug #69139 (Crash in gc_zval_possible_root on unserialize) windows only test Align entries format Align entries format for 5.6.7 Align entries format for 5.5.23 Bump header year Fixed bug #69144 (strtr not replacing with partly matching replace pairs) Fixed test? Revert mktime()/gmmktime()'s arginfo Update NEWS Fixed bug #69141 Missing arguments in reflection info for some builtin functions Add NEWS entry Remove useless date warning Fix ARG_INFO for levenshtein Fix ARG_INFO for levenshtein fix dir separator in tests Update NEWS Fixed bug #69085 (SoapClient's __call() type confusion through unserialize()). commit 24328ac03f79a0f3b19be7411bf9e173f392abda Merge: 021fd94 1cdee9a Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Feb 27 15:57:13 2015 +0300 Merge branch 'master' into assert * master: Fixed C++ support Fixed bug #69115 crash in mail Reorder Update NEWs Fixed bug #69121 (Segfault in get_current_user when script owner is not in passwd with ZTS build) Update News Fixed bug #69125 (Array numeric string as key) fix bug#68942's patch Fixed ability to build unspecialized executor Fixed bug #69124 (method name could not be used when by ref) Fixed a bug that header value is not terminated by '\0' when accessed through getenv(). Fixed a bug that header value is not terminated by '\0' when accessed through getenv(). commit 021fd94ed1d692d212e6e30c6c1a9767c3f16f7f Merge: 49963eb ace1f82 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Feb 26 11:26:03 2015 +0300 Merge branch 'master' into assert * master: (59 commits) Improved ASSIGN_DIM handler Don't inline slow path Revert a part committted by mistake Fixed compilation warnings Fixed a bug that header value is not terminated by '\0' when accessed through getenv(). better name Improve fix for #69038 Update NEWs Fixed bug #69108 ("Segmentation fault" when (de)serializing SplObjectStorage) Added specialized versions of DO_FCALL handler: DO_ICALL - for internal functions DO_UCALL - for user functions DO_FCALL_BY_NAME - plain, most probably user, funcstions (not methods) Use cache_slot offsets instead of indexes (simplify run-time instructions) Split INIT_FCALL_BY_NAME inti INIT_FCALL_BY_NAME(CONST+STRING) and INIT_DYNAMIC_CALL(CONST-STRING|TMPVAR|CV) Support list($a, $b) = $a Avoid unnecassary check Make zend_array_destroy() to free the corresponding zend_array Eliminate check on the fast path Make current() and key() receive argument by value. Use Firebird default home folder, replace Interbase with Firebird Updated NEWS updated NEWS ... Conflicts: Zend/zend_vm_execute.h Zend/zend_vm_opcodes.c Zend/zend_vm_opcodes.h commit 49963ebf9d2bcd6d2670203dd72884f6ba6c8a4b Merge: 07b1f92 6b77959 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Feb 19 11:13:08 2015 +0300 Merge branch 'master' into assert * master: Implemented AST pretty-printer update NEWS to match the actual stuff in 5.6.6 update NEWS to match the actual stuff in 5.5.22 update NEWS(add missing entry for the enchant fix, and reorder the entries a bit) fix typo in bug# update NEWS fix email format update NEWS update 5.6.6 release date in NEWS Fix bug #69033 (Request may get env. variables from previous requests if PHP works as FastCGI) BFN fix test fix test fix test Fixed bug #65593 (Segfault when calling ob_start from output buffering callback) Updated NEWS add CVE 5.4.39 next Fix associativity to match Perl Blast off to space. Conflicts: Zend/zend_ast.c commit 07b1f92ed662f6fa9309e679b83aff328362c98b Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Feb 18 23:06:32 2015 +0300 fixed pretty-printer (support for "elseif") commit 5a976c8d85078502b48379996ab066e57533a0c3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Feb 18 19:50:08 2015 +0300 Fixed vaeious ptetty-printer issues commit 69491e8e8e692030b0585aab485146906c0fedaf Merge: 8473157 3ddc246 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Feb 18 10:18:32 2015 +0300 Merge branch 'master' into assert * master: Set PHP_JSON_VERSION to 1.4.0 Remove unnecessary resource checks in openssl ext JSON is now maintained commit 8473157fbb12d03fff8d5b602865a4b667522a4d Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Feb 18 10:17:26 2015 +0300 Fixed typo and white spaces commit 96de5ffc8d604df9797d0141ae5ad9c15e1d6c32 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Feb 18 00:28:39 2015 +0300 Fixed assert() in namesapaces commit 5eba069c28e7b6590618707e0b21cdb2dd62a192 Merge: 4a2d9c0 d428bf2 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Feb 17 22:45:55 2015 +0300 Merge branch 'master' into assert * master: (25 commits) improve debugability in TS debug builds More UPGRADING, in particular on foreach Fixed bug #69038 (switch(SOMECONSTANT) misbehaves) for master Replace var is introduced abstain from using xmlCleanupParser fix TS build Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) update news Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) Port for for bug #68552 Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) Update NEWS Fixed bug #69038 (switch(SOMECONSTANT) misbehaves) - BFN Don't read the local php.ini when Generating Phar When building phar shared, you can end up loading a previous phar.so that isn't compatible with the php cli being used to generate Phar here. - Fixed bug #67827 (broken detection of system crypt sha256/sha512 support) Delete json outdated package.xml made ZEND_TSRMLS_CACHE_* macros look like function calls - Fix merge - Fixed bug #67427 (SoapServer cannot handle large messages) patch by: brandt at docoloc dot de ... commit 4a2d9c0953dccd9e78ebee9291e1213419eb9136 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Feb 17 22:45:10 2015 +0300 Implemented AST pretty-printer to capture expression passed to assert() commit 7a059b66d51a65159801bd826346721325b89fec Merge: 9973df7 3892eba Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Feb 16 18:42:28 2015 +0300 Merge branch 'expect' of github.com:krakjoe/php-src into assert * 'expect' of github.com:krakjoe/php-src: import expect Conflicts: Zend/zend_compile.c Zend/zend_execute_API.c Zend/zend_globals.h Zend/zend_vm_def.h Zend/zend_vm_execute.h Zend/zend_vm_opcodes.c Zend/zend_vm_opcodes.h ext/opcache/Optimizer/block_pass.c ext/opcache/Optimizer/pass1_5.c ext/standard/assert.c ext/standard/tests/assert/assert_error3.phpt commit 3892eba2bf56a7699453855c995404106322718d Author: krakjoe <joe.watkins@live.co.uk> Date: Sun Feb 2 12:49:35 2014 +0000 import expect
2015-03-02 17:25:40 +08:00
if (stage != ZEND_INI_STAGE_STARTUP &&
stage != ZEND_INI_STAGE_SHUTDOWN &&
*p != val &&
(*p < 0 || val < 0)) {
zend_error(E_WARNING, "zend.assertions may be completely enabled or disabled only in php.ini");
return FAILURE;
}
*p = val;
return SUCCESS;
}
/* }}} */
2002-11-20 01:51:30 +08:00
ZEND_INI_BEGIN()
ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting)
2015-10-06 16:13:38 +08:00
STD_ZEND_INI_ENTRY("zend.assertions", "1", ZEND_INI_ALL, OnUpdateAssertions, assertions, zend_executor_globals, executor_globals)
ZEND_INI_ENTRY3_EX("zend.enable_gc", "1", ZEND_INI_ALL, OnUpdateGCEnabled, NULL, NULL, NULL, zend_gc_enabled_displayer_cb)
STD_ZEND_INI_BOOLEAN("zend.multibyte", "0", ZEND_INI_PERDIR, OnUpdateBool, multibyte, zend_compiler_globals, compiler_globals)
ZEND_INI_ENTRY("zend.script_encoding", NULL, ZEND_INI_ALL, OnUpdateScriptEncoding)
STD_ZEND_INI_BOOLEAN("zend.detect_unicode", "1", ZEND_INI_ALL, OnUpdateBool, detect_unicode, zend_compiler_globals, compiler_globals)
2011-06-22 22:23:21 +08:00
#ifdef ZEND_SIGNALS
STD_ZEND_INI_BOOLEAN("zend.signal_check", "0", ZEND_INI_SYSTEM, OnUpdateBool, check, zend_signal_globals_t, zend_signal_globals)
#endif
STD_ZEND_INI_BOOLEAN("zend.exception_ignore_args", "0", ZEND_INI_ALL, OnUpdateBool, exception_ignore_args, zend_executor_globals, executor_globals)
2002-11-20 01:51:30 +08:00
ZEND_INI_END()
ZEND_API size_t zend_vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap) /* {{{ */
{
smart_string buf = {0};
/* since there are places where (v)spprintf called without checking for null,
a bit of defensive coding here */
if (!pbuf) {
return 0;
}
zend_printf_to_smart_string(&buf, format, ap);
if (max_len && buf.len > max_len) {
buf.len = max_len;
}
smart_string_0(&buf);
if (buf.c) {
*pbuf = buf.c;
return buf.len;
} else {
*pbuf = estrndup("", 0);
return 0;
}
}
/* }}} */
ZEND_API size_t zend_spprintf(char **message, size_t max_len, const char *format, ...) /* {{{ */
{
va_list arg;
size_t len;
va_start(arg, format);
len = zend_vspprintf(message, max_len, format, arg);
va_end(arg);
return len;
}
/* }}} */
ZEND_API size_t zend_spprintf_unchecked(char **message, size_t max_len, const char *format, ...) /* {{{ */
{
va_list arg;
size_t len;
va_start(arg, format);
len = zend_vspprintf(message, max_len, format, arg);
va_end(arg);
return len;
}
/* }}} */
ZEND_API zend_string *zend_vstrpprintf(size_t max_len, const char *format, va_list ap) /* {{{ */
{
smart_str buf = {0};
zend_printf_to_smart_str(&buf, format, ap);
if (!buf.s) {
return ZSTR_EMPTY_ALLOC();
}
if (max_len && ZSTR_LEN(buf.s) > max_len) {
ZSTR_LEN(buf.s) = max_len;
}
smart_str_0(&buf);
return buf.s;
}
/* }}} */
ZEND_API zend_string *zend_strpprintf(size_t max_len, const char *format, ...) /* {{{ */
{
va_list arg;
zend_string *str;
va_start(arg, format);
str = zend_vstrpprintf(max_len, format, arg);
va_end(arg);
return str;
}
/* }}} */
ZEND_API zend_string *zend_strpprintf_unchecked(size_t max_len, const char *format, ...) /* {{{ */
{
va_list arg;
zend_string *str;
va_start(arg, format);
str = zend_vstrpprintf(max_len, format, arg);
va_end(arg);
return str;
}
/* }}} */
static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent);
static void print_hash(smart_str *buf, HashTable *ht, int indent, zend_bool is_object) /* {{{ */
1999-04-08 02:10:10 +08:00
{
zval *tmp;
zend_string *string_key;
2014-08-26 01:24:55 +08:00
zend_ulong num_key;
1999-04-08 02:10:10 +08:00
int i;
for (i = 0; i < indent; i++) {
smart_str_appendc(buf, ' ');
1999-04-08 02:10:10 +08:00
}
smart_str_appends(buf, "(\n");
1999-12-22 01:14:31 +08:00
indent += PRINT_ZVAL_INDENT;
ZEND_HASH_FOREACH_KEY_VAL_IND(ht, num_key, string_key, tmp) {
for (i = 0; i < indent; i++) {
smart_str_appendc(buf, ' ');
1999-04-08 02:10:10 +08:00
}
smart_str_appendc(buf, '[');
if (string_key) {
if (is_object) {
const char *prop_name, *class_name;
size_t prop_len;
int mangled = zend_unmangle_property_name_ex(string_key, &class_name, &prop_name, &prop_len);
smart_str_appendl(buf, prop_name, prop_len);
if (class_name && mangled == SUCCESS) {
if (class_name[0] == '*') {
smart_str_appends(buf, ":protected");
} else {
smart_str_appends(buf, ":");
smart_str_appends(buf, class_name);
smart_str_appends(buf, ":private");
}
}
} else {
smart_str_append(buf, string_key);
}
} else {
smart_str_append_long(buf, num_key);
1999-04-08 02:10:10 +08:00
}
smart_str_appends(buf, "] => ");
zend_print_zval_r_to_buf(buf, tmp, indent+PRINT_ZVAL_INDENT);
smart_str_appends(buf, "\n");
} ZEND_HASH_FOREACH_END();
1999-12-22 01:14:31 +08:00
indent -= PRINT_ZVAL_INDENT;
for (i = 0; i < indent; i++) {
smart_str_appendc(buf, ' ');
1999-04-08 02:10:10 +08:00
}
smart_str_appends(buf, ")\n");
1999-04-08 02:10:10 +08:00
}
/* }}} */
1999-04-08 02:10:10 +08:00
2014-12-14 06:06:14 +08:00
static void print_flat_hash(HashTable *ht) /* {{{ */
2002-12-02 03:47:02 +08:00
{
zval *tmp;
zend_string *string_key;
2014-08-26 01:24:55 +08:00
zend_ulong num_key;
int i = 0;
2014-05-26 02:07:29 +08:00
ZEND_HASH_FOREACH_KEY_VAL_IND(ht, num_key, string_key, tmp) {
if (i++ > 0) {
ZEND_PUTS(",");
}
ZEND_PUTS("[");
if (string_key) {
ZEND_WRITE(ZSTR_VAL(string_key), ZSTR_LEN(string_key));
} else {
2014-08-26 02:22:49 +08:00
zend_printf(ZEND_ULONG_FMT, num_key);
}
ZEND_PUTS("] => ");
2014-12-14 06:06:14 +08:00
zend_print_flat_zval_r(tmp);
} ZEND_HASH_FOREACH_END();
2002-12-02 03:47:02 +08:00
}
/* }}} */
2014-12-14 06:06:14 +08:00
ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy) /* {{{ */
1999-04-08 02:10:10 +08:00
{
2014-03-07 13:48:28 +08:00
if (Z_TYPE_P(expr) == IS_STRING) {
return 0;
} else {
2017-11-16 22:09:01 +08:00
ZVAL_STR(expr_copy, zval_get_string_func(expr));
return 1;
}
}
/* }}} */
2014-12-14 06:06:14 +08:00
ZEND_API size_t zend_print_zval(zval *expr, int indent) /* {{{ */
{
zend_string *tmp_str;
zend_string *str = zval_get_tmp_string(expr, &tmp_str);
size_t len = ZSTR_LEN(str);
if (len != 0) {
zend_write(ZSTR_VAL(str), len);
1999-04-08 02:10:10 +08:00
}
zend_tmp_string_release(tmp_str);
return len;
1999-04-08 02:10:10 +08:00
}
/* }}} */
1999-04-08 02:10:10 +08:00
2014-12-14 06:06:14 +08:00
ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
2002-12-02 03:47:02 +08:00
{
switch (Z_TYPE_P(expr)) {
case IS_ARRAY:
ZEND_PUTS("Array (");
if (!(GC_FLAGS(Z_ARRVAL_P(expr)) & GC_IMMUTABLE)) {
if (GC_IS_RECURSIVE(Z_ARRVAL_P(expr))) {
2017-10-06 06:34:50 +08:00
ZEND_PUTS(" *RECURSION*");
return;
}
GC_PROTECT_RECURSION(Z_ARRVAL_P(expr));
}
2014-12-14 06:06:14 +08:00
print_flat_hash(Z_ARRVAL_P(expr));
ZEND_PUTS(")");
if (!(GC_FLAGS(Z_ARRVAL_P(expr)) & GC_IMMUTABLE)) {
GC_UNPROTECT_RECURSION(Z_ARRVAL_P(expr));
}
break;
case IS_OBJECT:
{
HashTable *properties;
2014-12-14 06:06:14 +08:00
zend_string *class_name = Z_OBJ_HANDLER_P(expr, get_class_name)(Z_OBJ_P(expr));
zend_printf("%s Object (", ZSTR_VAL(class_name));
zend_string_release_ex(class_name, 0);
2007-10-11 09:03:19 +08:00
if (GC_IS_RECURSIVE(Z_COUNTED_P(expr))) {
ZEND_PUTS(" *RECURSION*");
return;
}
properties = Z_OBJPROP_P(expr);
2003-01-14 20:13:51 +08:00
if (properties) {
GC_PROTECT_RECURSION(Z_OBJ_P(expr));
2014-12-14 06:06:14 +08:00
print_flat_hash(properties);
GC_UNPROTECT_RECURSION(Z_OBJ_P(expr));
2003-01-12 21:45:50 +08:00
}
ZEND_PUTS(")");
break;
}
case IS_REFERENCE:
zend_print_flat_zval_r(Z_REFVAL_P(expr));
break;
default:
zend_print_zval(expr, 0);
break;
}
2002-12-02 03:47:02 +08:00
}
/* }}} */
1999-04-08 02:10:10 +08:00
static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /* {{{ */
1999-04-08 02:10:10 +08:00
{
switch (Z_TYPE_P(expr)) {
1999-04-08 02:10:10 +08:00
case IS_ARRAY:
smart_str_appends(buf, "Array\n");
if (!(GC_FLAGS(Z_ARRVAL_P(expr)) & GC_IMMUTABLE)) {
if (GC_IS_RECURSIVE(Z_ARRVAL_P(expr))) {
2017-10-06 06:34:50 +08:00
smart_str_appends(buf, " *RECURSION*");
return;
}
GC_PROTECT_RECURSION(Z_ARRVAL_P(expr));
2000-11-03 07:17:55 +08:00
}
print_hash(buf, Z_ARRVAL_P(expr), indent, 0);
if (!(GC_FLAGS(Z_ARRVAL_P(expr)) & GC_IMMUTABLE)) {
GC_UNPROTECT_RECURSION(Z_ARRVAL_P(expr));
}
1999-04-08 02:10:10 +08:00
break;
case IS_OBJECT:
2001-07-29 16:22:57 +08:00
{
2007-10-11 09:03:19 +08:00
HashTable *properties;
2014-12-14 06:06:14 +08:00
zend_string *class_name = Z_OBJ_HANDLER_P(expr, get_class_name)(Z_OBJ_P(expr));
smart_str_appends(buf, ZSTR_VAL(class_name));
zend_string_release_ex(class_name, 0);
smart_str_appends(buf, " Object\n");
if (GC_IS_RECURSIVE(Z_OBJ_P(expr))) {
smart_str_appends(buf, " *RECURSION*");
2007-10-11 09:03:19 +08:00
return;
}
if ((properties = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_DEBUG)) == NULL) {
break;
}
GC_PROTECT_RECURSION(Z_OBJ_P(expr));
print_hash(buf, properties, indent, 1);
GC_UNPROTECT_RECURSION(Z_OBJ_P(expr));
zend_release_properties(properties);
2001-07-29 16:22:57 +08:00
break;
2000-11-03 07:17:55 +08:00
}
case IS_LONG:
smart_str_append_long(buf, Z_LVAL_P(expr));
break;
case IS_REFERENCE:
zend_print_zval_r_to_buf(buf, Z_REFVAL_P(expr), indent);
break;
case IS_STRING:
smart_str_append(buf, Z_STR_P(expr));
break;
1999-04-08 02:10:10 +08:00
default:
{
zend_string *str = zval_get_string_func(expr);
smart_str_append(buf, str);
zend_string_release_ex(str, 0);
}
1999-04-08 02:10:10 +08:00
break;
}
}
/* }}} */
1999-04-08 02:10:10 +08:00
ZEND_API zend_string *zend_print_zval_r_to_str(zval *expr, int indent) /* {{{ */
{
smart_str buf = {0};
zend_print_zval_r_to_buf(&buf, expr, indent);
smart_str_0(&buf);
return buf.s;
}
/* }}} */
ZEND_API void zend_print_zval_r(zval *expr, int indent) /* {{{ */
{
zend_string *str = zend_print_zval_r_to_str(expr, indent);
zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
zend_string_release_ex(str, 0);
}
/* }}} */
static FILE *zend_fopen_wrapper(const char *filename, zend_string **opened_path) /* {{{ */
1999-04-08 02:10:10 +08:00
{
if (opened_path) {
*opened_path = zend_string_init(filename, strlen(filename), 0);
}
return fopen(filename, "rb");
1999-04-08 02:10:10 +08:00
}
/* }}} */
1999-04-08 02:10:10 +08:00
#ifdef ZTS
static zend_bool short_tags_default = 1;
2014-08-26 01:28:33 +08:00
static uint32_t compiler_options_default = ZEND_COMPILE_DEFAULT;
#else
# define short_tags_default 1
# define compiler_options_default ZEND_COMPILE_DEFAULT
#endif
2014-12-14 06:06:14 +08:00
static void zend_set_default_compile_time_values(void) /* {{{ */
{
/* default compile-time values */
CG(short_tags) = short_tags_default;
CG(compiler_options) = compiler_options_default;
CG(rtd_key_counter) = 0;
}
/* }}} */
2015-04-06 04:45:58 +08:00
#ifdef ZEND_WIN32
static void zend_get_windows_version_info(OSVERSIONINFOEX *osvi) /* {{{ */
{
ZeroMemory(osvi, sizeof(OSVERSIONINFOEX));
osvi->dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
if(!GetVersionEx((OSVERSIONINFO *) osvi)) {
ZEND_ASSERT(0); /* Should not happen as sizeof is used. */
}
}
/* }}} */
2015-04-06 04:45:58 +08:00
#endif
2014-12-14 06:06:14 +08:00
static void zend_init_exception_op(void) /* {{{ */
{
memset(EG(exception_op), 0, sizeof(EG(exception_op)));
EG(exception_op)[0].opcode = ZEND_HANDLE_EXCEPTION;
ZEND_VM_SET_OPCODE_HANDLER(EG(exception_op));
EG(exception_op)[1].opcode = ZEND_HANDLE_EXCEPTION;
ZEND_VM_SET_OPCODE_HANDLER(EG(exception_op)+1);
EG(exception_op)[2].opcode = ZEND_HANDLE_EXCEPTION;
ZEND_VM_SET_OPCODE_HANDLER(EG(exception_op)+2);
}
/* }}} */
Squashed commit of the following: commit 2399fc84c541da9c2176c5b7f6dd039a3c84dc64 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 12:38:08 2015 +0300 Removed useless assignment commit 796b6338174348eee0d74a67706d77b7ce1a60c3 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 12:35:31 2015 +0300 Fixed execution with overriden zend_execute_ex() commit 4a9fb125aa999059f8bc42ebb6ee573c7866b35b Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 02:02:58 2015 +0300 Fixed executor without global registers commit d456c30e00589ccda35a4b57ae903ef2d3c07d95 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 01:30:35 2015 +0300 Restored original behavior for tests/classes/__call_004.phpt commit 479646d37fef050536f1afb12b082618f1f1a3d0 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 00:32:17 2015 +0300 Fixed test. We don't keep stack frame for fake function anymore. commit 9ae61e33e24b2c811d4ab1ca4ab22847c64a780e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 00:30:09 2015 +0300 Use ZEND_ACC_CALL_VIA_TRAMPOLINE instead of ZEND_ACC_CALL_VIA_HANDLER. Keep ZEND_ACC_CALL_VIA_HANDLER for compatibility. commit 0a8403a2a0c27aa3db271774f8559739a6b8400e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 00:05:43 2015 +0300 Rename PROXY_CALL into CALL_TRAMPLINE. Generalize API to allow reuse EG(trampline) for other purposes. commit 4ea0525c10554e36185a0b8b6303106813b6a1c2 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 23:22:25 2015 +0300 Reuse EG(proxy_call_op) for all proxy. Move proxy related functions from zend_objects_API to zend_object_handlers. commit 529bf737ca388ad56fb4ae20ccb81e6276f25ec0 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 21:42:23 2015 +0300 Accurate use of proxy_call commit 5d62837d5ba3855743fe1981786ebd65d9da0b63 Merge: 83e749f 690843f Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 19:40:00 2015 +0300 Merge branch 'master' into opcodefy-call * master: Fixed GOTO executor Fixed typo Changed ArrayIterator implementation using zend_hash_iterator_... API. Allowed modification of itterated ArrayObject using the same behavior as proposed in `Fix "foreach" behavior`. Removed "Array was modified outside object and internal position is no longer valid" hack. commit 83e749ff3b6623e39b236a72e9b907d5b788ae5e Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 19:39:10 2015 +0300 Improved ZEND_PROXY_CALL commit 0c829afc534e6d5ff27a0dea3a4815da303bd1ef Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 15:14:49 2015 +0300 Reverted white-space changes commit df65144488afa3e9020d75e1ada5529b138afc5a Merge: 5fd2f97 97756d9 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 14:37:07 2015 +0300 Merge branch 'opcodefy-call' of github.com:laruence/php-src into opcodefy-call * 'opcodefy-call' of github.com:laruence/php-src: Ready for PR Fixed static call Improve performance by using prealloated op_arrray Respect called_scope Support internal magical __call/__callStatic opcode-fy magical __callStatic Opcode-fy magical __call commit 97756d9190e07a072a7b48135304dc25a964845f Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 19:07:59 2015 +0800 Ready for PR commit 74f993084627061e783645a866390b68e2981698 Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 19:03:00 2015 +0800 Fixed static call commit ec1d9eb592db0c3b7b0e3d21e7f445ed8bccfd4d Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 18:23:17 2015 +0800 Improve performance by using prealloated op_arrray commit df7fbbf949c99f2c5ae3da2a1199235651c7cc82 Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 15:10:02 2015 +0800 Respect called_scope commit 769d1d59fb48b6f7f93d7412eefbf26135fa3e59 Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 12:19:23 2015 +0800 Support internal magical __call/__callStatic commit a980fedd5b0e0683713dd4f6eaad62adf4b4732f Author: Xinchen Hui <laruence@gmail.com> Date: Wed Apr 8 18:35:41 2015 +0800 opcode-fy magical __callStatic commit 73855f7d53baa2efc2b8a88314f51c784c81b59d Author: Xinchen Hui <laruence@gmail.com> Date: Wed Apr 8 14:21:55 2015 +0800 Opcode-fy magical __call
2015-04-11 04:01:00 +08:00
static void zend_init_call_trampoline_op(void) /* {{{ */
{
memset(&EG(call_trampoline_op), 0, sizeof(EG(call_trampoline_op)));
EG(call_trampoline_op).opcode = ZEND_CALL_TRAMPOLINE;
ZEND_VM_SET_OPCODE_HANDLER(&EG(call_trampoline_op));
}
/* }}} */
static void auto_global_dtor(zval *zv) /* {{{ */
{
free(Z_PTR_P(zv));
}
/* }}} */
#ifdef ZTS
static void function_copy_ctor(zval *zv) /* {{{ */
{
zend_function *old_func = Z_FUNC_P(zv);
Implemented preloading RFC: https://wiki.php.net/rfc/preload. Squashed commit of the following: commit 106c815fffb8eb3efe00a27a5229cb1f8ffc9736 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:36:44 2018 +0300 Added NEWS entry commit 1dacd5e20b7043368ef9e80db296d1781134b6fd Merge: d516139abf ba99aa133c Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:33:37 2018 +0300 Merge branch 'master' into preload * master: Fixed issues related to optimization and persitence of classes linked with interfaces, traits or internal classes. Added possiblity to avoid signal handlers reinitialization on each request. commit d516139abf5ffbd495ee6037f1dc04a1cfe588a7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:13:15 2018 +0300 Override opcache.preload for testing commit 162b154d0bbfbaf8ef93975f7e56a1353236903d Merge: 45fdd034ce 8bda22592e Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 15:38:09 2018 +0300 Merge branch 'master' into preload * master: (34 commits) Eliminate useless $this related check Eliminate useless $this related checks Replace zend_parse_method_parameters() by zend_parse_parameters() and avoid useless checks. Replace getThis() by EX(This), when additional check is not necessary. Fixed tests Validate length on socket_write Fix compilation on x32 Fix #77141: Signedness issue in SOAP when precision=-1 Support SQLite3 @name notation Remove lexer files generated by RE2C Update libmagic.patch [ci skip] Update libmagic.patch [ci skip] Fork test with pcre.jit=0 Rework magic data Fix regex Fix regex Rework magic data Sync one more upstream libmagic piece Suppress already used warning Ignore getaddrinfo failed message ... commit 45fdd034ceceb68e8fb23bd6e70d627f17dfd411 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 9 13:07:03 2018 +0300 Properly resolve magic method of preloaded classes inherited from internal ones. commit 34645aeb4272b71a81a7e0d91f27eded557b78be Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 8 15:29:17 2018 +0300 Don't preload constants defined during preload script excution. commit cef0d67c3e5aac89b3d606fbd8d445225c07c83f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 7 15:56:54 2018 +0300 Support for class aliasses commit 08ffc9a552c7cf4fbff1a4b3d2de4e7c33f4120d Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 7 15:34:39 2018 +0300 Resolve constants only in linked classes commit 8d3429cda83c87646eef0006d5cda075f2400b24 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Nov 6 11:56:39 2018 +0300 Fixed preloading of references to internal classes. commit 7ae3a47d20e83f7d804506c6d50f6a392199260b Merge: 9b0a53ed1c 049f239cfc Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Nov 6 11:37:15 2018 +0300 Merge branch 'master' into preload * master: Update NEWS [ci skip] Update NEWS [ci skip] Update libmagic.patch [ci skip] Update libmagic.patch [ci skip] Declare function proto in header Declare function proto in header Fix #76825: Undefined symbols ___cpuid_count NEWS Fix: #77110 undefined symbol zend_string_equal_val in C++ build Fix #77105: Use position:sticky for <th> in `phpinfo()` Implement handling for JIT recognition when cross compiling Backport 7f5f4601 for 7.2 Fix #76348: WSDL_CACHE_MEMORY causes Segmentation fault Rework places in libmagic regarding previous CVE-2014-3538 fixes Change the way JIT availability is checked Fix a test for ldap extension Fixed bug #77092 Future-proof email addresses commit 9b0a53ed1cd5995efae0d71e1941d1db4ef6ba39 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 14:54:44 2018 +0300 We don't need preload_restart() here commit 0bd17bd43890423e1e98a5925f11cea93da3df55 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 14:44:30 2018 +0300 EG(*) may be not initializd at this point - use CG(*). commit b610467051d8a3687a60ffc2957bc353cb6b3bd4 Merge: 3a9d90f74a 67e0138c0d Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 11:33:37 2018 +0300 Merge branch 'master' into preload * master: Future-proof email addresses... Update email addresses. We're still @Zend, but future proofing it... commit 3a9d90f74a3d890cb59658d604d5a202e3aee256 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 15:19:48 2018 +0300 Fexed resolution of method clones commit aea85c65bd1795d0750dee6ac0e476acd2ac9dd7 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 11:45:50 2018 +0300 Prevent inlining of method copied from trait commit 36b644fbb738e7548ccb436e5d04d653d93cce14 Merge: 7a20781d2e b91690c892 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 10:56:02 2018 +0300 Merge branch 'master' into preload * master: Fix stray newline that caused this test to fail Fix session tests that fail if error_log is set This test needs to log to stdout Fix error condition Fixed bug #77081 ftruncate() changes seek pointer in c mode Fix and improve test case commit 7a20781d2ee694262f913a612d8b0b6a24ceff7b Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 31 00:52:46 2018 +0300 Added test commit 4a57b5d563f9c9616f3c236f57ccd09d8a66f146 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 31 00:50:21 2018 +0300 Fixed preloading of classes linked with traits commit 68c4f99e23695e74eafa43097ecab62392bad3ee Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 16:25:14 2018 +0300 Added test commit 38ab7ef4cf429dcfd5dfb18f844242cdf3a4d61f Merge: eb6e2c529f bf38e6c10a Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 16:14:39 2018 +0300 Merge branch 'master' into preload * master: Keep original value of "prototype" commit eb6e2c529f8cedf6823346387dd8b0ba6a4f045b Merge: 562049510f 2fefa8c61e Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 15:35:39 2018 +0300 Merge branch 'master' into preload * master: Call function_add_ref() in proper place Updated to version 2018.7 (2018g) Updated to version 2018.7 (2018g) Updated to version 2018.7 (2018g) Reslove inherited op_array references once afrer all optimizations. commit 562049510f605c21cd46fc3b6f97ed15bfe7b0dc Merge: e806cb732a 4828fb7b6b Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 10:29:49 2018 +0300 Merge branch 'master' into preload * master: [ci skip] Update NEWS [ci skip] Update NEWS [ci skip] Update NEWS fix bug #77079 Add missing null initialization Remove redundant mbfl_string_init calls Use zend_string for mbstring last encoding cache commit e806cb732a2a3f1e409528988a0571421c541078 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 22:32:15 2018 +0300 Fixed double-free commit 2f697ef8af0e7b21c47707b2d688880e8c987a8b Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 22:07:32 2018 +0300 typo commit c559f22b3e61b38761831d9610889d28ba6875e0 Merge: 310631cc05 ea2e67876a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 21:59:27 2018 +0300 Merge branch 'master' into preload * master: Stop Apache if PHP wasn't started successful. Execute zend_post_startup() with module_initialized flag set. Removed dead code Fix mb_strrpos() with encoding passed as 3rd param commit 310631cc0565ac87091c4f1a8a9f739a13e7e778 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 16:48:42 2018 +0300 Stop Apache if PHP wasn't started successful. commit 0a24d7ba8f3280507c9663b32e14030212cf8491 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 16:25:49 2018 +0300 Avoid use-after-free in main thread commit 17a3cb4a2ab271c2b2357c04e36efa64e02444ff Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 15:25:17 2018 +0300 Execute zend_post_startup() with module_initialized flag set. commit 6d4b22c518bec956e9632fad4329360304d17fd7 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 14:12:20 2018 +0300 Override SAPI.ub_write and SAPI.flush for preloading commit 386c9d3470168f70afe5d3b72a58ea0c0da1519c Merge: d7fbb4d402 359f19edc9 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 13:49:24 2018 +0300 Merge branch 'master' into preload * master: Optimize substr() edge-case conditions [ci skip] Update UPGRADING Fix #71592: External entity processing never fails Add TIDY_TAG_* constants supported by libtidy 5 Add is_iterable to opcache Optimizer commit d7fbb4d402a18c8fd1c49e0c92afd9f9e513bc7a Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 13:11:54 2018 +0300 Restore preload state if it was already loaded in another process. commit 0fe9ea1c07822b5d4672cece2c180bf9795e16e4 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 12:29:06 2018 +0300 Removed dead code commit 3a2d1bcc1fd27b6983522c262931fc0187c0afef Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 00:19:40 2018 +0300 Support for builds without ZEND_SIGNALS commit e6b76ecb4beea3b922bf7529050e3828f745dedb Merge: 4531fbf931 68694c9997 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 23:43:25 2018 +0300 Merge branch 'master' into preload * master: Don't wrap php_module_shutdown() with zend_try. executor_globals are released in ZTS build, and this leads to crash. [ci skip] Fix indentation in UPGRADING. commit 4531fbf9310bfb7bb579134cc84e8c10c5d42059 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 22:44:49 2018 +0300 Disable linking and preloading of classes those parent or one of interface or trait is an internal class. commit a594a618ce98242c1d273eb9ede75b4f6b4635d8 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 22:30:51 2018 +0300 Cleanup - remove useless ZCSG(saved_map_ptr_last) - move preloaded classes/functions clean-up code back into better place commit ab9a40f63cfa1a205b8f853b7e0c2ce61edabb32 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 20:52:51 2018 +0300 Added support for preloaded classes/functions in ZTS build commit e3c65db099517082b66dd20ea57e1bda649a7aa5 Merge: 4f57c1e029 33e777acbf Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 20:52:26 2018 +0300 Merge branch 'master' into preload * master: Improved shared interned strings handling. The previous implementation worked incorrectly in ZTS build. It changed strings only in function/class tables of one thread. Now all threads gets the same shared interned strings. Also, on shutdown, we don't try to replace SHM interned strings back to process strings, but delay dettachment of SHM instead. Don't use request heap at shutdown Don't optimize function if inference failed Fixed bug #77058 Improve "narrowing" error message bump versions commit 4f57c1e029ce9c24bd699ea61b05973c4665bc32 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 15:29:58 2018 +0300 Cleanup (move preload_shutdown() call to better place) commit 26587a95c071cf9dd098199eb3708fca8adae243 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 14:30:51 2018 +0300 eol commit d70cb10480fdc7d814495150cd48e43d4147138f Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 14:30:20 2018 +0300 cleanup commit aabe685dbb887e91c240b6c5553193889bcfc540 Merge: d9fc51bc3b 40808ac41e Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 12:42:51 2018 +0300 Merge branch 'master' into preload * master: Remove unused var Remove ext/json parser files generated by bison Fix run-tests.php for running phpdbg and certain test sections Normalize .gitignore commit d9fc51bc3bdfbd7f4149a884b09e3c09a41f7a8d Merge: b5ffba0faf b6ef8998d5 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 15:59:24 2018 +0300 Merge branch 'master' into preload * master: Fixed reseting of interned strings buffer. commit b5ffba0fafb4d940336d5f5fe93950dad1d8d779 Merge: e4a7ef0c43 a404383118 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 12:46:28 2018 +0300 Merge branch 'master' into preload * master: Fixed build in directory different from source commit e4a7ef0c431ec97cdd00e44dfa0ef17887d1e5e3 Merge: 811f20aaa5 d1e14e2cc0 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 11:59:43 2018 +0300 Merge branch 'master' into preload * master: (29 commits) Make php_plain_files_wrapper to be writable (workaround for swoole) Remove phpdbg parser files generated by bison Fix conflicts in phpdbg parser Refetetch function name on exceptional path to allow better code on fast code path. fix typo in sysvsem.c Fixed bug #50675 bump to 7.2.13-dev [ci skip] Update NEWS wrt. php-7.3.0RC4 tagging Inlining in the most frequently used code paths Fixed test failurs introduced by 9c144e0d8217d1ef7a83c2498214308b21af749f Use persistent strings only for persistent connections Fix accessibility checks for dynamic properties Updated to version 2018.6 (2018f) Updated to version 2018.6 (2018f) Updated to version 2018.6 (2018f) Fix arginfo and clean up fpm_get_status Defragment two Zend related Makefile fragments together [ci skip] Remove automake and aclocal in comments Fix #75282: xmlrpc_encode_request() crashes Fix tests for ICU 63.1 ... commit 811f20aaa5030035666d9f325dd7c64632c70a50 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 22 14:10:49 2018 +0300 Added information about preloading to opcache_get_status() commit 093e8b1bbffdc07d217a543613ea14c3eeac710e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:46:23 2018 +0300 Added warning message commit a2ba970ce3d0ac51ebfbe1bfc2dc7b99b9750a75 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:35:40 2018 +0300 Added test commit b67e28367c11db50360e664a7ad6ac95b393f2e4 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:33:12 2018 +0300 Don't preload functions declared at run-time. commit b0139dc22854ee000586ef83c149d7d25181da60 Merge: a609520adb 3fe698b904 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:23:14 2018 +0300 Merge branch 'master' into preload * master: Mark "top-level" functions. Don't initialize static_member_tables during start-up, when inherit internal classes. [ci skip] Update NEWS [ci skip] Update NEWS [ci skip] Update NEWS Fix #77035: The phpize and ./configure create redundant .deps file Remove outdated PEAR artefacts Fix tests/output/bug74815.phpt generating errors.log Revert "Use C++ symbols, when C++11 or upper is compiled" Use C++ symbols, when C++11 or upper is compiled Added new line Remove stamp-h Move all testing docs to qa.php.net Fix a typo in UPGRADING.INTERNALS Fix test when it's run on another drive [ci skip] Update UPGRADING wrt. tidyp support Fixed incorrect reallocation Fix #77027: tidy::getOptDoc() not available on Windows Run CI tests under opcache.protect_memory=1 commit a609520adbc0bf12701d467bae4a016fde43231e Merge: ac8f45f61b b6ac50f9e6 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 17:01:05 2018 +0300 Merge branch 'master' into preload * master: Fixed comment Micro optimizations Mark "top-level" classes commit ac8f45f61b561af9aee629232bc3705143ceaac3 Merge: 632b30b545 d57cd36e47 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 15:53:41 2018 +0300 Merge branch 'master' into preload * master: Immutable clases and op_arrays. commit 632b30b5451c8fdf0879a3ba4d937ff4ecfc8ce7 Merge: d33908a99a cd0c36c3f9 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 15:04:43 2018 +0300 Merge branch 'immutable' into preload * immutable: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit d33908a99a3c746f188e268df3db541591f6fcc2 Merge: 21e0bebca3 4740dabb84 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:14:23 2018 +0300 Merge branch 'immutable' into preload * immutable: Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit 21e0bebca3e6fff3c3484ee46f9aa3ac4e98eaeb Merge: c78277ae84 ad7a78b253 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 12:29:59 2018 +0300 Merge branch 'immutable' into preload * immutable: Added comment Added type cast Moved static class members initialization into the proper place. Removed redundand assertion Removed duplicate code Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. typo Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit c78277ae84b21067744d1701949e4e1fadd8872a Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 16 17:25:35 2018 +0300 Preloadsing support for opcache restart commit f76a955c02f6a033d4656d5e0d9dad9a8e83cc86 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 16 13:52:36 2018 +0300 Fixed incorrect signal handlers overriding commit 0810ce0d8165d4b752267f035f9fa0aaa1698ceb Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:38:48 2018 +0300 An attempt to implemnt "preloading" ability. commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-11-14 21:46:05 +08:00
zend_function *func;
Implemented preloading RFC: https://wiki.php.net/rfc/preload. Squashed commit of the following: commit 106c815fffb8eb3efe00a27a5229cb1f8ffc9736 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:36:44 2018 +0300 Added NEWS entry commit 1dacd5e20b7043368ef9e80db296d1781134b6fd Merge: d516139abf ba99aa133c Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:33:37 2018 +0300 Merge branch 'master' into preload * master: Fixed issues related to optimization and persitence of classes linked with interfaces, traits or internal classes. Added possiblity to avoid signal handlers reinitialization on each request. commit d516139abf5ffbd495ee6037f1dc04a1cfe588a7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:13:15 2018 +0300 Override opcache.preload for testing commit 162b154d0bbfbaf8ef93975f7e56a1353236903d Merge: 45fdd034ce 8bda22592e Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 15:38:09 2018 +0300 Merge branch 'master' into preload * master: (34 commits) Eliminate useless $this related check Eliminate useless $this related checks Replace zend_parse_method_parameters() by zend_parse_parameters() and avoid useless checks. Replace getThis() by EX(This), when additional check is not necessary. Fixed tests Validate length on socket_write Fix compilation on x32 Fix #77141: Signedness issue in SOAP when precision=-1 Support SQLite3 @name notation Remove lexer files generated by RE2C Update libmagic.patch [ci skip] Update libmagic.patch [ci skip] Fork test with pcre.jit=0 Rework magic data Fix regex Fix regex Rework magic data Sync one more upstream libmagic piece Suppress already used warning Ignore getaddrinfo failed message ... commit 45fdd034ceceb68e8fb23bd6e70d627f17dfd411 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 9 13:07:03 2018 +0300 Properly resolve magic method of preloaded classes inherited from internal ones. commit 34645aeb4272b71a81a7e0d91f27eded557b78be Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 8 15:29:17 2018 +0300 Don't preload constants defined during preload script excution. commit cef0d67c3e5aac89b3d606fbd8d445225c07c83f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 7 15:56:54 2018 +0300 Support for class aliasses commit 08ffc9a552c7cf4fbff1a4b3d2de4e7c33f4120d Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 7 15:34:39 2018 +0300 Resolve constants only in linked classes commit 8d3429cda83c87646eef0006d5cda075f2400b24 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Nov 6 11:56:39 2018 +0300 Fixed preloading of references to internal classes. commit 7ae3a47d20e83f7d804506c6d50f6a392199260b Merge: 9b0a53ed1c 049f239cfc Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Nov 6 11:37:15 2018 +0300 Merge branch 'master' into preload * master: Update NEWS [ci skip] Update NEWS [ci skip] Update libmagic.patch [ci skip] Update libmagic.patch [ci skip] Declare function proto in header Declare function proto in header Fix #76825: Undefined symbols ___cpuid_count NEWS Fix: #77110 undefined symbol zend_string_equal_val in C++ build Fix #77105: Use position:sticky for <th> in `phpinfo()` Implement handling for JIT recognition when cross compiling Backport 7f5f4601 for 7.2 Fix #76348: WSDL_CACHE_MEMORY causes Segmentation fault Rework places in libmagic regarding previous CVE-2014-3538 fixes Change the way JIT availability is checked Fix a test for ldap extension Fixed bug #77092 Future-proof email addresses commit 9b0a53ed1cd5995efae0d71e1941d1db4ef6ba39 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 14:54:44 2018 +0300 We don't need preload_restart() here commit 0bd17bd43890423e1e98a5925f11cea93da3df55 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 14:44:30 2018 +0300 EG(*) may be not initializd at this point - use CG(*). commit b610467051d8a3687a60ffc2957bc353cb6b3bd4 Merge: 3a9d90f74a 67e0138c0d Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 11:33:37 2018 +0300 Merge branch 'master' into preload * master: Future-proof email addresses... Update email addresses. We're still @Zend, but future proofing it... commit 3a9d90f74a3d890cb59658d604d5a202e3aee256 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 15:19:48 2018 +0300 Fexed resolution of method clones commit aea85c65bd1795d0750dee6ac0e476acd2ac9dd7 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 11:45:50 2018 +0300 Prevent inlining of method copied from trait commit 36b644fbb738e7548ccb436e5d04d653d93cce14 Merge: 7a20781d2e b91690c892 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 10:56:02 2018 +0300 Merge branch 'master' into preload * master: Fix stray newline that caused this test to fail Fix session tests that fail if error_log is set This test needs to log to stdout Fix error condition Fixed bug #77081 ftruncate() changes seek pointer in c mode Fix and improve test case commit 7a20781d2ee694262f913a612d8b0b6a24ceff7b Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 31 00:52:46 2018 +0300 Added test commit 4a57b5d563f9c9616f3c236f57ccd09d8a66f146 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 31 00:50:21 2018 +0300 Fixed preloading of classes linked with traits commit 68c4f99e23695e74eafa43097ecab62392bad3ee Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 16:25:14 2018 +0300 Added test commit 38ab7ef4cf429dcfd5dfb18f844242cdf3a4d61f Merge: eb6e2c529f bf38e6c10a Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 16:14:39 2018 +0300 Merge branch 'master' into preload * master: Keep original value of "prototype" commit eb6e2c529f8cedf6823346387dd8b0ba6a4f045b Merge: 562049510f 2fefa8c61e Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 15:35:39 2018 +0300 Merge branch 'master' into preload * master: Call function_add_ref() in proper place Updated to version 2018.7 (2018g) Updated to version 2018.7 (2018g) Updated to version 2018.7 (2018g) Reslove inherited op_array references once afrer all optimizations. commit 562049510f605c21cd46fc3b6f97ed15bfe7b0dc Merge: e806cb732a 4828fb7b6b Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 10:29:49 2018 +0300 Merge branch 'master' into preload * master: [ci skip] Update NEWS [ci skip] Update NEWS [ci skip] Update NEWS fix bug #77079 Add missing null initialization Remove redundant mbfl_string_init calls Use zend_string for mbstring last encoding cache commit e806cb732a2a3f1e409528988a0571421c541078 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 22:32:15 2018 +0300 Fixed double-free commit 2f697ef8af0e7b21c47707b2d688880e8c987a8b Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 22:07:32 2018 +0300 typo commit c559f22b3e61b38761831d9610889d28ba6875e0 Merge: 310631cc05 ea2e67876a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 21:59:27 2018 +0300 Merge branch 'master' into preload * master: Stop Apache if PHP wasn't started successful. Execute zend_post_startup() with module_initialized flag set. Removed dead code Fix mb_strrpos() with encoding passed as 3rd param commit 310631cc0565ac87091c4f1a8a9f739a13e7e778 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 16:48:42 2018 +0300 Stop Apache if PHP wasn't started successful. commit 0a24d7ba8f3280507c9663b32e14030212cf8491 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 16:25:49 2018 +0300 Avoid use-after-free in main thread commit 17a3cb4a2ab271c2b2357c04e36efa64e02444ff Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 15:25:17 2018 +0300 Execute zend_post_startup() with module_initialized flag set. commit 6d4b22c518bec956e9632fad4329360304d17fd7 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 14:12:20 2018 +0300 Override SAPI.ub_write and SAPI.flush for preloading commit 386c9d3470168f70afe5d3b72a58ea0c0da1519c Merge: d7fbb4d402 359f19edc9 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 13:49:24 2018 +0300 Merge branch 'master' into preload * master: Optimize substr() edge-case conditions [ci skip] Update UPGRADING Fix #71592: External entity processing never fails Add TIDY_TAG_* constants supported by libtidy 5 Add is_iterable to opcache Optimizer commit d7fbb4d402a18c8fd1c49e0c92afd9f9e513bc7a Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 13:11:54 2018 +0300 Restore preload state if it was already loaded in another process. commit 0fe9ea1c07822b5d4672cece2c180bf9795e16e4 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 12:29:06 2018 +0300 Removed dead code commit 3a2d1bcc1fd27b6983522c262931fc0187c0afef Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 00:19:40 2018 +0300 Support for builds without ZEND_SIGNALS commit e6b76ecb4beea3b922bf7529050e3828f745dedb Merge: 4531fbf931 68694c9997 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 23:43:25 2018 +0300 Merge branch 'master' into preload * master: Don't wrap php_module_shutdown() with zend_try. executor_globals are released in ZTS build, and this leads to crash. [ci skip] Fix indentation in UPGRADING. commit 4531fbf9310bfb7bb579134cc84e8c10c5d42059 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 22:44:49 2018 +0300 Disable linking and preloading of classes those parent or one of interface or trait is an internal class. commit a594a618ce98242c1d273eb9ede75b4f6b4635d8 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 22:30:51 2018 +0300 Cleanup - remove useless ZCSG(saved_map_ptr_last) - move preloaded classes/functions clean-up code back into better place commit ab9a40f63cfa1a205b8f853b7e0c2ce61edabb32 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 20:52:51 2018 +0300 Added support for preloaded classes/functions in ZTS build commit e3c65db099517082b66dd20ea57e1bda649a7aa5 Merge: 4f57c1e029 33e777acbf Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 20:52:26 2018 +0300 Merge branch 'master' into preload * master: Improved shared interned strings handling. The previous implementation worked incorrectly in ZTS build. It changed strings only in function/class tables of one thread. Now all threads gets the same shared interned strings. Also, on shutdown, we don't try to replace SHM interned strings back to process strings, but delay dettachment of SHM instead. Don't use request heap at shutdown Don't optimize function if inference failed Fixed bug #77058 Improve "narrowing" error message bump versions commit 4f57c1e029ce9c24bd699ea61b05973c4665bc32 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 15:29:58 2018 +0300 Cleanup (move preload_shutdown() call to better place) commit 26587a95c071cf9dd098199eb3708fca8adae243 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 14:30:51 2018 +0300 eol commit d70cb10480fdc7d814495150cd48e43d4147138f Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 14:30:20 2018 +0300 cleanup commit aabe685dbb887e91c240b6c5553193889bcfc540 Merge: d9fc51bc3b 40808ac41e Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 12:42:51 2018 +0300 Merge branch 'master' into preload * master: Remove unused var Remove ext/json parser files generated by bison Fix run-tests.php for running phpdbg and certain test sections Normalize .gitignore commit d9fc51bc3bdfbd7f4149a884b09e3c09a41f7a8d Merge: b5ffba0faf b6ef8998d5 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 15:59:24 2018 +0300 Merge branch 'master' into preload * master: Fixed reseting of interned strings buffer. commit b5ffba0fafb4d940336d5f5fe93950dad1d8d779 Merge: e4a7ef0c43 a404383118 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 12:46:28 2018 +0300 Merge branch 'master' into preload * master: Fixed build in directory different from source commit e4a7ef0c431ec97cdd00e44dfa0ef17887d1e5e3 Merge: 811f20aaa5 d1e14e2cc0 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 11:59:43 2018 +0300 Merge branch 'master' into preload * master: (29 commits) Make php_plain_files_wrapper to be writable (workaround for swoole) Remove phpdbg parser files generated by bison Fix conflicts in phpdbg parser Refetetch function name on exceptional path to allow better code on fast code path. fix typo in sysvsem.c Fixed bug #50675 bump to 7.2.13-dev [ci skip] Update NEWS wrt. php-7.3.0RC4 tagging Inlining in the most frequently used code paths Fixed test failurs introduced by 9c144e0d8217d1ef7a83c2498214308b21af749f Use persistent strings only for persistent connections Fix accessibility checks for dynamic properties Updated to version 2018.6 (2018f) Updated to version 2018.6 (2018f) Updated to version 2018.6 (2018f) Fix arginfo and clean up fpm_get_status Defragment two Zend related Makefile fragments together [ci skip] Remove automake and aclocal in comments Fix #75282: xmlrpc_encode_request() crashes Fix tests for ICU 63.1 ... commit 811f20aaa5030035666d9f325dd7c64632c70a50 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 22 14:10:49 2018 +0300 Added information about preloading to opcache_get_status() commit 093e8b1bbffdc07d217a543613ea14c3eeac710e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:46:23 2018 +0300 Added warning message commit a2ba970ce3d0ac51ebfbe1bfc2dc7b99b9750a75 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:35:40 2018 +0300 Added test commit b67e28367c11db50360e664a7ad6ac95b393f2e4 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:33:12 2018 +0300 Don't preload functions declared at run-time. commit b0139dc22854ee000586ef83c149d7d25181da60 Merge: a609520adb 3fe698b904 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:23:14 2018 +0300 Merge branch 'master' into preload * master: Mark "top-level" functions. Don't initialize static_member_tables during start-up, when inherit internal classes. [ci skip] Update NEWS [ci skip] Update NEWS [ci skip] Update NEWS Fix #77035: The phpize and ./configure create redundant .deps file Remove outdated PEAR artefacts Fix tests/output/bug74815.phpt generating errors.log Revert "Use C++ symbols, when C++11 or upper is compiled" Use C++ symbols, when C++11 or upper is compiled Added new line Remove stamp-h Move all testing docs to qa.php.net Fix a typo in UPGRADING.INTERNALS Fix test when it's run on another drive [ci skip] Update UPGRADING wrt. tidyp support Fixed incorrect reallocation Fix #77027: tidy::getOptDoc() not available on Windows Run CI tests under opcache.protect_memory=1 commit a609520adbc0bf12701d467bae4a016fde43231e Merge: ac8f45f61b b6ac50f9e6 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 17:01:05 2018 +0300 Merge branch 'master' into preload * master: Fixed comment Micro optimizations Mark "top-level" classes commit ac8f45f61b561af9aee629232bc3705143ceaac3 Merge: 632b30b545 d57cd36e47 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 15:53:41 2018 +0300 Merge branch 'master' into preload * master: Immutable clases and op_arrays. commit 632b30b5451c8fdf0879a3ba4d937ff4ecfc8ce7 Merge: d33908a99a cd0c36c3f9 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 15:04:43 2018 +0300 Merge branch 'immutable' into preload * immutable: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit d33908a99a3c746f188e268df3db541591f6fcc2 Merge: 21e0bebca3 4740dabb84 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:14:23 2018 +0300 Merge branch 'immutable' into preload * immutable: Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit 21e0bebca3e6fff3c3484ee46f9aa3ac4e98eaeb Merge: c78277ae84 ad7a78b253 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 12:29:59 2018 +0300 Merge branch 'immutable' into preload * immutable: Added comment Added type cast Moved static class members initialization into the proper place. Removed redundand assertion Removed duplicate code Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. typo Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit c78277ae84b21067744d1701949e4e1fadd8872a Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 16 17:25:35 2018 +0300 Preloadsing support for opcache restart commit f76a955c02f6a033d4656d5e0d9dad9a8e83cc86 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 16 13:52:36 2018 +0300 Fixed incorrect signal handlers overriding commit 0810ce0d8165d4b752267f035f9fa0aaa1698ceb Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:38:48 2018 +0300 An attempt to implemnt "preloading" ability. commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-11-14 21:46:05 +08:00
if (old_func->type == ZEND_USER_FUNCTION) {
ZEND_ASSERT(old_func->op_array.fn_flags & ZEND_ACC_IMMUTABLE);
return;
}
func = pemalloc(sizeof(zend_internal_function), 1);
Z_FUNC_P(zv) = func;
memcpy(func, old_func, sizeof(zend_internal_function));
function_add_ref(func);
if ((old_func->common.fn_flags & (ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_HAS_TYPE_HINTS))
&& old_func->common.arg_info) {
uint32_t i;
uint32_t num_args = old_func->common.num_args + 1;
zend_arg_info *arg_info = old_func->common.arg_info - 1;
zend_arg_info *new_arg_info;
if (old_func->common.fn_flags & ZEND_ACC_VARIADIC) {
num_args++;
}
new_arg_info = pemalloc(sizeof(zend_arg_info) * num_args, 1);
memcpy(new_arg_info, arg_info, sizeof(zend_arg_info) * num_args);
for (i = 0 ; i < num_args; i++) {
if (ZEND_TYPE_HAS_LIST(arg_info[i].type)) {
zend_type_list *old_list = ZEND_TYPE_LIST(arg_info[i].type);
zend_type_list *new_list = pemalloc(ZEND_TYPE_LIST_SIZE(old_list->num_types), 1);
memcpy(new_list, old_list, ZEND_TYPE_LIST_SIZE(old_list->num_types));
ZEND_TYPE_SET_PTR(new_arg_info[i].type, new_list);
zend_type *list_type;
ZEND_TYPE_LIST_FOREACH(new_list, list_type) {
zend_string *name = zend_string_dup(ZEND_TYPE_NAME(*list_type), 1);
ZEND_TYPE_SET_PTR(*list_type, name);
} ZEND_TYPE_LIST_FOREACH_END();
} else if (ZEND_TYPE_HAS_NAME(arg_info[i].type)) {
zend_string *name = zend_string_dup(ZEND_TYPE_NAME(arg_info[i].type), 1);
ZEND_TYPE_SET_PTR(new_arg_info[i].type, name);
}
}
func->common.arg_info = new_arg_info + 1;
}
}
/* }}} */
static void auto_global_copy_ctor(zval *zv) /* {{{ */
{
zend_auto_global *old_ag = (zend_auto_global *) Z_PTR_P(zv);
zend_auto_global *new_ag = pemalloc(sizeof(zend_auto_global), 1);
new_ag->name = old_ag->name;
new_ag->auto_global_callback = old_ag->auto_global_callback;
new_ag->jit = old_ag->jit;
Z_PTR_P(zv) = new_ag;
}
/* }}} */
2014-12-14 06:06:14 +08:00
static void compiler_globals_ctor(zend_compiler_globals *compiler_globals) /* {{{ */
{
compiler_globals->compiled_filename = NULL;
2003-06-02 20:13:11 +08:00
compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->function_table, 1024, NULL, ZEND_FUNCTION_DTOR, 1, 0);
zend_hash_copy(compiler_globals->function_table, global_function_table, function_copy_ctor);
compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->class_table, 64, NULL, ZEND_CLASS_DTOR, 1, 0);
zend_hash_copy(compiler_globals->class_table, global_class_table, zend_class_add_ref);
1999-12-27 19:22:57 +08:00
2014-12-14 06:06:14 +08:00
zend_set_default_compile_time_values();
compiler_globals->auto_globals = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->auto_globals, 8, NULL, auto_global_dtor, 1, 0);
zend_hash_copy(compiler_globals->auto_globals, global_auto_globals_table, auto_global_copy_ctor);
compiler_globals->script_encoding_list = NULL;
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
#if ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR_OR_OFFSET
/* Map region is going to be created and resized at run-time. */
2020-01-13 19:27:35 +08:00
ZEND_MAP_PTR_SET_REAL_BASE(compiler_globals->map_ptr_base, NULL);
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
compiler_globals->map_ptr_size = 0;
compiler_globals->map_ptr_last = global_map_ptr_last;
if (compiler_globals->map_ptr_last) {
/* Allocate map_ptr table */
2020-01-13 20:12:55 +08:00
void *base;
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
compiler_globals->map_ptr_size = ZEND_MM_ALIGNED_SIZE_EX(compiler_globals->map_ptr_last, 4096);
2020-01-13 19:27:35 +08:00
base = pemalloc(compiler_globals->map_ptr_size * sizeof(void*), 1);
2020-01-13 20:12:55 +08:00
ZEND_MAP_PTR_SET_REAL_BASE(compiler_globals->map_ptr_base, base);
2020-01-13 19:27:35 +08:00
memset(base, 0, compiler_globals->map_ptr_last * sizeof(void*));
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
}
#else
# error "Unknown ZEND_MAP_PTR_KIND"
#endif
}
/* }}} */
2014-12-14 06:06:14 +08:00
static void compiler_globals_dtor(zend_compiler_globals *compiler_globals) /* {{{ */
{
if (compiler_globals->function_table != GLOBAL_FUNCTION_TABLE) {
zend_hash_destroy(compiler_globals->function_table);
2003-12-12 18:50:23 +08:00
free(compiler_globals->function_table);
}
if (compiler_globals->class_table != GLOBAL_CLASS_TABLE) {
zend_hash_destroy(compiler_globals->class_table);
2003-12-12 18:50:23 +08:00
free(compiler_globals->class_table);
}
2003-12-12 18:50:23 +08:00
if (compiler_globals->auto_globals != GLOBAL_AUTO_GLOBALS_TABLE) {
zend_hash_destroy(compiler_globals->auto_globals);
free(compiler_globals->auto_globals);
}
if (compiler_globals->script_encoding_list) {
2014-08-15 03:53:27 +08:00
pefree((char*)compiler_globals->script_encoding_list, 1);
}
2020-01-13 19:27:35 +08:00
if (ZEND_MAP_PTR_REAL_BASE(compiler_globals->map_ptr_base)) {
free(ZEND_MAP_PTR_REAL_BASE(compiler_globals->map_ptr_base));
ZEND_MAP_PTR_SET_REAL_BASE(compiler_globals->map_ptr_base, NULL);
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
compiler_globals->map_ptr_size = 0;
}
}
/* }}} */
2014-12-14 06:06:14 +08:00
static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{{ */
{
2014-12-14 06:06:14 +08:00
zend_startup_constants();
zend_copy_constants(executor_globals->zend_constants, GLOBAL_CONSTANTS_TABLE);
2014-12-14 06:06:14 +08:00
zend_init_rsrc_plist();
zend_init_exception_op();
Squashed commit of the following: commit 2399fc84c541da9c2176c5b7f6dd039a3c84dc64 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 12:38:08 2015 +0300 Removed useless assignment commit 796b6338174348eee0d74a67706d77b7ce1a60c3 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 12:35:31 2015 +0300 Fixed execution with overriden zend_execute_ex() commit 4a9fb125aa999059f8bc42ebb6ee573c7866b35b Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 02:02:58 2015 +0300 Fixed executor without global registers commit d456c30e00589ccda35a4b57ae903ef2d3c07d95 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 01:30:35 2015 +0300 Restored original behavior for tests/classes/__call_004.phpt commit 479646d37fef050536f1afb12b082618f1f1a3d0 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 00:32:17 2015 +0300 Fixed test. We don't keep stack frame for fake function anymore. commit 9ae61e33e24b2c811d4ab1ca4ab22847c64a780e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 00:30:09 2015 +0300 Use ZEND_ACC_CALL_VIA_TRAMPOLINE instead of ZEND_ACC_CALL_VIA_HANDLER. Keep ZEND_ACC_CALL_VIA_HANDLER for compatibility. commit 0a8403a2a0c27aa3db271774f8559739a6b8400e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 00:05:43 2015 +0300 Rename PROXY_CALL into CALL_TRAMPLINE. Generalize API to allow reuse EG(trampline) for other purposes. commit 4ea0525c10554e36185a0b8b6303106813b6a1c2 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 23:22:25 2015 +0300 Reuse EG(proxy_call_op) for all proxy. Move proxy related functions from zend_objects_API to zend_object_handlers. commit 529bf737ca388ad56fb4ae20ccb81e6276f25ec0 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 21:42:23 2015 +0300 Accurate use of proxy_call commit 5d62837d5ba3855743fe1981786ebd65d9da0b63 Merge: 83e749f 690843f Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 19:40:00 2015 +0300 Merge branch 'master' into opcodefy-call * master: Fixed GOTO executor Fixed typo Changed ArrayIterator implementation using zend_hash_iterator_... API. Allowed modification of itterated ArrayObject using the same behavior as proposed in `Fix "foreach" behavior`. Removed "Array was modified outside object and internal position is no longer valid" hack. commit 83e749ff3b6623e39b236a72e9b907d5b788ae5e Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 19:39:10 2015 +0300 Improved ZEND_PROXY_CALL commit 0c829afc534e6d5ff27a0dea3a4815da303bd1ef Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 15:14:49 2015 +0300 Reverted white-space changes commit df65144488afa3e9020d75e1ada5529b138afc5a Merge: 5fd2f97 97756d9 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 14:37:07 2015 +0300 Merge branch 'opcodefy-call' of github.com:laruence/php-src into opcodefy-call * 'opcodefy-call' of github.com:laruence/php-src: Ready for PR Fixed static call Improve performance by using prealloated op_arrray Respect called_scope Support internal magical __call/__callStatic opcode-fy magical __callStatic Opcode-fy magical __call commit 97756d9190e07a072a7b48135304dc25a964845f Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 19:07:59 2015 +0800 Ready for PR commit 74f993084627061e783645a866390b68e2981698 Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 19:03:00 2015 +0800 Fixed static call commit ec1d9eb592db0c3b7b0e3d21e7f445ed8bccfd4d Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 18:23:17 2015 +0800 Improve performance by using prealloated op_arrray commit df7fbbf949c99f2c5ae3da2a1199235651c7cc82 Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 15:10:02 2015 +0800 Respect called_scope commit 769d1d59fb48b6f7f93d7412eefbf26135fa3e59 Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 12:19:23 2015 +0800 Support internal magical __call/__callStatic commit a980fedd5b0e0683713dd4f6eaad62adf4b4732f Author: Xinchen Hui <laruence@gmail.com> Date: Wed Apr 8 18:35:41 2015 +0800 opcode-fy magical __callStatic commit 73855f7d53baa2efc2b8a88314f51c784c81b59d Author: Xinchen Hui <laruence@gmail.com> Date: Wed Apr 8 14:21:55 2015 +0800 Opcode-fy magical __call
2015-04-11 04:01:00 +08:00
zend_init_call_trampoline_op();
memset(&executor_globals->trampoline, 0, sizeof(zend_op_array));
executor_globals->lambda_count = 0;
ZVAL_UNDEF(&executor_globals->user_error_handler);
ZVAL_UNDEF(&executor_globals->user_exception_handler);
executor_globals->in_autoload = NULL;
executor_globals->current_execute_data = NULL;
executor_globals->current_module = NULL;
executor_globals->exit_status = 0;
#if XPFPA_HAVE_CW
executor_globals->saved_fpu_cw = 0;
#endif
executor_globals->saved_fpu_cw_ptr = NULL;
executor_globals->active = 0;
executor_globals->bailout = NULL;
executor_globals->error_handling = EH_NORMAL;
executor_globals->exception_class = NULL;
executor_globals->exception = NULL;
executor_globals->objects_store.object_buckets = NULL;
#ifdef ZEND_WIN32
zend_get_windows_version_info(&executor_globals->windows_version_info);
#endif
executor_globals->flags = EG_FLAGS_INITIAL;
}
/* }}} */
2014-12-14 06:06:14 +08:00
static void executor_globals_dtor(zend_executor_globals *executor_globals) /* {{{ */
{
2014-12-16 17:15:02 +08:00
zend_ini_dtor(executor_globals->ini_directives);
if (&executor_globals->persistent_list != global_persistent_list) {
2014-12-14 06:06:14 +08:00
zend_destroy_rsrc_list(&executor_globals->persistent_list);
}
if (executor_globals->zend_constants != GLOBAL_CONSTANTS_TABLE) {
zend_hash_destroy(executor_globals->zend_constants);
free(executor_globals->zend_constants);
}
}
/* }}} */
2014-12-14 06:06:14 +08:00
static void zend_new_thread_end_handler(THREAD_T thread_id) /* {{{ */
{
2014-12-14 06:06:14 +08:00
if (zend_copy_ini_directives() == SUCCESS) {
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP);
}
}
/* }}} */
#endif
#if defined(__FreeBSD__) || defined(__DragonFly__)
/* FreeBSD and DragonFly floating point precision fix */
#include <floatingpoint.h>
#endif
2014-12-14 06:06:14 +08:00
static void ini_scanner_globals_ctor(zend_ini_scanner_globals *scanner_globals_p) /* {{{ */
{
memset(scanner_globals_p, 0, sizeof(*scanner_globals_p));
}
/* }}} */
2014-12-14 06:06:14 +08:00
static void php_scanner_globals_ctor(zend_php_scanner_globals *scanner_globals_p) /* {{{ */
{
memset(scanner_globals_p, 0, sizeof(*scanner_globals_p));
}
/* }}} */
static void module_destructor_zval(zval *zv) /* {{{ */
{
zend_module_entry *module = (zend_module_entry*)Z_PTR_P(zv);
module_destructor(module);
free(module);
}
/* }}} */
2014-12-14 06:06:14 +08:00
static zend_bool php_auto_globals_create_globals(zend_string *name) /* {{{ */
{
zval globals;
2018-01-19 22:47:26 +08:00
/* IS_ARRAY, but with ref-counter 1 and not IS_TYPE_REFCOUNTED */
ZVAL_ARR(&globals, &EG(symbol_table));
2018-01-19 22:47:26 +08:00
Z_TYPE_FLAGS_P(&globals) = 0;
ZVAL_NEW_REF(&globals, &globals);
zend_hash_update(&EG(symbol_table), name, &globals);
return 0;
}
/* }}} */
int zend_startup(zend_utility_functions *utility_functions) /* {{{ */
1999-04-08 02:10:10 +08:00
{
#ifdef ZTS
zend_compiler_globals *compiler_globals;
zend_executor_globals *executor_globals;
2014-09-26 00:48:27 +08:00
extern ZEND_API ts_rsrc_id ini_scanner_globals_id;
extern ZEND_API ts_rsrc_id language_scanner_globals_id;
#else
extern zend_ini_scanner_globals ini_scanner_globals;
extern zend_php_scanner_globals language_scanner_globals;
#endif
zend_cpu_startup();
2017-08-14 06:44:19 +08:00
#ifdef ZEND_WIN32
php_win32_cp_set_by_id(65001);
#endif
2014-12-14 06:06:14 +08:00
start_memory_manager();
virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */
#if defined(__FreeBSD__) || defined(__DragonFly__)
/* FreeBSD and DragonFly floating point precision fix */
fpsetmask(0);
#endif
zend_startup_strtod();
zend_startup_extensions_mechanism();
1999-04-08 02:10:10 +08:00
/* Set up utility functions and values */
zend_error_cb = utility_functions->error_function;
1999-04-08 02:10:10 +08:00
zend_printf = utility_functions->printf_function;
zend_write = (zend_write_func_t) utility_functions->write_function;
1999-04-08 02:10:10 +08:00
zend_fopen = utility_functions->fopen_function;
if (!zend_fopen) {
zend_fopen = zend_fopen_wrapper;
}
zend_stream_open_function = utility_functions->stream_open_function;
2000-03-06 03:50:10 +08:00
zend_message_dispatcher_p = utility_functions->message_handler;
zend_get_configuration_directive_p = utility_functions->get_configuration_directive;
zend_ticks_function = utility_functions->ticks_function;
2002-09-19 23:58:01 +08:00
zend_on_timeout = utility_functions->on_timeout;
zend_printf_to_smart_string = utility_functions->printf_to_smart_string_function;
zend_printf_to_smart_str = utility_functions->printf_to_smart_str_function;
2004-09-06 06:40:35 +08:00
zend_getenv = utility_functions->getenv_function;
zend_resolve_path = utility_functions->resolve_path_function;
1999-06-20 04:42:15 +08:00
zend_interrupt_function = NULL;
#if HAVE_DTRACE
/* build with dtrace support */
{
char *tmp = getenv("USE_ZEND_DTRACE");
if (tmp && zend_atoi(tmp, 0)) {
zend_dtrace_enabled = 1;
zend_compile_file = dtrace_compile_file;
zend_execute_ex = dtrace_execute_ex;
zend_execute_internal = dtrace_execute_internal;
} else {
zend_compile_file = compile_file;
zend_execute_ex = execute_ex;
zend_execute_internal = NULL;
}
}
#else
zend_compile_file = compile_file;
zend_execute_ex = execute_ex;
zend_execute_internal = NULL;
2017-08-02 10:49:10 +08:00
#endif /* HAVE_DTRACE */
2010-04-24 21:32:30 +08:00
zend_compile_string = compile_string;
zend_throw_exception_hook = NULL;
1999-04-08 02:10:10 +08:00
2014-12-03 04:18:18 +08:00
/* Set up the default garbage collection implementation. */
gc_collect_cycles = zend_gc_collect_cycles;
2018-02-19 21:42:02 +08:00
zend_vm_init();
1999-04-08 02:10:10 +08:00
/* set up version */
zend_version_info = strdup(ZEND_CORE_VERSION_INFO);
zend_version_info_length = sizeof(ZEND_CORE_VERSION_INFO) - 1;
GLOBAL_FUNCTION_TABLE = (HashTable *) malloc(sizeof(HashTable));
GLOBAL_CLASS_TABLE = (HashTable *) malloc(sizeof(HashTable));
GLOBAL_AUTO_GLOBALS_TABLE = (HashTable *) malloc(sizeof(HashTable));
GLOBAL_CONSTANTS_TABLE = (HashTable *) malloc(sizeof(HashTable));
1999-04-08 02:10:10 +08:00
zend_hash_init_ex(GLOBAL_FUNCTION_TABLE, 1024, NULL, ZEND_FUNCTION_DTOR, 1, 0);
zend_hash_init_ex(GLOBAL_CLASS_TABLE, 64, NULL, ZEND_CLASS_DTOR, 1, 0);
zend_hash_init_ex(GLOBAL_AUTO_GLOBALS_TABLE, 8, NULL, auto_global_dtor, 1, 0);
zend_hash_init_ex(GLOBAL_CONSTANTS_TABLE, 128, NULL, ZEND_CONSTANT_DTOR, 1, 0);
zend_hash_init_ex(&module_registry, 32, NULL, module_destructor_zval, 1, 0);
zend_init_rsrc_list_dtors();
1999-04-08 02:10:10 +08:00
#ifdef ZTS
ts_allocate_fast_id(&compiler_globals_id, &compiler_globals_offset, sizeof(zend_compiler_globals), (ts_allocate_ctor) compiler_globals_ctor, (ts_allocate_dtor) compiler_globals_dtor);
ts_allocate_fast_id(&executor_globals_id, &executor_globals_offset, sizeof(zend_executor_globals), (ts_allocate_ctor) executor_globals_ctor, (ts_allocate_dtor) executor_globals_dtor);
ts_allocate_fast_id(&language_scanner_globals_id, &language_scanner_globals_offset, sizeof(zend_php_scanner_globals), (ts_allocate_ctor) php_scanner_globals_ctor, NULL);
ts_allocate_fast_id(&ini_scanner_globals_id, &ini_scanner_globals_offset, sizeof(zend_ini_scanner_globals), (ts_allocate_ctor) ini_scanner_globals_ctor, NULL);
compiler_globals = ts_resource(compiler_globals_id);
executor_globals = ts_resource(executor_globals_id);
2014-12-14 06:06:14 +08:00
compiler_globals_dtor(compiler_globals);
2004-02-12 06:58:03 +08:00
compiler_globals->in_compilation = 0;
2003-12-12 18:50:23 +08:00
compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable));
compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
*compiler_globals->function_table = *GLOBAL_FUNCTION_TABLE;
*compiler_globals->class_table = *GLOBAL_CLASS_TABLE;
compiler_globals->auto_globals = GLOBAL_AUTO_GLOBALS_TABLE;
zend_hash_destroy(executor_globals->zend_constants);
*executor_globals->zend_constants = *GLOBAL_CONSTANTS_TABLE;
1999-07-15 03:49:19 +08:00
#else
2014-12-14 06:06:14 +08:00
ini_scanner_globals_ctor(&ini_scanner_globals);
php_scanner_globals_ctor(&language_scanner_globals);
zend_set_default_compile_time_values();
#ifdef ZEND_WIN32
zend_get_windows_version_info(&EG(windows_version_info));
#endif
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
# if ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR
/* Create a map region, used for indirect pointers from shared to
* process memory. It's allocatred once and never resized.
* All processes must map it into the same address space.
*/
CG(map_ptr_size) = 1024 * 1024; // TODO: initial size ???
CG(map_ptr_last) = 0;
2020-01-13 20:12:55 +08:00
ZEND_MAP_PTR_SET_REAL_BASE(CG(map_ptr_base), pemalloc(CG(map_ptr_size) * sizeof(void*), 1));
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
# elif ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR_OR_OFFSET
/* Map region is going to be created and resized at run-time. */
2020-01-13 19:27:35 +08:00
ZEND_MAP_PTR_SET_REAL_BASE(CG(map_ptr_base), NULL);
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
CG(map_ptr_size) = 0;
CG(map_ptr_last) = 0;
# else
# error "Unknown ZEND_MAP_PTR_KIND"
# endif
#endif
EG(error_reporting) = E_ALL & ~E_NOTICE;
2014-12-14 06:06:14 +08:00
zend_interned_strings_init();
zend_startup_builtin_functions();
zend_register_standard_constants();
zend_register_auto_global(zend_string_init_interned("GLOBALS", sizeof("GLOBALS") - 1, 1), 1, php_auto_globals_create_globals);
1999-05-09 20:24:21 +08:00
#ifndef ZTS
2014-12-14 06:06:14 +08:00
zend_init_rsrc_plist();
zend_init_exception_op();
Squashed commit of the following: commit 2399fc84c541da9c2176c5b7f6dd039a3c84dc64 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 12:38:08 2015 +0300 Removed useless assignment commit 796b6338174348eee0d74a67706d77b7ce1a60c3 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 12:35:31 2015 +0300 Fixed execution with overriden zend_execute_ex() commit 4a9fb125aa999059f8bc42ebb6ee573c7866b35b Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 02:02:58 2015 +0300 Fixed executor without global registers commit d456c30e00589ccda35a4b57ae903ef2d3c07d95 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 01:30:35 2015 +0300 Restored original behavior for tests/classes/__call_004.phpt commit 479646d37fef050536f1afb12b082618f1f1a3d0 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 00:32:17 2015 +0300 Fixed test. We don't keep stack frame for fake function anymore. commit 9ae61e33e24b2c811d4ab1ca4ab22847c64a780e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 00:30:09 2015 +0300 Use ZEND_ACC_CALL_VIA_TRAMPOLINE instead of ZEND_ACC_CALL_VIA_HANDLER. Keep ZEND_ACC_CALL_VIA_HANDLER for compatibility. commit 0a8403a2a0c27aa3db271774f8559739a6b8400e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Apr 10 00:05:43 2015 +0300 Rename PROXY_CALL into CALL_TRAMPLINE. Generalize API to allow reuse EG(trampline) for other purposes. commit 4ea0525c10554e36185a0b8b6303106813b6a1c2 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 23:22:25 2015 +0300 Reuse EG(proxy_call_op) for all proxy. Move proxy related functions from zend_objects_API to zend_object_handlers. commit 529bf737ca388ad56fb4ae20ccb81e6276f25ec0 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 21:42:23 2015 +0300 Accurate use of proxy_call commit 5d62837d5ba3855743fe1981786ebd65d9da0b63 Merge: 83e749f 690843f Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 19:40:00 2015 +0300 Merge branch 'master' into opcodefy-call * master: Fixed GOTO executor Fixed typo Changed ArrayIterator implementation using zend_hash_iterator_... API. Allowed modification of itterated ArrayObject using the same behavior as proposed in `Fix "foreach" behavior`. Removed "Array was modified outside object and internal position is no longer valid" hack. commit 83e749ff3b6623e39b236a72e9b907d5b788ae5e Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 19:39:10 2015 +0300 Improved ZEND_PROXY_CALL commit 0c829afc534e6d5ff27a0dea3a4815da303bd1ef Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 15:14:49 2015 +0300 Reverted white-space changes commit df65144488afa3e9020d75e1ada5529b138afc5a Merge: 5fd2f97 97756d9 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Apr 9 14:37:07 2015 +0300 Merge branch 'opcodefy-call' of github.com:laruence/php-src into opcodefy-call * 'opcodefy-call' of github.com:laruence/php-src: Ready for PR Fixed static call Improve performance by using prealloated op_arrray Respect called_scope Support internal magical __call/__callStatic opcode-fy magical __callStatic Opcode-fy magical __call commit 97756d9190e07a072a7b48135304dc25a964845f Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 19:07:59 2015 +0800 Ready for PR commit 74f993084627061e783645a866390b68e2981698 Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 19:03:00 2015 +0800 Fixed static call commit ec1d9eb592db0c3b7b0e3d21e7f445ed8bccfd4d Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 18:23:17 2015 +0800 Improve performance by using prealloated op_arrray commit df7fbbf949c99f2c5ae3da2a1199235651c7cc82 Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 15:10:02 2015 +0800 Respect called_scope commit 769d1d59fb48b6f7f93d7412eefbf26135fa3e59 Author: Xinchen Hui <laruence@gmail.com> Date: Thu Apr 9 12:19:23 2015 +0800 Support internal magical __call/__callStatic commit a980fedd5b0e0683713dd4f6eaad62adf4b4732f Author: Xinchen Hui <laruence@gmail.com> Date: Wed Apr 8 18:35:41 2015 +0800 opcode-fy magical __callStatic commit 73855f7d53baa2efc2b8a88314f51c784c81b59d Author: Xinchen Hui <laruence@gmail.com> Date: Wed Apr 8 14:21:55 2015 +0800 Opcode-fy magical __call
2015-04-11 04:01:00 +08:00
zend_init_call_trampoline_op();
1999-05-09 20:24:21 +08:00
#endif
2014-12-14 06:06:14 +08:00
zend_ini_startup();
Fixed the UTF-8 and long path support in the streams on Windows. Since long the default PHP charset is UTF-8, however the Windows part is out of step with this important point. The current implementation in PHP doesn't technically permit to handle UTF-8 filepath and several other things. Till now, only the ANSI compatible APIs are being used. Here is more about it https://msdn.microsoft.com/en-us/library/windows/desktop/dd317752%28v=vs.85%29.aspx The patch fixes not only issues with multibyte filenames under incompatible codepages, but indirectly also issues with some other multibyte encodings like BIG5, Shift-JIS, etc. by providing a clean way to access filenames in UTF-8. Below is a small list of issues from the bug tracker, that are getting fixed: https://bugs.php.net/63401 https://bugs.php.net/41199 https://bugs.php.net/50203 https://bugs.php.net/71509 https://bugs.php.net/64699 https://bugs.php.net/64506 https://bugs.php.net/30195 https://bugs.php.net/65358 https://bugs.php.net/61315 https://bugs.php.net/70943 https://bugs.php.net/70903 https://bugs.php.net/63593 https://bugs.php.net/54977 https://bugs.php.net/54028 https://bugs.php.net/43148 https://bugs.php.net/30730 https://bugs.php.net/33350 https://bugs.php.net/35300 https://bugs.php.net/46990 https://bugs.php.net/61309 https://bugs.php.net/69333 https://bugs.php.net/45517 https://bugs.php.net/70551 https://bugs.php.net/50197 https://bugs.php.net/72200 https://bugs.php.net/37672 Yet more related tickets can for sure be found - on bugs.php.net, Stackoverflow and Github. Some of the bugs are pretty recent, some descend to early 2000th, but the user comments in there last even till today. Just for example, bug #30195 was opened in 2004, the latest comment in there was made in 2014. It is certain, that these bugs descend not only to pure PHP use cases, but get also redirected from the popular PHP based projects. Given the modern systems (and those supported by PHP) are always based on NTFS, there is no excuse to keep these issues unresolved. The internalization approach on Windows is in many ways different from UNIX and Linux, while it supports and is based on Unicode. It depends on the current system code page, APIs used and exact kind how the binary was compiled The locale doesn't affect the way Unicode or ANSI API work. PHP in particular is being compiled without _UNICODE defined and this is conditioned by the way we handle strings. Here is more about it https://msdn.microsoft.com/en-us/library/tsbaswba.aspx However, with any system code page ANSI functions automatically convert paths to UTF-16. Paths in some encodings incompatible with the current system code page, won't work correctly with ANSI APIs. PHP till now only uses the ANSI Windows APIs. For example, on a system with the current code page 1252, the paths in cp1252 are supported and transparently converted to UTF-16 by the ANSI functions. Once one wants to handle a filepath encoded with cp932 on that particular system, an ANSI or a POSIX compatible function used in PHP will produce an erroneous result. When trying to convert that cp932 path to UTF-8 and passing to the ANSI functions, an ANSI function would likely interpret the UTF-8 string as some string in the current code page and create a filepath that represents every single byte of the UTF-8 string. These behaviors are not only broken but also disregard the documented INI settings. This patch solves the issies with the multibyte paths on Windows by intelligently enforcing the usage of the Unicode aware APIs. For functions expect Unicode (fe CreateFileW, FindFirstFileW, etc.), arguments will be converted to UTF-16 wide chars. For functions returning Unicode aware data (fe GetCurrentDirectoryW, etc.), resulting wide string is converted back to char's depending on the current PHP charset settings, either to the current ANSI codepage (this is the behavior prior to this patch) or to UTF-8 (the default behavior). In a particular case, users might have to explicitly set internal_encoding or default_charset, if filenames in ANSI codepage are necessary. Current tests show no regressions and witness that this will be an exotic case, the current default UTF-8 encoding is compatible with any supported system. The dependency libraries are long switching to Unicode APIs, so some tests were also added for extensions not directly related to streams. At large, the patch brings over 150 related tests into the core. Those target and was run on various environments with European, Asian, etc. codepages. General PHP frameworks was tested and showed no regressions. The impact on the current C code base is low, the most places affected are the Windows only places in the three files tsrm_win32.c, zend_virtual_cwd.c and plain_wrapper.c. The actual implementation of the most of the wide char supporting functionality is in win32/ioutil.* and win32/codepage.*, several low level functionsare extended in place to avoid reimplementation for now. No performance impact was sighted. As previously mentioned, the ANSI APIs used prior the patch perform Unicode conversions internally. Using the Unicode APIs directly while doing custom conversions just retains the status quo. The ways to optimize it are open (fe. by implementing caching for the strings converted to wide variants). The long path implementation is user transparent. If a path exceeds the length of _MAX_PATH, it'll be automatically prefixed with \\?\. The MAXPATHLEN is set to 2048 bytes. Appreciation to Pierre Joye, Matt Ficken, @algo13 and others for tips, ideas and testing. Thanks.
2016-06-20 15:32:19 +08:00
#ifdef ZEND_WIN32
/* Uses INI settings, so needs to be run after it. */
php_win32_cp_setup();
#endif
#ifdef ZTS
tsrm_set_new_thread_end_handler(zend_new_thread_end_handler);
tsrm_set_shutdown_handler(zend_interned_strings_dtor);
#endif
1999-04-08 02:10:10 +08:00
return SUCCESS;
}
/* }}} */
1999-04-08 02:10:10 +08:00
2014-12-14 06:06:14 +08:00
void zend_register_standard_ini_entries(void) /* {{{ */
2002-11-20 01:51:30 +08:00
{
int module_number = 0;
REGISTER_INI_ENTRIES();
}
/* }}} */
2002-11-20 01:51:30 +08:00
static zend_class_entry *resolve_type_name(zend_string *type_name) {
zend_string *lc_type_name = zend_string_tolower(type_name);
zend_class_entry *ce = zend_hash_find_ptr(CG(class_table), lc_type_name);
ZEND_ASSERT(ce && ce->type == ZEND_INTERNAL_CLASS);
zend_string_release(lc_type_name);
return ce;
}
static void zend_resolve_property_types(void) /* {{{ */
{
zend_class_entry *ce;
zend_property_info *prop_info;
ZEND_HASH_FOREACH_PTR(CG(class_table), ce) {
if (ce->type != ZEND_INTERNAL_CLASS) {
continue;
}
if (UNEXPECTED(ZEND_CLASS_HAS_TYPE_HINTS(ce))) {
ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop_info) {
zend_type *single_type;
ZEND_TYPE_FOREACH(prop_info->type, single_type) {
if (ZEND_TYPE_HAS_NAME(*single_type)) {
zend_string *type_name = ZEND_TYPE_NAME(*single_type);
ZEND_TYPE_SET_CE(*single_type, resolve_type_name(type_name));
zend_string_release(type_name);
}
} ZEND_TYPE_FOREACH_END();
} ZEND_HASH_FOREACH_END();
}
ce->ce_flags |= ZEND_ACC_PROPERTY_TYPES_RESOLVED;
} ZEND_HASH_FOREACH_END();
}
/* }}} */
2002-09-17 20:42:11 +08:00
/* Unlink the global (r/o) copies of the class, function and constant tables,
* and use a fresh r/w copy for the startup thread
*/
int zend_post_startup(void) /* {{{ */
2002-09-17 20:42:11 +08:00
{
#ifdef ZTS
zend_encoding **script_encoding_list;
2002-09-17 20:42:11 +08:00
zend_compiler_globals *compiler_globals = ts_resource(compiler_globals_id);
zend_executor_globals *executor_globals = ts_resource(executor_globals_id);
#endif
zend_resolve_property_types();
if (zend_post_startup_cb) {
int (*cb)(void) = zend_post_startup_cb;
zend_post_startup_cb = NULL;
if (cb() != SUCCESS) {
return FAILURE;
}
}
2002-09-17 20:42:11 +08:00
#ifdef ZTS
*GLOBAL_FUNCTION_TABLE = *compiler_globals->function_table;
*GLOBAL_CLASS_TABLE = *compiler_globals->class_table;
*GLOBAL_CONSTANTS_TABLE = *executor_globals->zend_constants;
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
global_map_ptr_last = compiler_globals->map_ptr_last;
short_tags_default = CG(short_tags);
compiler_options_default = CG(compiler_options);
2007-10-11 09:03:19 +08:00
2014-12-14 06:06:14 +08:00
zend_destroy_rsrc_list(&EG(persistent_list));
2003-12-12 18:50:23 +08:00
free(compiler_globals->function_table);
Implemented preloading RFC: https://wiki.php.net/rfc/preload. Squashed commit of the following: commit 106c815fffb8eb3efe00a27a5229cb1f8ffc9736 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:36:44 2018 +0300 Added NEWS entry commit 1dacd5e20b7043368ef9e80db296d1781134b6fd Merge: d516139abf ba99aa133c Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:33:37 2018 +0300 Merge branch 'master' into preload * master: Fixed issues related to optimization and persitence of classes linked with interfaces, traits or internal classes. Added possiblity to avoid signal handlers reinitialization on each request. commit d516139abf5ffbd495ee6037f1dc04a1cfe588a7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:13:15 2018 +0300 Override opcache.preload for testing commit 162b154d0bbfbaf8ef93975f7e56a1353236903d Merge: 45fdd034ce 8bda22592e Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 15:38:09 2018 +0300 Merge branch 'master' into preload * master: (34 commits) Eliminate useless $this related check Eliminate useless $this related checks Replace zend_parse_method_parameters() by zend_parse_parameters() and avoid useless checks. Replace getThis() by EX(This), when additional check is not necessary. Fixed tests Validate length on socket_write Fix compilation on x32 Fix #77141: Signedness issue in SOAP when precision=-1 Support SQLite3 @name notation Remove lexer files generated by RE2C Update libmagic.patch [ci skip] Update libmagic.patch [ci skip] Fork test with pcre.jit=0 Rework magic data Fix regex Fix regex Rework magic data Sync one more upstream libmagic piece Suppress already used warning Ignore getaddrinfo failed message ... commit 45fdd034ceceb68e8fb23bd6e70d627f17dfd411 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 9 13:07:03 2018 +0300 Properly resolve magic method of preloaded classes inherited from internal ones. commit 34645aeb4272b71a81a7e0d91f27eded557b78be Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 8 15:29:17 2018 +0300 Don't preload constants defined during preload script excution. commit cef0d67c3e5aac89b3d606fbd8d445225c07c83f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 7 15:56:54 2018 +0300 Support for class aliasses commit 08ffc9a552c7cf4fbff1a4b3d2de4e7c33f4120d Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 7 15:34:39 2018 +0300 Resolve constants only in linked classes commit 8d3429cda83c87646eef0006d5cda075f2400b24 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Nov 6 11:56:39 2018 +0300 Fixed preloading of references to internal classes. commit 7ae3a47d20e83f7d804506c6d50f6a392199260b Merge: 9b0a53ed1c 049f239cfc Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Nov 6 11:37:15 2018 +0300 Merge branch 'master' into preload * master: Update NEWS [ci skip] Update NEWS [ci skip] Update libmagic.patch [ci skip] Update libmagic.patch [ci skip] Declare function proto in header Declare function proto in header Fix #76825: Undefined symbols ___cpuid_count NEWS Fix: #77110 undefined symbol zend_string_equal_val in C++ build Fix #77105: Use position:sticky for <th> in `phpinfo()` Implement handling for JIT recognition when cross compiling Backport 7f5f4601 for 7.2 Fix #76348: WSDL_CACHE_MEMORY causes Segmentation fault Rework places in libmagic regarding previous CVE-2014-3538 fixes Change the way JIT availability is checked Fix a test for ldap extension Fixed bug #77092 Future-proof email addresses commit 9b0a53ed1cd5995efae0d71e1941d1db4ef6ba39 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 14:54:44 2018 +0300 We don't need preload_restart() here commit 0bd17bd43890423e1e98a5925f11cea93da3df55 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 14:44:30 2018 +0300 EG(*) may be not initializd at this point - use CG(*). commit b610467051d8a3687a60ffc2957bc353cb6b3bd4 Merge: 3a9d90f74a 67e0138c0d Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 11:33:37 2018 +0300 Merge branch 'master' into preload * master: Future-proof email addresses... Update email addresses. We're still @Zend, but future proofing it... commit 3a9d90f74a3d890cb59658d604d5a202e3aee256 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 15:19:48 2018 +0300 Fexed resolution of method clones commit aea85c65bd1795d0750dee6ac0e476acd2ac9dd7 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 11:45:50 2018 +0300 Prevent inlining of method copied from trait commit 36b644fbb738e7548ccb436e5d04d653d93cce14 Merge: 7a20781d2e b91690c892 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 10:56:02 2018 +0300 Merge branch 'master' into preload * master: Fix stray newline that caused this test to fail Fix session tests that fail if error_log is set This test needs to log to stdout Fix error condition Fixed bug #77081 ftruncate() changes seek pointer in c mode Fix and improve test case commit 7a20781d2ee694262f913a612d8b0b6a24ceff7b Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 31 00:52:46 2018 +0300 Added test commit 4a57b5d563f9c9616f3c236f57ccd09d8a66f146 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 31 00:50:21 2018 +0300 Fixed preloading of classes linked with traits commit 68c4f99e23695e74eafa43097ecab62392bad3ee Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 16:25:14 2018 +0300 Added test commit 38ab7ef4cf429dcfd5dfb18f844242cdf3a4d61f Merge: eb6e2c529f bf38e6c10a Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 16:14:39 2018 +0300 Merge branch 'master' into preload * master: Keep original value of "prototype" commit eb6e2c529f8cedf6823346387dd8b0ba6a4f045b Merge: 562049510f 2fefa8c61e Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 15:35:39 2018 +0300 Merge branch 'master' into preload * master: Call function_add_ref() in proper place Updated to version 2018.7 (2018g) Updated to version 2018.7 (2018g) Updated to version 2018.7 (2018g) Reslove inherited op_array references once afrer all optimizations. commit 562049510f605c21cd46fc3b6f97ed15bfe7b0dc Merge: e806cb732a 4828fb7b6b Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 10:29:49 2018 +0300 Merge branch 'master' into preload * master: [ci skip] Update NEWS [ci skip] Update NEWS [ci skip] Update NEWS fix bug #77079 Add missing null initialization Remove redundant mbfl_string_init calls Use zend_string for mbstring last encoding cache commit e806cb732a2a3f1e409528988a0571421c541078 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 22:32:15 2018 +0300 Fixed double-free commit 2f697ef8af0e7b21c47707b2d688880e8c987a8b Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 22:07:32 2018 +0300 typo commit c559f22b3e61b38761831d9610889d28ba6875e0 Merge: 310631cc05 ea2e67876a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 21:59:27 2018 +0300 Merge branch 'master' into preload * master: Stop Apache if PHP wasn't started successful. Execute zend_post_startup() with module_initialized flag set. Removed dead code Fix mb_strrpos() with encoding passed as 3rd param commit 310631cc0565ac87091c4f1a8a9f739a13e7e778 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 16:48:42 2018 +0300 Stop Apache if PHP wasn't started successful. commit 0a24d7ba8f3280507c9663b32e14030212cf8491 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 16:25:49 2018 +0300 Avoid use-after-free in main thread commit 17a3cb4a2ab271c2b2357c04e36efa64e02444ff Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 15:25:17 2018 +0300 Execute zend_post_startup() with module_initialized flag set. commit 6d4b22c518bec956e9632fad4329360304d17fd7 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 14:12:20 2018 +0300 Override SAPI.ub_write and SAPI.flush for preloading commit 386c9d3470168f70afe5d3b72a58ea0c0da1519c Merge: d7fbb4d402 359f19edc9 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 13:49:24 2018 +0300 Merge branch 'master' into preload * master: Optimize substr() edge-case conditions [ci skip] Update UPGRADING Fix #71592: External entity processing never fails Add TIDY_TAG_* constants supported by libtidy 5 Add is_iterable to opcache Optimizer commit d7fbb4d402a18c8fd1c49e0c92afd9f9e513bc7a Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 13:11:54 2018 +0300 Restore preload state if it was already loaded in another process. commit 0fe9ea1c07822b5d4672cece2c180bf9795e16e4 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 12:29:06 2018 +0300 Removed dead code commit 3a2d1bcc1fd27b6983522c262931fc0187c0afef Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 00:19:40 2018 +0300 Support for builds without ZEND_SIGNALS commit e6b76ecb4beea3b922bf7529050e3828f745dedb Merge: 4531fbf931 68694c9997 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 23:43:25 2018 +0300 Merge branch 'master' into preload * master: Don't wrap php_module_shutdown() with zend_try. executor_globals are released in ZTS build, and this leads to crash. [ci skip] Fix indentation in UPGRADING. commit 4531fbf9310bfb7bb579134cc84e8c10c5d42059 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 22:44:49 2018 +0300 Disable linking and preloading of classes those parent or one of interface or trait is an internal class. commit a594a618ce98242c1d273eb9ede75b4f6b4635d8 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 22:30:51 2018 +0300 Cleanup - remove useless ZCSG(saved_map_ptr_last) - move preloaded classes/functions clean-up code back into better place commit ab9a40f63cfa1a205b8f853b7e0c2ce61edabb32 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 20:52:51 2018 +0300 Added support for preloaded classes/functions in ZTS build commit e3c65db099517082b66dd20ea57e1bda649a7aa5 Merge: 4f57c1e029 33e777acbf Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 20:52:26 2018 +0300 Merge branch 'master' into preload * master: Improved shared interned strings handling. The previous implementation worked incorrectly in ZTS build. It changed strings only in function/class tables of one thread. Now all threads gets the same shared interned strings. Also, on shutdown, we don't try to replace SHM interned strings back to process strings, but delay dettachment of SHM instead. Don't use request heap at shutdown Don't optimize function if inference failed Fixed bug #77058 Improve "narrowing" error message bump versions commit 4f57c1e029ce9c24bd699ea61b05973c4665bc32 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 15:29:58 2018 +0300 Cleanup (move preload_shutdown() call to better place) commit 26587a95c071cf9dd098199eb3708fca8adae243 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 14:30:51 2018 +0300 eol commit d70cb10480fdc7d814495150cd48e43d4147138f Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 14:30:20 2018 +0300 cleanup commit aabe685dbb887e91c240b6c5553193889bcfc540 Merge: d9fc51bc3b 40808ac41e Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 12:42:51 2018 +0300 Merge branch 'master' into preload * master: Remove unused var Remove ext/json parser files generated by bison Fix run-tests.php for running phpdbg and certain test sections Normalize .gitignore commit d9fc51bc3bdfbd7f4149a884b09e3c09a41f7a8d Merge: b5ffba0faf b6ef8998d5 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 15:59:24 2018 +0300 Merge branch 'master' into preload * master: Fixed reseting of interned strings buffer. commit b5ffba0fafb4d940336d5f5fe93950dad1d8d779 Merge: e4a7ef0c43 a404383118 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 12:46:28 2018 +0300 Merge branch 'master' into preload * master: Fixed build in directory different from source commit e4a7ef0c431ec97cdd00e44dfa0ef17887d1e5e3 Merge: 811f20aaa5 d1e14e2cc0 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 11:59:43 2018 +0300 Merge branch 'master' into preload * master: (29 commits) Make php_plain_files_wrapper to be writable (workaround for swoole) Remove phpdbg parser files generated by bison Fix conflicts in phpdbg parser Refetetch function name on exceptional path to allow better code on fast code path. fix typo in sysvsem.c Fixed bug #50675 bump to 7.2.13-dev [ci skip] Update NEWS wrt. php-7.3.0RC4 tagging Inlining in the most frequently used code paths Fixed test failurs introduced by 9c144e0d8217d1ef7a83c2498214308b21af749f Use persistent strings only for persistent connections Fix accessibility checks for dynamic properties Updated to version 2018.6 (2018f) Updated to version 2018.6 (2018f) Updated to version 2018.6 (2018f) Fix arginfo and clean up fpm_get_status Defragment two Zend related Makefile fragments together [ci skip] Remove automake and aclocal in comments Fix #75282: xmlrpc_encode_request() crashes Fix tests for ICU 63.1 ... commit 811f20aaa5030035666d9f325dd7c64632c70a50 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 22 14:10:49 2018 +0300 Added information about preloading to opcache_get_status() commit 093e8b1bbffdc07d217a543613ea14c3eeac710e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:46:23 2018 +0300 Added warning message commit a2ba970ce3d0ac51ebfbe1bfc2dc7b99b9750a75 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:35:40 2018 +0300 Added test commit b67e28367c11db50360e664a7ad6ac95b393f2e4 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:33:12 2018 +0300 Don't preload functions declared at run-time. commit b0139dc22854ee000586ef83c149d7d25181da60 Merge: a609520adb 3fe698b904 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:23:14 2018 +0300 Merge branch 'master' into preload * master: Mark "top-level" functions. Don't initialize static_member_tables during start-up, when inherit internal classes. [ci skip] Update NEWS [ci skip] Update NEWS [ci skip] Update NEWS Fix #77035: The phpize and ./configure create redundant .deps file Remove outdated PEAR artefacts Fix tests/output/bug74815.phpt generating errors.log Revert "Use C++ symbols, when C++11 or upper is compiled" Use C++ symbols, when C++11 or upper is compiled Added new line Remove stamp-h Move all testing docs to qa.php.net Fix a typo in UPGRADING.INTERNALS Fix test when it's run on another drive [ci skip] Update UPGRADING wrt. tidyp support Fixed incorrect reallocation Fix #77027: tidy::getOptDoc() not available on Windows Run CI tests under opcache.protect_memory=1 commit a609520adbc0bf12701d467bae4a016fde43231e Merge: ac8f45f61b b6ac50f9e6 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 17:01:05 2018 +0300 Merge branch 'master' into preload * master: Fixed comment Micro optimizations Mark "top-level" classes commit ac8f45f61b561af9aee629232bc3705143ceaac3 Merge: 632b30b545 d57cd36e47 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 15:53:41 2018 +0300 Merge branch 'master' into preload * master: Immutable clases and op_arrays. commit 632b30b5451c8fdf0879a3ba4d937ff4ecfc8ce7 Merge: d33908a99a cd0c36c3f9 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 15:04:43 2018 +0300 Merge branch 'immutable' into preload * immutable: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit d33908a99a3c746f188e268df3db541591f6fcc2 Merge: 21e0bebca3 4740dabb84 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:14:23 2018 +0300 Merge branch 'immutable' into preload * immutable: Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit 21e0bebca3e6fff3c3484ee46f9aa3ac4e98eaeb Merge: c78277ae84 ad7a78b253 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 12:29:59 2018 +0300 Merge branch 'immutable' into preload * immutable: Added comment Added type cast Moved static class members initialization into the proper place. Removed redundand assertion Removed duplicate code Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. typo Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit c78277ae84b21067744d1701949e4e1fadd8872a Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 16 17:25:35 2018 +0300 Preloadsing support for opcache restart commit f76a955c02f6a033d4656d5e0d9dad9a8e83cc86 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 16 13:52:36 2018 +0300 Fixed incorrect signal handlers overriding commit 0810ce0d8165d4b752267f035f9fa0aaa1698ceb Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:38:48 2018 +0300 An attempt to implemnt "preloading" ability. commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-11-14 21:46:05 +08:00
compiler_globals->function_table = NULL;
2003-12-12 18:50:23 +08:00
free(compiler_globals->class_table);
Implemented preloading RFC: https://wiki.php.net/rfc/preload. Squashed commit of the following: commit 106c815fffb8eb3efe00a27a5229cb1f8ffc9736 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:36:44 2018 +0300 Added NEWS entry commit 1dacd5e20b7043368ef9e80db296d1781134b6fd Merge: d516139abf ba99aa133c Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:33:37 2018 +0300 Merge branch 'master' into preload * master: Fixed issues related to optimization and persitence of classes linked with interfaces, traits or internal classes. Added possiblity to avoid signal handlers reinitialization on each request. commit d516139abf5ffbd495ee6037f1dc04a1cfe588a7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:13:15 2018 +0300 Override opcache.preload for testing commit 162b154d0bbfbaf8ef93975f7e56a1353236903d Merge: 45fdd034ce 8bda22592e Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 15:38:09 2018 +0300 Merge branch 'master' into preload * master: (34 commits) Eliminate useless $this related check Eliminate useless $this related checks Replace zend_parse_method_parameters() by zend_parse_parameters() and avoid useless checks. Replace getThis() by EX(This), when additional check is not necessary. Fixed tests Validate length on socket_write Fix compilation on x32 Fix #77141: Signedness issue in SOAP when precision=-1 Support SQLite3 @name notation Remove lexer files generated by RE2C Update libmagic.patch [ci skip] Update libmagic.patch [ci skip] Fork test with pcre.jit=0 Rework magic data Fix regex Fix regex Rework magic data Sync one more upstream libmagic piece Suppress already used warning Ignore getaddrinfo failed message ... commit 45fdd034ceceb68e8fb23bd6e70d627f17dfd411 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 9 13:07:03 2018 +0300 Properly resolve magic method of preloaded classes inherited from internal ones. commit 34645aeb4272b71a81a7e0d91f27eded557b78be Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 8 15:29:17 2018 +0300 Don't preload constants defined during preload script excution. commit cef0d67c3e5aac89b3d606fbd8d445225c07c83f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 7 15:56:54 2018 +0300 Support for class aliasses commit 08ffc9a552c7cf4fbff1a4b3d2de4e7c33f4120d Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 7 15:34:39 2018 +0300 Resolve constants only in linked classes commit 8d3429cda83c87646eef0006d5cda075f2400b24 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Nov 6 11:56:39 2018 +0300 Fixed preloading of references to internal classes. commit 7ae3a47d20e83f7d804506c6d50f6a392199260b Merge: 9b0a53ed1c 049f239cfc Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Nov 6 11:37:15 2018 +0300 Merge branch 'master' into preload * master: Update NEWS [ci skip] Update NEWS [ci skip] Update libmagic.patch [ci skip] Update libmagic.patch [ci skip] Declare function proto in header Declare function proto in header Fix #76825: Undefined symbols ___cpuid_count NEWS Fix: #77110 undefined symbol zend_string_equal_val in C++ build Fix #77105: Use position:sticky for <th> in `phpinfo()` Implement handling for JIT recognition when cross compiling Backport 7f5f4601 for 7.2 Fix #76348: WSDL_CACHE_MEMORY causes Segmentation fault Rework places in libmagic regarding previous CVE-2014-3538 fixes Change the way JIT availability is checked Fix a test for ldap extension Fixed bug #77092 Future-proof email addresses commit 9b0a53ed1cd5995efae0d71e1941d1db4ef6ba39 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 14:54:44 2018 +0300 We don't need preload_restart() here commit 0bd17bd43890423e1e98a5925f11cea93da3df55 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 14:44:30 2018 +0300 EG(*) may be not initializd at this point - use CG(*). commit b610467051d8a3687a60ffc2957bc353cb6b3bd4 Merge: 3a9d90f74a 67e0138c0d Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 11:33:37 2018 +0300 Merge branch 'master' into preload * master: Future-proof email addresses... Update email addresses. We're still @Zend, but future proofing it... commit 3a9d90f74a3d890cb59658d604d5a202e3aee256 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 15:19:48 2018 +0300 Fexed resolution of method clones commit aea85c65bd1795d0750dee6ac0e476acd2ac9dd7 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 11:45:50 2018 +0300 Prevent inlining of method copied from trait commit 36b644fbb738e7548ccb436e5d04d653d93cce14 Merge: 7a20781d2e b91690c892 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 10:56:02 2018 +0300 Merge branch 'master' into preload * master: Fix stray newline that caused this test to fail Fix session tests that fail if error_log is set This test needs to log to stdout Fix error condition Fixed bug #77081 ftruncate() changes seek pointer in c mode Fix and improve test case commit 7a20781d2ee694262f913a612d8b0b6a24ceff7b Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 31 00:52:46 2018 +0300 Added test commit 4a57b5d563f9c9616f3c236f57ccd09d8a66f146 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 31 00:50:21 2018 +0300 Fixed preloading of classes linked with traits commit 68c4f99e23695e74eafa43097ecab62392bad3ee Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 16:25:14 2018 +0300 Added test commit 38ab7ef4cf429dcfd5dfb18f844242cdf3a4d61f Merge: eb6e2c529f bf38e6c10a Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 16:14:39 2018 +0300 Merge branch 'master' into preload * master: Keep original value of "prototype" commit eb6e2c529f8cedf6823346387dd8b0ba6a4f045b Merge: 562049510f 2fefa8c61e Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 15:35:39 2018 +0300 Merge branch 'master' into preload * master: Call function_add_ref() in proper place Updated to version 2018.7 (2018g) Updated to version 2018.7 (2018g) Updated to version 2018.7 (2018g) Reslove inherited op_array references once afrer all optimizations. commit 562049510f605c21cd46fc3b6f97ed15bfe7b0dc Merge: e806cb732a 4828fb7b6b Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 10:29:49 2018 +0300 Merge branch 'master' into preload * master: [ci skip] Update NEWS [ci skip] Update NEWS [ci skip] Update NEWS fix bug #77079 Add missing null initialization Remove redundant mbfl_string_init calls Use zend_string for mbstring last encoding cache commit e806cb732a2a3f1e409528988a0571421c541078 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 22:32:15 2018 +0300 Fixed double-free commit 2f697ef8af0e7b21c47707b2d688880e8c987a8b Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 22:07:32 2018 +0300 typo commit c559f22b3e61b38761831d9610889d28ba6875e0 Merge: 310631cc05 ea2e67876a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 21:59:27 2018 +0300 Merge branch 'master' into preload * master: Stop Apache if PHP wasn't started successful. Execute zend_post_startup() with module_initialized flag set. Removed dead code Fix mb_strrpos() with encoding passed as 3rd param commit 310631cc0565ac87091c4f1a8a9f739a13e7e778 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 16:48:42 2018 +0300 Stop Apache if PHP wasn't started successful. commit 0a24d7ba8f3280507c9663b32e14030212cf8491 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 16:25:49 2018 +0300 Avoid use-after-free in main thread commit 17a3cb4a2ab271c2b2357c04e36efa64e02444ff Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 15:25:17 2018 +0300 Execute zend_post_startup() with module_initialized flag set. commit 6d4b22c518bec956e9632fad4329360304d17fd7 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 14:12:20 2018 +0300 Override SAPI.ub_write and SAPI.flush for preloading commit 386c9d3470168f70afe5d3b72a58ea0c0da1519c Merge: d7fbb4d402 359f19edc9 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 13:49:24 2018 +0300 Merge branch 'master' into preload * master: Optimize substr() edge-case conditions [ci skip] Update UPGRADING Fix #71592: External entity processing never fails Add TIDY_TAG_* constants supported by libtidy 5 Add is_iterable to opcache Optimizer commit d7fbb4d402a18c8fd1c49e0c92afd9f9e513bc7a Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 13:11:54 2018 +0300 Restore preload state if it was already loaded in another process. commit 0fe9ea1c07822b5d4672cece2c180bf9795e16e4 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 12:29:06 2018 +0300 Removed dead code commit 3a2d1bcc1fd27b6983522c262931fc0187c0afef Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 00:19:40 2018 +0300 Support for builds without ZEND_SIGNALS commit e6b76ecb4beea3b922bf7529050e3828f745dedb Merge: 4531fbf931 68694c9997 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 23:43:25 2018 +0300 Merge branch 'master' into preload * master: Don't wrap php_module_shutdown() with zend_try. executor_globals are released in ZTS build, and this leads to crash. [ci skip] Fix indentation in UPGRADING. commit 4531fbf9310bfb7bb579134cc84e8c10c5d42059 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 22:44:49 2018 +0300 Disable linking and preloading of classes those parent or one of interface or trait is an internal class. commit a594a618ce98242c1d273eb9ede75b4f6b4635d8 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 22:30:51 2018 +0300 Cleanup - remove useless ZCSG(saved_map_ptr_last) - move preloaded classes/functions clean-up code back into better place commit ab9a40f63cfa1a205b8f853b7e0c2ce61edabb32 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 20:52:51 2018 +0300 Added support for preloaded classes/functions in ZTS build commit e3c65db099517082b66dd20ea57e1bda649a7aa5 Merge: 4f57c1e029 33e777acbf Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 20:52:26 2018 +0300 Merge branch 'master' into preload * master: Improved shared interned strings handling. The previous implementation worked incorrectly in ZTS build. It changed strings only in function/class tables of one thread. Now all threads gets the same shared interned strings. Also, on shutdown, we don't try to replace SHM interned strings back to process strings, but delay dettachment of SHM instead. Don't use request heap at shutdown Don't optimize function if inference failed Fixed bug #77058 Improve "narrowing" error message bump versions commit 4f57c1e029ce9c24bd699ea61b05973c4665bc32 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 15:29:58 2018 +0300 Cleanup (move preload_shutdown() call to better place) commit 26587a95c071cf9dd098199eb3708fca8adae243 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 14:30:51 2018 +0300 eol commit d70cb10480fdc7d814495150cd48e43d4147138f Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 14:30:20 2018 +0300 cleanup commit aabe685dbb887e91c240b6c5553193889bcfc540 Merge: d9fc51bc3b 40808ac41e Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 12:42:51 2018 +0300 Merge branch 'master' into preload * master: Remove unused var Remove ext/json parser files generated by bison Fix run-tests.php for running phpdbg and certain test sections Normalize .gitignore commit d9fc51bc3bdfbd7f4149a884b09e3c09a41f7a8d Merge: b5ffba0faf b6ef8998d5 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 15:59:24 2018 +0300 Merge branch 'master' into preload * master: Fixed reseting of interned strings buffer. commit b5ffba0fafb4d940336d5f5fe93950dad1d8d779 Merge: e4a7ef0c43 a404383118 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 12:46:28 2018 +0300 Merge branch 'master' into preload * master: Fixed build in directory different from source commit e4a7ef0c431ec97cdd00e44dfa0ef17887d1e5e3 Merge: 811f20aaa5 d1e14e2cc0 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 11:59:43 2018 +0300 Merge branch 'master' into preload * master: (29 commits) Make php_plain_files_wrapper to be writable (workaround for swoole) Remove phpdbg parser files generated by bison Fix conflicts in phpdbg parser Refetetch function name on exceptional path to allow better code on fast code path. fix typo in sysvsem.c Fixed bug #50675 bump to 7.2.13-dev [ci skip] Update NEWS wrt. php-7.3.0RC4 tagging Inlining in the most frequently used code paths Fixed test failurs introduced by 9c144e0d8217d1ef7a83c2498214308b21af749f Use persistent strings only for persistent connections Fix accessibility checks for dynamic properties Updated to version 2018.6 (2018f) Updated to version 2018.6 (2018f) Updated to version 2018.6 (2018f) Fix arginfo and clean up fpm_get_status Defragment two Zend related Makefile fragments together [ci skip] Remove automake and aclocal in comments Fix #75282: xmlrpc_encode_request() crashes Fix tests for ICU 63.1 ... commit 811f20aaa5030035666d9f325dd7c64632c70a50 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 22 14:10:49 2018 +0300 Added information about preloading to opcache_get_status() commit 093e8b1bbffdc07d217a543613ea14c3eeac710e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:46:23 2018 +0300 Added warning message commit a2ba970ce3d0ac51ebfbe1bfc2dc7b99b9750a75 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:35:40 2018 +0300 Added test commit b67e28367c11db50360e664a7ad6ac95b393f2e4 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:33:12 2018 +0300 Don't preload functions declared at run-time. commit b0139dc22854ee000586ef83c149d7d25181da60 Merge: a609520adb 3fe698b904 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:23:14 2018 +0300 Merge branch 'master' into preload * master: Mark "top-level" functions. Don't initialize static_member_tables during start-up, when inherit internal classes. [ci skip] Update NEWS [ci skip] Update NEWS [ci skip] Update NEWS Fix #77035: The phpize and ./configure create redundant .deps file Remove outdated PEAR artefacts Fix tests/output/bug74815.phpt generating errors.log Revert "Use C++ symbols, when C++11 or upper is compiled" Use C++ symbols, when C++11 or upper is compiled Added new line Remove stamp-h Move all testing docs to qa.php.net Fix a typo in UPGRADING.INTERNALS Fix test when it's run on another drive [ci skip] Update UPGRADING wrt. tidyp support Fixed incorrect reallocation Fix #77027: tidy::getOptDoc() not available on Windows Run CI tests under opcache.protect_memory=1 commit a609520adbc0bf12701d467bae4a016fde43231e Merge: ac8f45f61b b6ac50f9e6 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 17:01:05 2018 +0300 Merge branch 'master' into preload * master: Fixed comment Micro optimizations Mark "top-level" classes commit ac8f45f61b561af9aee629232bc3705143ceaac3 Merge: 632b30b545 d57cd36e47 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 15:53:41 2018 +0300 Merge branch 'master' into preload * master: Immutable clases and op_arrays. commit 632b30b5451c8fdf0879a3ba4d937ff4ecfc8ce7 Merge: d33908a99a cd0c36c3f9 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 15:04:43 2018 +0300 Merge branch 'immutable' into preload * immutable: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit d33908a99a3c746f188e268df3db541591f6fcc2 Merge: 21e0bebca3 4740dabb84 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:14:23 2018 +0300 Merge branch 'immutable' into preload * immutable: Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit 21e0bebca3e6fff3c3484ee46f9aa3ac4e98eaeb Merge: c78277ae84 ad7a78b253 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 12:29:59 2018 +0300 Merge branch 'immutable' into preload * immutable: Added comment Added type cast Moved static class members initialization into the proper place. Removed redundand assertion Removed duplicate code Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. typo Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit c78277ae84b21067744d1701949e4e1fadd8872a Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 16 17:25:35 2018 +0300 Preloadsing support for opcache restart commit f76a955c02f6a033d4656d5e0d9dad9a8e83cc86 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 16 13:52:36 2018 +0300 Fixed incorrect signal handlers overriding commit 0810ce0d8165d4b752267f035f9fa0aaa1698ceb Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:38:48 2018 +0300 An attempt to implemnt "preloading" ability. commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-11-14 21:46:05 +08:00
compiler_globals->class_table = NULL;
2020-01-13 19:27:35 +08:00
if (ZEND_MAP_PTR_REAL_BASE(compiler_globals->map_ptr_base)) {
free(ZEND_MAP_PTR_REAL_BASE(compiler_globals->map_ptr_base));
}
ZEND_MAP_PTR_SET_REAL_BASE(compiler_globals->map_ptr_base, NULL);
if ((script_encoding_list = (zend_encoding **)compiler_globals->script_encoding_list)) {
2014-12-14 06:06:14 +08:00
compiler_globals_ctor(compiler_globals);
compiler_globals->script_encoding_list = (const zend_encoding **)script_encoding_list;
} else {
2014-12-14 06:06:14 +08:00
compiler_globals_ctor(compiler_globals);
}
2003-12-12 18:50:23 +08:00
free(EG(zend_constants));
Implemented preloading RFC: https://wiki.php.net/rfc/preload. Squashed commit of the following: commit 106c815fffb8eb3efe00a27a5229cb1f8ffc9736 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:36:44 2018 +0300 Added NEWS entry commit 1dacd5e20b7043368ef9e80db296d1781134b6fd Merge: d516139abf ba99aa133c Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:33:37 2018 +0300 Merge branch 'master' into preload * master: Fixed issues related to optimization and persitence of classes linked with interfaces, traits or internal classes. Added possiblity to avoid signal handlers reinitialization on each request. commit d516139abf5ffbd495ee6037f1dc04a1cfe588a7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 16:13:15 2018 +0300 Override opcache.preload for testing commit 162b154d0bbfbaf8ef93975f7e56a1353236903d Merge: 45fdd034ce 8bda22592e Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 14 15:38:09 2018 +0300 Merge branch 'master' into preload * master: (34 commits) Eliminate useless $this related check Eliminate useless $this related checks Replace zend_parse_method_parameters() by zend_parse_parameters() and avoid useless checks. Replace getThis() by EX(This), when additional check is not necessary. Fixed tests Validate length on socket_write Fix compilation on x32 Fix #77141: Signedness issue in SOAP when precision=-1 Support SQLite3 @name notation Remove lexer files generated by RE2C Update libmagic.patch [ci skip] Update libmagic.patch [ci skip] Fork test with pcre.jit=0 Rework magic data Fix regex Fix regex Rework magic data Sync one more upstream libmagic piece Suppress already used warning Ignore getaddrinfo failed message ... commit 45fdd034ceceb68e8fb23bd6e70d627f17dfd411 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 9 13:07:03 2018 +0300 Properly resolve magic method of preloaded classes inherited from internal ones. commit 34645aeb4272b71a81a7e0d91f27eded557b78be Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 8 15:29:17 2018 +0300 Don't preload constants defined during preload script excution. commit cef0d67c3e5aac89b3d606fbd8d445225c07c83f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 7 15:56:54 2018 +0300 Support for class aliasses commit 08ffc9a552c7cf4fbff1a4b3d2de4e7c33f4120d Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 7 15:34:39 2018 +0300 Resolve constants only in linked classes commit 8d3429cda83c87646eef0006d5cda075f2400b24 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Nov 6 11:56:39 2018 +0300 Fixed preloading of references to internal classes. commit 7ae3a47d20e83f7d804506c6d50f6a392199260b Merge: 9b0a53ed1c 049f239cfc Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Nov 6 11:37:15 2018 +0300 Merge branch 'master' into preload * master: Update NEWS [ci skip] Update NEWS [ci skip] Update libmagic.patch [ci skip] Update libmagic.patch [ci skip] Declare function proto in header Declare function proto in header Fix #76825: Undefined symbols ___cpuid_count NEWS Fix: #77110 undefined symbol zend_string_equal_val in C++ build Fix #77105: Use position:sticky for <th> in `phpinfo()` Implement handling for JIT recognition when cross compiling Backport 7f5f4601 for 7.2 Fix #76348: WSDL_CACHE_MEMORY causes Segmentation fault Rework places in libmagic regarding previous CVE-2014-3538 fixes Change the way JIT availability is checked Fix a test for ldap extension Fixed bug #77092 Future-proof email addresses commit 9b0a53ed1cd5995efae0d71e1941d1db4ef6ba39 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 14:54:44 2018 +0300 We don't need preload_restart() here commit 0bd17bd43890423e1e98a5925f11cea93da3df55 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 14:44:30 2018 +0300 EG(*) may be not initializd at this point - use CG(*). commit b610467051d8a3687a60ffc2957bc353cb6b3bd4 Merge: 3a9d90f74a 67e0138c0d Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 2 11:33:37 2018 +0300 Merge branch 'master' into preload * master: Future-proof email addresses... Update email addresses. We're still @Zend, but future proofing it... commit 3a9d90f74a3d890cb59658d604d5a202e3aee256 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 15:19:48 2018 +0300 Fexed resolution of method clones commit aea85c65bd1795d0750dee6ac0e476acd2ac9dd7 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 11:45:50 2018 +0300 Prevent inlining of method copied from trait commit 36b644fbb738e7548ccb436e5d04d653d93cce14 Merge: 7a20781d2e b91690c892 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 1 10:56:02 2018 +0300 Merge branch 'master' into preload * master: Fix stray newline that caused this test to fail Fix session tests that fail if error_log is set This test needs to log to stdout Fix error condition Fixed bug #77081 ftruncate() changes seek pointer in c mode Fix and improve test case commit 7a20781d2ee694262f913a612d8b0b6a24ceff7b Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 31 00:52:46 2018 +0300 Added test commit 4a57b5d563f9c9616f3c236f57ccd09d8a66f146 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 31 00:50:21 2018 +0300 Fixed preloading of classes linked with traits commit 68c4f99e23695e74eafa43097ecab62392bad3ee Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 16:25:14 2018 +0300 Added test commit 38ab7ef4cf429dcfd5dfb18f844242cdf3a4d61f Merge: eb6e2c529f bf38e6c10a Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 16:14:39 2018 +0300 Merge branch 'master' into preload * master: Keep original value of "prototype" commit eb6e2c529f8cedf6823346387dd8b0ba6a4f045b Merge: 562049510f 2fefa8c61e Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 15:35:39 2018 +0300 Merge branch 'master' into preload * master: Call function_add_ref() in proper place Updated to version 2018.7 (2018g) Updated to version 2018.7 (2018g) Updated to version 2018.7 (2018g) Reslove inherited op_array references once afrer all optimizations. commit 562049510f605c21cd46fc3b6f97ed15bfe7b0dc Merge: e806cb732a 4828fb7b6b Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 30 10:29:49 2018 +0300 Merge branch 'master' into preload * master: [ci skip] Update NEWS [ci skip] Update NEWS [ci skip] Update NEWS fix bug #77079 Add missing null initialization Remove redundant mbfl_string_init calls Use zend_string for mbstring last encoding cache commit e806cb732a2a3f1e409528988a0571421c541078 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 22:32:15 2018 +0300 Fixed double-free commit 2f697ef8af0e7b21c47707b2d688880e8c987a8b Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 22:07:32 2018 +0300 typo commit c559f22b3e61b38761831d9610889d28ba6875e0 Merge: 310631cc05 ea2e67876a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 21:59:27 2018 +0300 Merge branch 'master' into preload * master: Stop Apache if PHP wasn't started successful. Execute zend_post_startup() with module_initialized flag set. Removed dead code Fix mb_strrpos() with encoding passed as 3rd param commit 310631cc0565ac87091c4f1a8a9f739a13e7e778 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 16:48:42 2018 +0300 Stop Apache if PHP wasn't started successful. commit 0a24d7ba8f3280507c9663b32e14030212cf8491 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 16:25:49 2018 +0300 Avoid use-after-free in main thread commit 17a3cb4a2ab271c2b2357c04e36efa64e02444ff Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 15:25:17 2018 +0300 Execute zend_post_startup() with module_initialized flag set. commit 6d4b22c518bec956e9632fad4329360304d17fd7 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 14:12:20 2018 +0300 Override SAPI.ub_write and SAPI.flush for preloading commit 386c9d3470168f70afe5d3b72a58ea0c0da1519c Merge: d7fbb4d402 359f19edc9 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 29 13:49:24 2018 +0300 Merge branch 'master' into preload * master: Optimize substr() edge-case conditions [ci skip] Update UPGRADING Fix #71592: External entity processing never fails Add TIDY_TAG_* constants supported by libtidy 5 Add is_iterable to opcache Optimizer commit d7fbb4d402a18c8fd1c49e0c92afd9f9e513bc7a Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 13:11:54 2018 +0300 Restore preload state if it was already loaded in another process. commit 0fe9ea1c07822b5d4672cece2c180bf9795e16e4 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 12:29:06 2018 +0300 Removed dead code commit 3a2d1bcc1fd27b6983522c262931fc0187c0afef Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 26 00:19:40 2018 +0300 Support for builds without ZEND_SIGNALS commit e6b76ecb4beea3b922bf7529050e3828f745dedb Merge: 4531fbf931 68694c9997 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 23:43:25 2018 +0300 Merge branch 'master' into preload * master: Don't wrap php_module_shutdown() with zend_try. executor_globals are released in ZTS build, and this leads to crash. [ci skip] Fix indentation in UPGRADING. commit 4531fbf9310bfb7bb579134cc84e8c10c5d42059 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 22:44:49 2018 +0300 Disable linking and preloading of classes those parent or one of interface or trait is an internal class. commit a594a618ce98242c1d273eb9ede75b4f6b4635d8 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 22:30:51 2018 +0300 Cleanup - remove useless ZCSG(saved_map_ptr_last) - move preloaded classes/functions clean-up code back into better place commit ab9a40f63cfa1a205b8f853b7e0c2ce61edabb32 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 20:52:51 2018 +0300 Added support for preloaded classes/functions in ZTS build commit e3c65db099517082b66dd20ea57e1bda649a7aa5 Merge: 4f57c1e029 33e777acbf Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 20:52:26 2018 +0300 Merge branch 'master' into preload * master: Improved shared interned strings handling. The previous implementation worked incorrectly in ZTS build. It changed strings only in function/class tables of one thread. Now all threads gets the same shared interned strings. Also, on shutdown, we don't try to replace SHM interned strings back to process strings, but delay dettachment of SHM instead. Don't use request heap at shutdown Don't optimize function if inference failed Fixed bug #77058 Improve "narrowing" error message bump versions commit 4f57c1e029ce9c24bd699ea61b05973c4665bc32 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 15:29:58 2018 +0300 Cleanup (move preload_shutdown() call to better place) commit 26587a95c071cf9dd098199eb3708fca8adae243 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 14:30:51 2018 +0300 eol commit d70cb10480fdc7d814495150cd48e43d4147138f Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 14:30:20 2018 +0300 cleanup commit aabe685dbb887e91c240b6c5553193889bcfc540 Merge: d9fc51bc3b 40808ac41e Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Oct 25 12:42:51 2018 +0300 Merge branch 'master' into preload * master: Remove unused var Remove ext/json parser files generated by bison Fix run-tests.php for running phpdbg and certain test sections Normalize .gitignore commit d9fc51bc3bdfbd7f4149a884b09e3c09a41f7a8d Merge: b5ffba0faf b6ef8998d5 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 15:59:24 2018 +0300 Merge branch 'master' into preload * master: Fixed reseting of interned strings buffer. commit b5ffba0fafb4d940336d5f5fe93950dad1d8d779 Merge: e4a7ef0c43 a404383118 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 12:46:28 2018 +0300 Merge branch 'master' into preload * master: Fixed build in directory different from source commit e4a7ef0c431ec97cdd00e44dfa0ef17887d1e5e3 Merge: 811f20aaa5 d1e14e2cc0 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 24 11:59:43 2018 +0300 Merge branch 'master' into preload * master: (29 commits) Make php_plain_files_wrapper to be writable (workaround for swoole) Remove phpdbg parser files generated by bison Fix conflicts in phpdbg parser Refetetch function name on exceptional path to allow better code on fast code path. fix typo in sysvsem.c Fixed bug #50675 bump to 7.2.13-dev [ci skip] Update NEWS wrt. php-7.3.0RC4 tagging Inlining in the most frequently used code paths Fixed test failurs introduced by 9c144e0d8217d1ef7a83c2498214308b21af749f Use persistent strings only for persistent connections Fix accessibility checks for dynamic properties Updated to version 2018.6 (2018f) Updated to version 2018.6 (2018f) Updated to version 2018.6 (2018f) Fix arginfo and clean up fpm_get_status Defragment two Zend related Makefile fragments together [ci skip] Remove automake and aclocal in comments Fix #75282: xmlrpc_encode_request() crashes Fix tests for ICU 63.1 ... commit 811f20aaa5030035666d9f325dd7c64632c70a50 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 22 14:10:49 2018 +0300 Added information about preloading to opcache_get_status() commit 093e8b1bbffdc07d217a543613ea14c3eeac710e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:46:23 2018 +0300 Added warning message commit a2ba970ce3d0ac51ebfbe1bfc2dc7b99b9750a75 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:35:40 2018 +0300 Added test commit b67e28367c11db50360e664a7ad6ac95b393f2e4 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:33:12 2018 +0300 Don't preload functions declared at run-time. commit b0139dc22854ee000586ef83c149d7d25181da60 Merge: a609520adb 3fe698b904 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Oct 19 13:23:14 2018 +0300 Merge branch 'master' into preload * master: Mark "top-level" functions. Don't initialize static_member_tables during start-up, when inherit internal classes. [ci skip] Update NEWS [ci skip] Update NEWS [ci skip] Update NEWS Fix #77035: The phpize and ./configure create redundant .deps file Remove outdated PEAR artefacts Fix tests/output/bug74815.phpt generating errors.log Revert "Use C++ symbols, when C++11 or upper is compiled" Use C++ symbols, when C++11 or upper is compiled Added new line Remove stamp-h Move all testing docs to qa.php.net Fix a typo in UPGRADING.INTERNALS Fix test when it's run on another drive [ci skip] Update UPGRADING wrt. tidyp support Fixed incorrect reallocation Fix #77027: tidy::getOptDoc() not available on Windows Run CI tests under opcache.protect_memory=1 commit a609520adbc0bf12701d467bae4a016fde43231e Merge: ac8f45f61b b6ac50f9e6 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 17:01:05 2018 +0300 Merge branch 'master' into preload * master: Fixed comment Micro optimizations Mark "top-level" classes commit ac8f45f61b561af9aee629232bc3705143ceaac3 Merge: 632b30b545 d57cd36e47 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 15:53:41 2018 +0300 Merge branch 'master' into preload * master: Immutable clases and op_arrays. commit 632b30b5451c8fdf0879a3ba4d937ff4ecfc8ce7 Merge: d33908a99a cd0c36c3f9 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 15:04:43 2018 +0300 Merge branch 'immutable' into preload * immutable: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit d33908a99a3c746f188e268df3db541591f6fcc2 Merge: 21e0bebca3 4740dabb84 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:14:23 2018 +0300 Merge branch 'immutable' into preload * immutable: Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit 21e0bebca3e6fff3c3484ee46f9aa3ac4e98eaeb Merge: c78277ae84 ad7a78b253 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 12:29:59 2018 +0300 Merge branch 'immutable' into preload * immutable: Added comment Added type cast Moved static class members initialization into the proper place. Removed redundand assertion Removed duplicate code Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. typo Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit c78277ae84b21067744d1701949e4e1fadd8872a Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 16 17:25:35 2018 +0300 Preloadsing support for opcache restart commit f76a955c02f6a033d4656d5e0d9dad9a8e83cc86 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Oct 16 13:52:36 2018 +0300 Fixed incorrect signal handlers overriding commit 0810ce0d8165d4b752267f035f9fa0aaa1698ceb Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:38:48 2018 +0300 An attempt to implemnt "preloading" ability. commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-11-14 21:46:05 +08:00
EG(zend_constants) = NULL;
2014-12-14 06:06:14 +08:00
executor_globals_ctor(executor_globals);
global_persistent_list = &EG(persistent_list);
2014-12-14 06:06:14 +08:00
zend_copy_ini_directives();
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
#else
global_map_ptr_last = CG(map_ptr_last);
2002-09-17 20:42:11 +08:00
#endif
return SUCCESS;
}
/* }}} */
2002-09-17 20:42:11 +08:00
2014-12-14 06:06:14 +08:00
void zend_shutdown(void) /* {{{ */
1999-04-08 02:10:10 +08:00
{
2018-02-19 21:42:02 +08:00
zend_vm_dtor();
2014-12-14 06:06:14 +08:00
zend_destroy_rsrc_list(&EG(persistent_list));
zend_destroy_modules();
2014-12-14 06:06:14 +08:00
virtual_cwd_deactivate();
virtual_cwd_shutdown();
zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
2001-12-26 19:18:00 +08:00
zend_hash_destroy(GLOBAL_CLASS_TABLE);
zend_hash_destroy(GLOBAL_AUTO_GLOBALS_TABLE);
free(GLOBAL_AUTO_GLOBALS_TABLE);
2005-01-10 00:18:39 +08:00
2014-12-14 06:06:14 +08:00
zend_shutdown_extensions();
1999-04-08 02:10:10 +08:00
free(zend_version_info);
2003-12-12 19:14:44 +08:00
free(GLOBAL_FUNCTION_TABLE);
free(GLOBAL_CLASS_TABLE);
zend_hash_destroy(GLOBAL_CONSTANTS_TABLE);
2003-12-12 16:25:58 +08:00
free(GLOBAL_CONSTANTS_TABLE);
zend_shutdown_strtod();
#ifdef ZTS
2003-12-12 18:50:23 +08:00
GLOBAL_FUNCTION_TABLE = NULL;
GLOBAL_CLASS_TABLE = NULL;
GLOBAL_AUTO_GLOBALS_TABLE = NULL;
GLOBAL_CONSTANTS_TABLE = NULL;
ts_free_id(executor_globals_id);
ts_free_id(compiler_globals_id);
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
#else
2020-01-13 19:27:35 +08:00
if (ZEND_MAP_PTR_REAL_BASE(CG(map_ptr_base))) {
free(ZEND_MAP_PTR_REAL_BASE(CG(map_ptr_base)));
ZEND_MAP_PTR_SET_REAL_BASE(CG(map_ptr_base), NULL);
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
CG(map_ptr_size) = 0;
}
#endif
zend_destroy_rsrc_list_dtors();
1999-04-08 02:10:10 +08:00
}
/* }}} */
1999-04-08 02:10:10 +08:00
void zend_set_utility_values(zend_utility_values *utility_values) /* {{{ */
{
zend_uv = *utility_values;
}
/* }}} */
1999-04-08 02:10:10 +08:00
/* this should be compatible with the standard zenderror */
ZEND_COLD void zenderror(const char *error) /* {{{ */
1999-04-08 02:10:10 +08:00
{
2017-09-24 14:53:27 +08:00
CG(parse_error) = 0;
if (EG(exception)) {
/* An exception was thrown in the lexer, don't throw another in the parser. */
return;
}
zend_throw_exception(zend_ce_parse_error, error, 0);
1999-04-08 02:10:10 +08:00
}
/* }}} */
1999-04-08 02:10:10 +08:00
BEGIN_EXTERN_C()
ZEND_API ZEND_COLD ZEND_NORETURN void _zend_bailout(const char *filename, uint32_t lineno) /* {{{ */
1999-04-08 02:10:10 +08:00
{
if (!EG(bailout)) {
2001-07-22 00:21:22 +08:00
zend_output_debug_string(1, "%s(%d) : Bailed out without a bailout address!", filename, lineno);
exit(-1);
}
2018-03-02 16:02:21 +08:00
gc_protect(1);
CG(unclean_shutdown) = 1;
CG(active_class_entry) = NULL;
CG(in_compilation) = 0;
EG(current_execute_data) = NULL;
LONGJMP(*EG(bailout), FAILURE);
1999-04-08 02:10:10 +08:00
}
/* }}} */
END_EXTERN_C()
1999-04-08 02:10:10 +08:00
ZEND_API void zend_append_version_info(const zend_extension *extension) /* {{{ */
1999-04-08 02:10:10 +08:00
{
char *new_info;
uint32_t new_info_length;
1999-04-08 02:10:10 +08:00
new_info_length = (uint32_t)(sizeof(" with v, , by \n")
1999-04-08 02:10:10 +08:00
+ strlen(extension->name)
+ strlen(extension->version)
+ strlen(extension->copyright)
2014-10-22 15:25:53 +08:00
+ strlen(extension->author));
1999-04-08 02:10:10 +08:00
new_info = (char *) malloc(new_info_length + 1);
1999-04-08 02:10:10 +08:00
snprintf(new_info, new_info_length, " with %s v%s, %s, by %s\n", extension->name, extension->version, extension->copyright, extension->author);
1999-04-08 02:10:10 +08:00
zend_version_info = (char *) realloc(zend_version_info, zend_version_info_length+new_info_length + 1);
strncat(zend_version_info, new_info, new_info_length);
1999-04-08 02:10:10 +08:00
zend_version_info_length += new_info_length;
free(new_info);
}
/* }}} */
1999-04-08 02:10:10 +08:00
ZEND_API const char *get_zend_version(void) /* {{{ */
1999-04-08 02:10:10 +08:00
{
return zend_version_info;
}
/* }}} */
2014-12-14 06:06:14 +08:00
ZEND_API void zend_activate(void) /* {{{ */
{
#ifdef ZTS
2014-12-14 06:06:14 +08:00
virtual_cwd_activate();
#endif
2014-12-14 06:06:14 +08:00
gc_reset();
init_compiler();
init_executor();
startup_scanner();
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
if (CG(map_ptr_last)) {
2020-01-13 19:27:35 +08:00
memset(ZEND_MAP_PTR_REAL_BASE(CG(map_ptr_base)), 0, CG(map_ptr_last) * sizeof(void*));
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
}
}
/* }}} */
2014-12-14 06:06:14 +08:00
void zend_call_destructors(void) /* {{{ */
{
zend_try {
2014-12-14 06:06:14 +08:00
shutdown_destructors();
} zend_end_try();
}
/* }}} */
2014-12-14 06:06:14 +08:00
ZEND_API void zend_deactivate(void) /* {{{ */
{
/* we're no longer executing anything */
EG(current_execute_data) = NULL;
zend_try {
2014-12-14 06:06:14 +08:00
shutdown_scanner();
} zend_end_try();
/* shutdown_executor() takes care of its own bailout handling */
2014-12-14 06:06:14 +08:00
shutdown_executor();
zend_try {
zend_ini_deactivate();
} zend_end_try();
zend_try {
2014-12-14 06:06:14 +08:00
shutdown_compiler();
} zend_end_try();
zend_destroy_rsrc_list(&EG(regular_list));
#if GC_BENCH
fprintf(stderr, "GC Statistics\n");
fprintf(stderr, "-------------\n");
fprintf(stderr, "Runs: %d\n", GC_G(gc_runs));
fprintf(stderr, "Collected: %d\n", GC_G(collected));
fprintf(stderr, "Root buffer length: %d\n", GC_G(root_buf_length));
fprintf(stderr, "Root buffer peak: %d\n\n", GC_G(root_buf_peak));
fprintf(stderr, " Possible Remove from Marked\n");
fprintf(stderr, " Root Buffered buffer grey\n");
fprintf(stderr, " -------- -------- ----------- ------\n");
fprintf(stderr, "ZVAL %8d %8d %9d %8d\n", GC_G(zval_possible_root), GC_G(zval_buffered), GC_G(zval_remove_from_buffer), GC_G(zval_marked_grey));
#endif
}
/* }}} */
2000-03-06 03:50:10 +08:00
2000-03-06 18:46:40 +08:00
BEGIN_EXTERN_C()
2014-12-14 06:06:14 +08:00
ZEND_API void zend_message_dispatcher(zend_long message, const void *data) /* {{{ */
2000-03-06 03:50:10 +08:00
{
if (zend_message_dispatcher_p) {
2014-12-14 06:06:14 +08:00
zend_message_dispatcher_p(message, data);
2000-03-06 03:50:10 +08:00
}
}
/* }}} */
2000-03-06 18:46:40 +08:00
END_EXTERN_C()
2000-03-06 03:50:10 +08:00
ZEND_API zval *zend_get_configuration_directive(zend_string *name) /* {{{ */
2000-03-06 03:50:10 +08:00
{
if (zend_get_configuration_directive_p) {
return zend_get_configuration_directive_p(name);
2000-03-06 03:50:10 +08:00
} else {
return NULL;
2000-03-06 03:50:10 +08:00
}
}
/* }}} */
#define SAVE_STACK(stack) do { \
if (CG(stack).top) { \
memcpy(&stack, &CG(stack), sizeof(zend_stack)); \
CG(stack).top = CG(stack).max = 0; \
CG(stack).elements = NULL; \
} else { \
stack.top = 0; \
} \
} while (0)
#define RESTORE_STACK(stack) do { \
if (stack.top) { \
zend_stack_destroy(&CG(stack)); \
memcpy(&CG(stack), &stack, sizeof(zend_stack)); \
} \
} while (0)
static ZEND_COLD void zend_error_va_list(
int orig_type, const char *error_filename, uint32_t error_lineno,
const char *format, va_list args)
{
va_list usr_copy;
zval params[4];
zval retval;
zval orig_user_error_handler;
zend_bool in_compilation;
zend_class_entry *saved_class_entry;
Squashed commit of the following: commit 03cf871f1576f08b2348c141b209894a7bf17a86 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:31 2015 +0300 Revert "Fixed bug #62210 (Exceptions can leak temporary variables. As a part of the fix serious refactoring was done. op_array->brk_cont_array was removed, and replaced with more general and speed efficient op_array->T_liveliness. ZEND_GOTO opcode is always replaced by ZEND_JMP at compile time). (Bob, Dmitry, Laruence)" This reverts commit 5ee841325901a4b040cfea56292a24702fe224d9. commit 285a68227ce3d380e821a24fa389aa5239bd3fe1 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:26 2015 +0300 Revert "Tuned off dubugging of live ranges" This reverts commit 404dc93d35f7061fc4b1b41ad6cb0721b9b52bcc. commit 93d9d11157301ee2ec99afb6f5744b126d17f637 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:17 2015 +0300 Revert "Remove loop_var_stack" This reverts commit b3a4c05071c3786e27e1326fa1b4d5acad62fccd. commit ede68ebbc284aec79e3f719f2c8dbf9da6907752 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:12 2015 +0300 Revert "ZEND_SEPARATE reuses temporaries" This reverts commit 1852f538b9f8d5e7d67fe5a4f6080396d8b10034. commit 96d8995dc1f517fb01b481736273767509f76c47 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:10 2015 +0300 Revert "Add assertion in liveliness computation" This reverts commit ed14019e8c0c852480eebc6fc552d8c3d939dce1. commit 0649d7bfef152e6cc8e67b922534e9946c634d9c Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:07 2015 +0300 Revert "Fixed invalid live-range detection" This reverts commit 54f367ee2a2e4cb7c952b17915c226fdc56038ab. commit dfe8f3851f6b04595eb089323e3492115a59363e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:04 2015 +0300 Revert "Add test guaranteeing that loop vars are only freed after potential return type exceptions" This reverts commit f5db5a558d550bf441373febebbb02f3884209d1. commit 52a94aad6f48a199358cc07f7e4f56bb73050504 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:01 2015 +0300 Revert "Fixed exception habdling on "return" statement." This reverts commit 17c5315bdf8f8087979aeb55f6d3a512ba197cf5. commit 6e90ad7331901711e89c2ceb2bcab5023e5cee60 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:44:58 2015 +0300 Revert "Fix too early terminated temporary range with break/cont/goto" This reverts commit cc876c04b420589cb1f62b650d0c0e24975dd4af. commit 7b766e44b1970e4031f75109c302c07ead2c05cb Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:44:55 2015 +0300 Revert "Fixed exception catching on break/continue" This reverts commit 8c3f701eebfa92d761bb368cfa8c2d1ccf821b9d.
2015-07-10 08:31:52 +08:00
zend_stack loop_var_stack;
zend_stack delayed_oplines_stack;
2018-10-02 23:47:07 +08:00
zend_class_entry *orig_fake_scope;
int type = orig_type & E_ALL;
/* Report about uncaught exception in case of fatal errors */
if (EG(exception)) {
zend_execute_data *ex;
const zend_op *opline;
switch (type) {
case E_CORE_ERROR:
case E_ERROR:
case E_RECOVERABLE_ERROR:
case E_PARSE:
case E_COMPILE_ERROR:
case E_USER_ERROR:
ex = EG(current_execute_data);
opline = NULL;
while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) {
ex = ex->prev_execute_data;
}
2014-07-07 19:50:44 +08:00
if (ex && ex->opline->opcode == ZEND_HANDLE_EXCEPTION &&
EG(opline_before_exception)) {
opline = EG(opline_before_exception);
}
2014-12-14 06:06:14 +08:00
zend_exception_error(EG(exception), E_WARNING);
EG(exception) = NULL;
if (opline) {
ex->opline = opline;
}
break;
default:
break;
}
}
2010-04-24 21:32:30 +08:00
#ifdef HAVE_DTRACE
if (DTRACE_ERROR_ENABLED()) {
2010-04-24 21:32:30 +08:00
char *dtrace_error_buffer;
zend_vspprintf(&dtrace_error_buffer, 0, format, args);
DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno);
2010-04-24 21:32:30 +08:00
efree(dtrace_error_buffer);
}
#endif /* HAVE_DTRACE */
/* if we don't have a user defined error handler */
if (Z_TYPE(EG(user_error_handler)) == IS_UNDEF
|| !(EG(user_error_handler_error_reporting) & type)
|| EG(error_handling) != EH_NORMAL) {
zend_error_cb(orig_type, error_filename, error_lineno, format, args);
} else switch (type) {
case E_ERROR:
case E_PARSE:
case E_CORE_ERROR:
case E_CORE_WARNING:
case E_COMPILE_ERROR:
case E_COMPILE_WARNING:
/* The error may not be safe to handle in user-space */
zend_error_cb(orig_type, error_filename, error_lineno, format, args);
break;
default:
/* Handle the error in user space */
va_copy(usr_copy, args);
2017-06-25 22:52:50 +08:00
ZVAL_STR(&params[1], zend_vstrpprintf(0, format, usr_copy));
va_end(usr_copy);
ZVAL_LONG(&params[0], type);
2000-06-29 06:08:47 +08:00
if (error_filename) {
ZVAL_STRING(&params[2], error_filename);
} else {
ZVAL_NULL(&params[2]);
2000-06-29 06:08:47 +08:00
}
ZVAL_LONG(&params[3], error_lineno);
2000-06-29 06:08:47 +08:00
ZVAL_COPY_VALUE(&orig_user_error_handler, &EG(user_error_handler));
ZVAL_UNDEF(&EG(user_error_handler));
2007-10-11 09:03:19 +08:00
/* User error handler may include() additinal PHP files.
* If an error was generated during comilation PHP will compile
* such scripts recursively, but some CG() variables may be
2007-10-11 09:03:19 +08:00
* inconsistent. */
in_compilation = CG(in_compilation);
if (in_compilation) {
saved_class_entry = CG(active_class_entry);
CG(active_class_entry) = NULL;
Squashed commit of the following: commit 03cf871f1576f08b2348c141b209894a7bf17a86 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:31 2015 +0300 Revert "Fixed bug #62210 (Exceptions can leak temporary variables. As a part of the fix serious refactoring was done. op_array->brk_cont_array was removed, and replaced with more general and speed efficient op_array->T_liveliness. ZEND_GOTO opcode is always replaced by ZEND_JMP at compile time). (Bob, Dmitry, Laruence)" This reverts commit 5ee841325901a4b040cfea56292a24702fe224d9. commit 285a68227ce3d380e821a24fa389aa5239bd3fe1 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:26 2015 +0300 Revert "Tuned off dubugging of live ranges" This reverts commit 404dc93d35f7061fc4b1b41ad6cb0721b9b52bcc. commit 93d9d11157301ee2ec99afb6f5744b126d17f637 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:17 2015 +0300 Revert "Remove loop_var_stack" This reverts commit b3a4c05071c3786e27e1326fa1b4d5acad62fccd. commit ede68ebbc284aec79e3f719f2c8dbf9da6907752 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:12 2015 +0300 Revert "ZEND_SEPARATE reuses temporaries" This reverts commit 1852f538b9f8d5e7d67fe5a4f6080396d8b10034. commit 96d8995dc1f517fb01b481736273767509f76c47 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:10 2015 +0300 Revert "Add assertion in liveliness computation" This reverts commit ed14019e8c0c852480eebc6fc552d8c3d939dce1. commit 0649d7bfef152e6cc8e67b922534e9946c634d9c Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:07 2015 +0300 Revert "Fixed invalid live-range detection" This reverts commit 54f367ee2a2e4cb7c952b17915c226fdc56038ab. commit dfe8f3851f6b04595eb089323e3492115a59363e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:04 2015 +0300 Revert "Add test guaranteeing that loop vars are only freed after potential return type exceptions" This reverts commit f5db5a558d550bf441373febebbb02f3884209d1. commit 52a94aad6f48a199358cc07f7e4f56bb73050504 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:01 2015 +0300 Revert "Fixed exception habdling on "return" statement." This reverts commit 17c5315bdf8f8087979aeb55f6d3a512ba197cf5. commit 6e90ad7331901711e89c2ceb2bcab5023e5cee60 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:44:58 2015 +0300 Revert "Fix too early terminated temporary range with break/cont/goto" This reverts commit cc876c04b420589cb1f62b650d0c0e24975dd4af. commit 7b766e44b1970e4031f75109c302c07ead2c05cb Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:44:55 2015 +0300 Revert "Fixed exception catching on break/continue" This reverts commit 8c3f701eebfa92d761bb368cfa8c2d1ccf821b9d.
2015-07-10 08:31:52 +08:00
SAVE_STACK(loop_var_stack);
SAVE_STACK(delayed_oplines_stack);
CG(in_compilation) = 0;
}
2018-10-02 23:47:07 +08:00
orig_fake_scope = EG(fake_scope);
EG(fake_scope) = NULL;
if (call_user_function(CG(function_table), NULL, &orig_user_error_handler, &retval, 4, params) == SUCCESS) {
if (Z_TYPE(retval) != IS_UNDEF) {
if (Z_TYPE(retval) == IS_FALSE) {
zend_error_cb(orig_type, error_filename, error_lineno, format, args);
}
2002-11-25 04:15:56 +08:00
zval_ptr_dtor(&retval);
}
} else if (!EG(exception)) {
/* The user error handler failed, use built-in error handler */
zend_error_cb(orig_type, error_filename, error_lineno, format, args);
}
2018-10-02 23:47:07 +08:00
EG(fake_scope) = orig_fake_scope;
if (in_compilation) {
CG(active_class_entry) = saved_class_entry;
Squashed commit of the following: commit 03cf871f1576f08b2348c141b209894a7bf17a86 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:31 2015 +0300 Revert "Fixed bug #62210 (Exceptions can leak temporary variables. As a part of the fix serious refactoring was done. op_array->brk_cont_array was removed, and replaced with more general and speed efficient op_array->T_liveliness. ZEND_GOTO opcode is always replaced by ZEND_JMP at compile time). (Bob, Dmitry, Laruence)" This reverts commit 5ee841325901a4b040cfea56292a24702fe224d9. commit 285a68227ce3d380e821a24fa389aa5239bd3fe1 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:26 2015 +0300 Revert "Tuned off dubugging of live ranges" This reverts commit 404dc93d35f7061fc4b1b41ad6cb0721b9b52bcc. commit 93d9d11157301ee2ec99afb6f5744b126d17f637 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:17 2015 +0300 Revert "Remove loop_var_stack" This reverts commit b3a4c05071c3786e27e1326fa1b4d5acad62fccd. commit ede68ebbc284aec79e3f719f2c8dbf9da6907752 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:12 2015 +0300 Revert "ZEND_SEPARATE reuses temporaries" This reverts commit 1852f538b9f8d5e7d67fe5a4f6080396d8b10034. commit 96d8995dc1f517fb01b481736273767509f76c47 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:10 2015 +0300 Revert "Add assertion in liveliness computation" This reverts commit ed14019e8c0c852480eebc6fc552d8c3d939dce1. commit 0649d7bfef152e6cc8e67b922534e9946c634d9c Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:07 2015 +0300 Revert "Fixed invalid live-range detection" This reverts commit 54f367ee2a2e4cb7c952b17915c226fdc56038ab. commit dfe8f3851f6b04595eb089323e3492115a59363e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:04 2015 +0300 Revert "Add test guaranteeing that loop vars are only freed after potential return type exceptions" This reverts commit f5db5a558d550bf441373febebbb02f3884209d1. commit 52a94aad6f48a199358cc07f7e4f56bb73050504 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:45:01 2015 +0300 Revert "Fixed exception habdling on "return" statement." This reverts commit 17c5315bdf8f8087979aeb55f6d3a512ba197cf5. commit 6e90ad7331901711e89c2ceb2bcab5023e5cee60 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:44:58 2015 +0300 Revert "Fix too early terminated temporary range with break/cont/goto" This reverts commit cc876c04b420589cb1f62b650d0c0e24975dd4af. commit 7b766e44b1970e4031f75109c302c07ead2c05cb Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Jul 10 02:44:55 2015 +0300 Revert "Fixed exception catching on break/continue" This reverts commit 8c3f701eebfa92d761bb368cfa8c2d1ccf821b9d.
2015-07-10 08:31:52 +08:00
RESTORE_STACK(loop_var_stack);
RESTORE_STACK(delayed_oplines_stack);
CG(in_compilation) = 1;
}
zval_ptr_dtor(&params[2]);
zval_ptr_dtor(&params[1]);
if (Z_TYPE(EG(user_error_handler)) == IS_UNDEF) {
ZVAL_COPY_VALUE(&EG(user_error_handler), &orig_user_error_handler);
} else {
zval_ptr_dtor(&orig_user_error_handler);
}
break;
}
if (type == E_PARSE) {
/* eval() errors do not affect exit_status */
if (!(EG(current_execute_data) &&
2014-07-07 19:50:44 +08:00
EG(current_execute_data)->func &&
ZEND_USER_CODE(EG(current_execute_data)->func->type) &&
EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL &&
EG(current_execute_data)->opline->extended_value == ZEND_EVAL)) {
EG(exit_status) = 255;
}
}
}
/* }}} */
2019-05-31 17:09:06 +08:00
static ZEND_COLD void get_filename_lineno(int type, const char **filename, uint32_t *lineno) {
/* Obtain relevant filename and lineno */
switch (type) {
case E_CORE_ERROR:
case E_CORE_WARNING:
*filename = NULL;
*lineno = 0;
break;
case E_PARSE:
case E_COMPILE_ERROR:
case E_COMPILE_WARNING:
case E_ERROR:
case E_NOTICE:
case E_STRICT:
case E_DEPRECATED:
case E_WARNING:
case E_USER_ERROR:
case E_USER_WARNING:
case E_USER_NOTICE:
case E_USER_DEPRECATED:
case E_RECOVERABLE_ERROR:
if (zend_is_compiling()) {
*filename = ZSTR_VAL(zend_get_compiled_filename());
*lineno = zend_get_compiled_lineno();
} else if (zend_is_executing()) {
*filename = zend_get_executed_filename();
if ((*filename)[0] == '[') { /* [no active file] */
*filename = NULL;
*lineno = 0;
} else {
*lineno = zend_get_executed_lineno();
}
} else {
*filename = NULL;
*lineno = 0;
}
break;
default:
*filename = NULL;
*lineno = 0;
break;
}
if (!*filename) {
*filename = "Unknown";
}
}
ZEND_API ZEND_COLD void zend_error_at(
int type, const char *filename, uint32_t lineno, const char *format, ...) {
va_list args;
if (!filename) {
uint32_t dummy_lineno;
get_filename_lineno(type, &filename, &dummy_lineno);
}
va_start(args, format);
zend_error_va_list(type, filename, lineno, format, args);
va_end(args);
}
ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) {
const char *filename;
uint32_t lineno;
va_list args;
get_filename_lineno(type, &filename, &lineno);
va_start(args, format);
zend_error_va_list(type, filename, lineno, format, args);
va_end(args);
}
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn(
int type, const char *filename, uint32_t lineno, const char *format, ...)
{
va_list args;
if (!filename) {
uint32_t dummy_lineno;
get_filename_lineno(type, &filename, &dummy_lineno);
}
va_start(args, format);
zend_error_va_list(type, filename, lineno, format, args);
va_end(args);
/* Should never reach this. */
abort();
}
/* }}} */
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...)
{
const char *filename;
uint32_t lineno;
va_list args;
get_filename_lineno(type, &filename, &lineno);
va_start(args, format);
zend_error_va_list(type, filename, lineno, format, args);
va_end(args);
/* Should never reach this. */
abort();
}
2014-09-20 13:51:58 +08:00
/* }}} */
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) /* {{{ */
{
va_list va;
char *message = NULL;
2015-07-08 00:37:33 +08:00
if (exception_ce) {
if (!instanceof_function(exception_ce, zend_ce_error)) {
zend_error(E_NOTICE, "Error exceptions must be derived from Error");
exception_ce = zend_ce_error;
}
} else {
exception_ce = zend_ce_error;
}
2015-07-04 05:04:33 +08:00
/* Marker used to disable exception generation during preloading. */
if (EG(exception) == (void*)(uintptr_t)-1) {
return;
}
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
2015-07-08 00:37:33 +08:00
//TODO: we can't convert compile-time errors to exceptions yet???
2015-07-04 05:04:33 +08:00
if (EG(current_execute_data) && !CG(in_compilation)) {
zend_throw_exception(exception_ce, message, 0);
2015-07-04 05:04:33 +08:00
} else {
2015-11-12 14:51:19 +08:00
zend_error(E_ERROR, "%s", message);
}
2015-07-04 05:04:33 +08:00
efree(message);
va_end(va);
}
/* }}} */
ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) /* {{{ */
{
va_list va;
char *message = NULL;
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
zend_throw_exception(zend_ce_type_error, message, 0);
efree(message);
va_end(va);
} /* }}} */
ZEND_API ZEND_COLD void zend_argument_count_error(const char *format, ...) /* {{{ */
{
va_list va;
char *message = NULL;
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
zend_throw_exception(zend_ce_argument_count_error, message, 0);
efree(message);
va_end(va);
} /* }}} */
ZEND_API ZEND_COLD void zend_value_error(const char *format, ...) /* {{{ */
{
va_list va;
char *message = NULL;
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
zend_throw_exception(zend_ce_value_error, message, 0);
efree(message);
va_end(va);
} /* }}} */
ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
{
#if ZEND_DEBUG
va_list args;
va_start(args, format);
2000-06-03 15:34:20 +08:00
# ifdef ZEND_WIN32
{
char output_buf[1024];
vsnprintf(output_buf, 1024, format, args);
OutputDebugString(output_buf);
OutputDebugString("\n");
if (trigger_break && IsDebuggerPresent()) {
DebugBreak();
}
}
# else
vfprintf(stderr, format, args);
fprintf(stderr, "\n");
# endif
va_end(args);
#endif
}
/* }}} */
2019-05-31 17:09:06 +08:00
ZEND_API ZEND_COLD void zend_user_exception_handler(void) /* {{{ */
{
2019-05-31 17:09:06 +08:00
zval orig_user_exception_handler;
zval params[1], retval2;
zend_object *old_exception;
old_exception = EG(exception);
EG(exception) = NULL;
ZVAL_OBJ(&params[0], old_exception);
ZVAL_COPY_VALUE(&orig_user_exception_handler, &EG(user_exception_handler));
if (call_user_function(CG(function_table), NULL, &orig_user_exception_handler, &retval2, 1, params) == SUCCESS) {
zval_ptr_dtor(&retval2);
if (EG(exception)) {
OBJ_RELEASE(EG(exception));
EG(exception) = NULL;
}
2019-05-31 17:09:06 +08:00
OBJ_RELEASE(old_exception);
} else {
EG(exception) = old_exception;
}
} /* }}} */
2014-12-14 06:06:14 +08:00
ZEND_API int zend_execute_scripts(int type, zval *retval, int file_count, ...) /* {{{ */
{
va_list files;
int i;
zend_file_handle *file_handle;
zend_op_array *op_array;
int ret = SUCCESS;
va_start(files, file_count);
for (i = 0; i < file_count && ret != FAILURE; i++) {
file_handle = va_arg(files, zend_file_handle *);
if (!file_handle) {
continue;
}
2015-01-03 17:22:58 +08:00
2014-12-14 06:06:14 +08:00
op_array = zend_compile_file(file_handle, type);
if (file_handle->opened_path) {
zend_hash_add_empty_element(&EG(included_files), file_handle->opened_path);
}
2014-12-14 06:06:14 +08:00
zend_destroy_file_handle(file_handle);
if (op_array) {
2014-12-14 06:06:14 +08:00
zend_execute(op_array, retval);
zend_exception_restore();
2019-05-31 17:09:06 +08:00
if (UNEXPECTED(EG(exception))) {
if (Z_TYPE(EG(user_exception_handler)) != IS_UNDEF) {
zend_user_exception_handler();
}
if (EG(exception)) {
zend_exception_error(EG(exception), E_ERROR);
ret = FAILURE;
2019-05-31 17:09:06 +08:00
}
2001-08-31 21:11:52 +08:00
}
2014-12-14 06:06:14 +08:00
destroy_op_array(op_array);
efree_size(op_array, sizeof(zend_op_array));
} else if (type==ZEND_REQUIRE) {
ret = FAILURE;
}
}
va_end(files);
return ret;
}
/* }}} */
#define COMPILED_STRING_DESCRIPTION_FORMAT "%s(%d) : %s"
2014-12-14 06:06:14 +08:00
ZEND_API char *zend_make_compiled_string_description(const char *name) /* {{{ */
{
const char *cur_filename;
int cur_lineno;
char *compiled_string_description;
2014-12-14 06:06:14 +08:00
if (zend_is_compiling()) {
cur_filename = ZSTR_VAL(zend_get_compiled_filename());
2014-12-14 06:06:14 +08:00
cur_lineno = zend_get_compiled_lineno();
} else if (zend_is_executing()) {
cur_filename = zend_get_executed_filename();
cur_lineno = zend_get_executed_lineno();
} else {
cur_filename = "Unknown";
cur_lineno = 0;
}
zend_spprintf(&compiled_string_description, 0, COMPILED_STRING_DESCRIPTION_FORMAT, cur_filename, cur_lineno, name);
return compiled_string_description;
}
/* }}} */
void free_estring(char **str_p) /* {{{ */
2001-01-15 18:52:06 +08:00
{
efree(*str_p);
}
2014-09-20 13:51:58 +08:00
/* }}} */
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
ZEND_API void zend_map_ptr_reset(void)
{
CG(map_ptr_last) = global_map_ptr_last;
}
ZEND_API void *zend_map_ptr_new(void)
{
void **ptr;
if (CG(map_ptr_last) >= CG(map_ptr_size)) {
#if ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR
// TODO: error ???
ZEND_ASSERT(0);
#elif ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR_OR_OFFSET
/* Grow map_ptr table */
CG(map_ptr_size) = ZEND_MM_ALIGNED_SIZE_EX(CG(map_ptr_last) + 1, 4096);
2020-01-13 19:27:35 +08:00
ZEND_MAP_PTR_SET_REAL_BASE(CG(map_ptr_base), perealloc(ZEND_MAP_PTR_REAL_BASE(CG(map_ptr_base)), CG(map_ptr_size) * sizeof(void*), 1));
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
#else
# error "Unknown ZEND_MAP_PTR_KIND"
#endif
}
2020-01-13 19:27:35 +08:00
ptr = (void**)ZEND_MAP_PTR_REAL_BASE(CG(map_ptr_base)) + CG(map_ptr_last);
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
*ptr = NULL;
CG(map_ptr_last)++;
#if ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR
return ptr;
#elif ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR_OR_OFFSET
return ZEND_MAP_PTR_PTR2OFFSET(ptr);
#else
# error "Unknown ZEND_MAP_PTR_KIND"
#endif
}
ZEND_API void zend_map_ptr_extend(size_t last)
{
if (last > CG(map_ptr_last)) {
void **ptr;
if (last >= CG(map_ptr_size)) {
#if ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR
/* This may never happen */
ZEND_ASSERT(0);
#elif ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR_OR_OFFSET
/* Grow map_ptr table */
CG(map_ptr_size) = ZEND_MM_ALIGNED_SIZE_EX(last, 4096);
2020-01-13 19:27:35 +08:00
ZEND_MAP_PTR_SET_REAL_BASE(CG(map_ptr_base), perealloc(ZEND_MAP_PTR_REAL_BASE(CG(map_ptr_base)), CG(map_ptr_size) * sizeof(void*), 1));
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
#else
# error "Unknown ZEND_MAP_PTR_KIND"
#endif
}
2020-01-13 19:27:35 +08:00
ptr = (void**)ZEND_MAP_PTR_REAL_BASE(CG(map_ptr_base)) + CG(map_ptr_last);
Immutable clases and op_arrays. Squashed commit of the following: commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9 Merge: 4740dabb84 ad6738e886 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:43:38 2018 +0300 Merge branch 'master' into immutable * master: Remove the "auto" encoding Fixed bug #77025 Add vtbls for EUC-TW encoding commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 14:12:28 2018 +0300 Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes. commit ad7a78b253be970db70c2251e66f9297d8e7f829 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:46:30 2018 +0300 Added comment commit 0276ea51875bab37be01a4dc5e5a047c5698c571 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:42:43 2018 +0300 Added type cast commit c63fc5d5f19c58498108d1698055b2b442227eb3 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:36:51 2018 +0300 Moved static class members initialization into the proper place. commit b945548e9306b1826c881918858b5e5aa3eb3002 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:21:03 2018 +0300 Removed redundand assertion commit d5a41088401814c829847db212488f8aae39bcd2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:19:13 2018 +0300 Removed duplicate code commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 11:05:43 2018 +0300 Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros. commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:48:29 2018 +0300 typo commit a06f0f3d3aba53e766046221ee44fb9720389ecc Merge: 94099586ec 3412345ffe Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Oct 17 10:47:07 2018 +0300 Merge branch 'master' into immutable * master: Remove unused variable makefile_am_files Classify object handlers are required/optional Add support for getting SKIP_TAGSTART and SKIP_WHITE options Remove some obsolete config_vars.mk occurrences Remove bsd_converted from .gitignore Remove configuration parser and scanners ignores Remove obsolete buildconf.stamp from .gitignore [ci skip] Add magicdata.patch exception to .gitignore Remove outdated ext/spl/examples items from .gitignore Remove unused test.inc in ext/iconv/tests commit 94099586ec599117581ca01c15b1f6c5f749e23a Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Oct 15 23:34:01 2018 +0300 Immutable clases and op_arrays
2018-10-17 20:52:50 +08:00
memset(ptr, 0, (last - CG(map_ptr_last)) * sizeof(void*));
CG(map_ptr_last) = last;
}
}