From 4531fbf9310bfb7bb579134cc84e8c10c5d42059 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 25 Oct 2018 22:44:49 +0300 Subject: [PATCH] Disable linking and preloading of classes those parent or one of interface or trait is an internal class. --- ext/opcache/ZendAccelerator.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 9cd932028f4..4137955711f 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -3238,6 +3238,10 @@ static void preload_link(void) parent = zend_hash_find_ptr(EG(class_table), key); zend_string_release(key); if (!parent) continue; +#ifdef ZEND_WIN32 + /* On Windows we can't link with internal class, because of ASLR */ + if (parent->type == ZEND_INTERNAL_CLASS) continue; +#endif } if (ce->num_interfaces) { @@ -3248,6 +3252,13 @@ static void preload_link(void) found = 0; break; } +#ifdef ZEND_WIN32 + /* On Windows we can't link with internal class, because of ASLR */ + if (p->type == ZEND_INTERNAL_CLASS) { + found = 0; + break; + } +#endif } if (!found) continue; } @@ -3260,6 +3271,13 @@ static void preload_link(void) found = 0; break; } +#ifdef ZEND_WIN32 + /* On Windows we can't link with internal class, because of ASLR */ + if (p->type == ZEND_INTERNAL_CLASS) { + found = 0; + break; + } +#endif } if (!found) continue; }