]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 6 Jan 2020 21:42:31 +0000 (22:42 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 6 Jan 2020 21:42:31 +0000 (22:42 +0100)
* PHP-7.4:
  Remove support for preloading on Windows

1  2 
ext/opcache/ZendAccelerator.c
ext/opcache/tests/preload_009.phpt
ext/opcache/tests/preload_011.phpt
ext/opcache/tests/preload_012.phpt
ext/opcache/tests/preload_loadable_classes_2.phpt

index d320d674c8c951ee76ee5998a06d60f3c33f254b,e19980ab05bd8452a34d160800d4318677d4665a..8f0890401b9f7cc3fa477e7b492ec61ff56a2e26
@@@ -3565,32 -3493,6 +3558,26 @@@ static zend_bool preload_try_resolve_co
        return ok;
  }
  
- #ifdef ZEND_WIN32
-       /* On Windows we can't link with internal class, because of ASLR */
-       if (ce->type == ZEND_INTERNAL_CLASS) {
-               return NULL;
-       }
- #endif
 +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;
 +      }
 +      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;
Simple merge
Simple merge
index 4758296dcb53d0fe25a09069b08c96f4feb1d4c0,bd3fd81bbd7b0cd8edaf02d5025992fd76ada447..7c5ad9aa1a75499dcd4a3e8e6dc16f749a2afb1c
@@@ -6,7 -6,12 +6,10 @@@ opcache.enable_cli=
  opcache.optimization_level=-1
  opcache.preload={PWD}/preload_const_autoload.inc
  --SKIPIF--
- <?php require_once('skipif.inc'); ?>
+ <?php
+ require_once('skipif.inc');
+ if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
+ ?>
  --FILE--
 -===DONE===
  --EXPECTF--
  Warning: Can't preload class Test with unresolved initializer for constant C in %s on line %d
 -===DONE===