From: Nikita Popov Date: Mon, 6 Jan 2020 21:42:31 +0000 (+0100) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b6c0bdcd6f29a00d0f3659ecc95898d90cadad1;p=php Merge branch 'PHP-7.4' * PHP-7.4: Remove support for preloading on Windows --- 9b6c0bdcd6f29a00d0f3659ecc95898d90cadad1 diff --cc ext/opcache/ZendAccelerator.c index d320d674c8,e19980ab05..8f0890401b --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@@ -3565,32 -3493,6 +3558,26 @@@ static zend_bool preload_try_resolve_co return ok; } +static zend_class_entry *preload_fetch_resolved_ce(zend_string *name, zend_class_entry *self_ce) { + zend_string *lcname = zend_string_tolower(name); + zend_class_entry *ce = zend_hash_find_ptr(EG(class_table), lcname); + zend_string_release(lcname); + if (!ce) { + return NULL; + } + if (ce == self_ce) { + /* Ignore the following requirements if this is the class referring to itself */ + return ce; + } - #ifdef ZEND_WIN32 - /* On Windows we can't link with internal class, because of ASLR */ - if (ce->type == ZEND_INTERNAL_CLASS) { - return NULL; - } - #endif + if (!(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) { + return NULL; + } + if (!(ce->ce_flags & ZEND_ACC_PROPERTY_TYPES_RESOLVED)) { + return NULL; + } + return ce; +} + static zend_bool preload_try_resolve_property_types(zend_class_entry *ce) { zend_bool ok = 1; diff --cc ext/opcache/tests/preload_012.phpt index 4758296dcb,bd3fd81bbd..7c5ad9aa1a --- a/ext/opcache/tests/preload_012.phpt +++ b/ext/opcache/tests/preload_012.phpt @@@ -6,7 -6,12 +6,10 @@@ opcache.enable_cli= opcache.optimization_level=-1 opcache.preload={PWD}/preload_const_autoload.inc --SKIPIF-- - + --FILE-- -===DONE=== --EXPECTF-- Warning: Can't preload class Test with unresolved initializer for constant C in %s on line %d -===DONE===