From ee1e67fae6f649894721a5293ad9ab290add121f Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 29 Jun 2015 17:45:56 +0300 Subject: [PATCH] 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. --- ext/opcache/Optimizer/pass1_5.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index f4091921b3..4ed3dd4c85 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -376,9 +376,13 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { Z_STRVAL(ZEND_OP1_LITERAL(opline - 1)), Z_STRLEN(ZEND_OP1_LITERAL(opline - 1))); if (zend_hash_find(EG(function_table), lc_name, Z_STRLEN(ZEND_OP1_LITERAL(opline - 1)) + 1, - (void *)&func) == SUCCESS && - func->type == ZEND_INTERNAL_FUNCTION && - func->module->type == MODULE_PERSISTENT) { + (void *)&func) == SUCCESS + && func->type == ZEND_INTERNAL_FUNCTION + && func->module->type == MODULE_PERSISTENT +#ifdef ZEND_WIN32 + && func->module->handle == NULL +#endif + ) { zval t; if (Z_STRLEN(ZEND_OP1_LITERAL(opline)) == sizeof("is_callable") - 1 || func->handler != ZEND_FN(display_disabled_function)) { @@ -412,7 +416,11 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { ZVAL_BOOL(&t, 0); } } else { - if (m->type == MODULE_PERSISTENT) { + if (m->type == MODULE_PERSISTENT +#ifdef ZEND_WIN32 + && m->handle == NULL +#endif + ) { ZVAL_BOOL(&t, 1); } else { break; -- 2.50.0