com php-src: Merge branch 'PHP-7.4': ext/opcache/Optimizer/zend _func_info.c ext/zend_test/test.c
| From: | Nikita Popov | Date: | Fri, 25 Oct 2019 10:53:24 +0000 |
| Subject: | com php-src: Merge branch 'PHP-7.4': ext/opcache/Optimizer/zend _func_info.c ext/zend_test/test.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-109061@lists.php.net to get a copy of this message | ||
Commit: 7d056fc6c0d06ce1f84c5bc0c310f04b43c5de14
Author: Nikita Popov <nikita.ppv@gmail.com> Fri, 25 Oct 2019 12:53:24 +0200
Parents: 225a02f3d6f9db62966e57b248b8b4e68a5d4c2d 4d8541debbc4f2387879a872b42604ed8b908f58
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7d056fc6c0d06ce1f84c5bc0c310f04b43c5de14
Log:
Merge branch 'PHP-7.4'
* PHP-7.4:
Fixed bug #78747
Bugs:
https://bugs.php.net/78747
Changed paths:
MM ext/opcache/Optimizer/zend_func_info.c
MM ext/zend_test/test.c
Diff:
diff --cc ext/opcache/Optimizer/zend_func_info.c
index 96fe6594f93,5c7a30a9f50..1aa590c389b
--- a/ext/opcache/Optimizer/zend_func_info.c
+++ b/ext/opcache/Optimizer/zend_func_info.c
@@@ -1222,11 -1631,10 +1222,11 @@@ uint32_t zend_get_func_info(const zend_
if (callee_func->type == ZEND_INTERNAL_FUNCTION) {
zval *zv;
- func_info_t *info;
+ zend_string *lcname = Z_STR_P(CRT_CONSTANT_EX(call_info->caller_op_array,
call_info->caller_init_opline, call_info->caller_init_opline->op2));
- zv = zend_hash_find_ex(&func_info, lcname, 1);
- if (zv) {
- if (!call_info->callee_func->common.scope && (zv =
zend_hash_find_ex(&func_info, Z_STR_P(CRT_CONSTANT_EX(call_info->caller_op_array,
call_info->caller_init_opline, call_info->caller_init_opline->op2, ssa->rt_constants)),
1))) {
- info = Z_PTR_P(zv);
++ if (!call_info->callee_func->common.scope
++ && (zv = zend_hash_find_ex(&func_info, lcname, 1))) {
+ func_info_t *info = Z_PTR_P(zv);
if (UNEXPECTED(zend_optimizer_is_disabled_func(info->name, info->name_len))) {
ret = MAY_BE_NULL;
} else if (info->info_func) {
diff --cc ext/zend_test/test.c
index 8f2e104d1ea,ad5f2fb4467..cdff844ea9e
--- a/ext/zend_test/test.c
+++ b/ext/zend_test/test.c
@@@ -168,22 -159,20 +168,25 @@@ static zend_function *zend_test_class_m
/* }}} */
static zend_function *zend_test_class_static_method_get(zend_class_entry *ce, zend_string *name)
/* {{{ */ {
- zend_internal_function *fptr;
-
- if (EXPECTED(EG(trampoline).common.function_name == NULL)) {
- fptr = (zend_internal_function *) &EG(trampoline);
- } else {
- fptr = emalloc(sizeof(zend_internal_function));
+ if (zend_string_equals_literal_ci(name, "test")) {
- zend_internal_function *fptr = emalloc(sizeof(zend_internal_function));
- fptr->type = ZEND_OVERLOADED_FUNCTION;
++ zend_internal_function *fptr;
++
++ if (EXPECTED(EG(trampoline).common.function_name == NULL)) {
++ fptr = (zend_internal_function *) &EG(trampoline);
++ } else {
++ fptr = emalloc(sizeof(zend_internal_function));
++ }
++ memset(fptr, 0, sizeof(zend_internal_function));
++ fptr->type = ZEND_INTERNAL_FUNCTION;
+ fptr->num_args = 1;
- fptr->arg_info = NULL;
+ fptr->scope = ce;
+ fptr->fn_flags = ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_STATIC;
- fptr->function_name = name;
++ fptr->function_name = zend_string_copy(name);
+ fptr->handler = ZEND_FN(zend_test_func);
- zend_set_function_arg_flags((zend_function*)fptr);
+
+ return (zend_function*)fptr;
}
- memset(fptr, 0, sizeof(zend_internal_function));
- fptr->type = ZEND_INTERNAL_FUNCTION;
- fptr->num_args = 1;
- fptr->scope = ce;
- fptr->fn_flags = ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_STATIC;
- fptr->function_name = zend_string_copy(name);
- fptr->handler = ZEND_FN(zend_test_func);
-
- return (zend_function*)fptr;
+ return zend_std_get_static_method(ce, name, NULL);
}
/* }}} */
@@@ -198,7 -194,7 +207,8 @@@ static ZEND_METHOD(_ZendTestTrait, test
/* }}} */
static const zend_function_entry zend_test_class_methods[] = {
+ ZEND_ME(_ZendTestClass, is_object, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ ZEND_ME(_ZendTestClass, __toString, NULL, ZEND_ACC_DEPRECATED)
ZEND_FE_END
};