com php-src: Fixed Bug #69297 (function_exists strange behavior with OPCache on disabled function): NE WS ext/opcache/Optimizer/pass1_5.c

From: Date: Wed, 25 Mar 2015 15:29:18 +0000
Subject: com php-src: Fixed Bug #69297 (function_exists strange behavior with OPCache on disabled function): NE WS ext/opcache/Optimizer/pass1_5.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85875@lists.php.net to get a copy of this message
Commit: e46e9a3d22c22ec567423c25f83a6fd7f9655c52 Author: Xinchen Hui <laruence@php.net> Wed, 25 Mar 2015 23:27:50 +0800 Parents: 7461c5224880f3b476b46b6568e2acf61ce3d13d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e46e9a3d22c22ec567423c25f83a6fd7f9655c52 Log: Fixed Bug #69297 (function_exists strange behavior with OPCache on disabled function) is_callable returns true for disable_functions, but function_exists return false for it. Bugs: https://bugs.php.net/69297 Changed paths: M NEWS M ext/opcache/Optimizer/pass1_5.c Diff: diff --git a/NEWS b/NEWS index 7760da0..4244c8b 100644 --- a/NEWS +++ b/NEWS @@ -34,6 +34,10 @@ PHP NEWS . Fixed bug #69203 (FILTER_FLAG_STRIP_HIGH doesn't strip ASCII 127).. (Jeff Welch) +- Opcache: + . Fixed bug #69297 (function_exists strange behavior with OPCache on + disabled function). (Laruence) + - OpenSSL . Fixed bugs #68853, #65137 (Buffered crypto stream data breaks IO polling in stream_select() contexts) (Chris Wright) diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 731040e..79416cc 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -380,7 +380,13 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { func->type == ZEND_INTERNAL_FUNCTION && func->module->type == MODULE_PERSISTENT) { zval t; - ZVAL_BOOL(&t, 1); + if ((Z_STRLEN(ZEND_OP1_LITERAL(opline)) == sizeof("is_callable")-1 && + !memcmp(Z_STRVAL(ZEND_OP1_LITERAL(opline)), "is_callable", sizeof("is_callable"))) || + func->handler != ZEND_FN(display_disabled_function)) { + ZVAL_BOOL(&t, 1); + } else { + ZVAL_BOOL(&t, 0); + } if (replace_var_by_const(op_array, opline + 1, ZEND_RESULT(opline).var, &t TSRMLS_CC)) { literal_dtor(&ZEND_OP1_LITERAL(opline - 1)); MAKE_NOP((opline - 1));

« previous php.cvs (#85875) next »