com php-src: Fixed is_callable/function_exists with dis able_functions: Zend/tests/bug69315.phpt ex t/opcache/Optimizer/pass1_5.c
| From: | Xinchen Hui | Date: | Sat, 28 Mar 2015 09:07:11 +0000 |
| Subject: | com php-src: Fixed is_callable/function_exists with dis able_functions: Zend/tests/bug69315.phpt ex t/opcache/Optimizer/pass1_5.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85901@lists.php.net to get a copy of this message | ||
Commit: 5c31c8c6e5118892537dca319a9fd2d23b95d0da
Author: Xinchen Hui <laruence@php.net> Sat, 28 Mar 2015 17:07:11 +0800
Parents: 193de2a679f274069714551b0616c6bd9684227b
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5c31c8c6e5118892537dca319a9fd2d23b95d0da
Log:
Fixed is_callable/function_exists with disable_functions
Changed paths:
M Zend/tests/bug69315.phpt
M ext/opcache/Optimizer/pass1_5.c
Diff:
diff --git a/Zend/tests/bug69315.phpt b/Zend/tests/bug69315.phpt
index 91f7ad8..71dac42 100644
--- a/Zend/tests/bug69315.phpt
+++ b/Zend/tests/bug69315.phpt
@@ -1,7 +1,7 @@
--TEST--
Bug #69315 (disable_functions behaviors inconsistently)
--INI--
-disable_functions=strlen,defined,call_user_func,constant,is_callable,is_string
+disable_functions=strlen,defined,call_user_func,constant,is_string
--FILE--
<?php
diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c
index ef62d99..c042940 100644
--- a/ext/opcache/Optimizer/pass1_5.c
+++ b/ext/opcache/Optimizer/pass1_5.c
@@ -431,10 +431,12 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx)
Z_TYPE(ZEND_OP1_LITERAL(send1_opline)) == IS_STRING) {
if ((Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("function_exists")-1
&&
!memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
- "function_exists", sizeof("function_exists")-1)) ||
+ "function_exists", sizeof("function_exists")-1) &&
+ !zend_optimizer_is_disabled_func("function_exists",
sizeof("function_exists") - 1)) ||
(Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("is_callable")-1 &&
!memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
- "is_callable", sizeof("is_callable")))) {
+ "is_callable", sizeof("is_callable")) &&
+ !zend_optimizer_is_disabled_func("is_callable", sizeof("is_callable") -
1))) {
zend_internal_function *func;
zend_string *lc_name = zend_string_tolower(
Z_STR(ZEND_OP1_LITERAL(send1_opline)));