Skip to content

Commit ee1e67f

Browse files
committed
On Windows PHP may be restarted with different set of DSO extensions without SHM reset.
This may make optimisation for entities from DSO extensions inconsistent.
1 parent 2e85e6d commit ee1e67f

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

ext/opcache/Optimizer/pass1_5.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,13 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
376376
Z_STRVAL(ZEND_OP1_LITERAL(opline - 1)), Z_STRLEN(ZEND_OP1_LITERAL(opline - 1)));
377377

378378
if (zend_hash_find(EG(function_table), lc_name, Z_STRLEN(ZEND_OP1_LITERAL(opline - 1)) + 1,
379-
(void *)&func) == SUCCESS &&
380-
func->type == ZEND_INTERNAL_FUNCTION &&
381-
func->module->type == MODULE_PERSISTENT) {
379+
(void *)&func) == SUCCESS
380+
&& func->type == ZEND_INTERNAL_FUNCTION
381+
&& func->module->type == MODULE_PERSISTENT
382+
#ifdef ZEND_WIN32
383+
&& func->module->handle == NULL
384+
#endif
385+
) {
382386
zval t;
383387
if (Z_STRLEN(ZEND_OP1_LITERAL(opline)) == sizeof("is_callable") - 1 ||
384388
func->handler != ZEND_FN(display_disabled_function)) {
@@ -412,7 +416,11 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
412416
ZVAL_BOOL(&t, 0);
413417
}
414418
} else {
415-
if (m->type == MODULE_PERSISTENT) {
419+
if (m->type == MODULE_PERSISTENT
420+
#ifdef ZEND_WIN32
421+
&& m->handle == NULL
422+
#endif
423+
) {
416424
ZVAL_BOOL(&t, 1);
417425
} else {
418426
break;

0 commit comments

Comments
 (0)