com php-src: Check for redundant func info: ext/opcache/Optimiz er/zend_func_info.c
| From: | Nikita Popov | Date: | Tue, 21 Jul 2020 11:01:12 +0000 |
| Subject: | com php-src: Check for redundant func info: ext/opcache/Optimiz er/zend_func_info.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112288@lists.php.net to get a copy of this message | ||
Commit: ae2b214be2ea263ca9719b4e5aa3195a648d667e
Author: Nikita Popov <nikita.ppv@gmail.com> Tue, 21 Jul 2020 11:10:53 +0200
Parents: ac56ca0dccc2ce0e1b8e7f8a96cff39ac49a1670
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ae2b214be2ea263ca9719b4e5aa3195a648d667e
Log:
Check for redundant func info
Changed paths:
M ext/opcache/Optimizer/zend_func_info.c
Diff:
diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c
index b8c62f5420..1affffbee6 100644
--- a/ext/opcache/Optimizer/zend_func_info.c
+++ b/ext/opcache/Optimizer/zend_func_info..c
@@ -938,6 +938,11 @@ uint32_t zend_get_func_info(
if (internal_ret & ~ret) {
fprintf(stderr, "Inaccurate func info for %s()\n", ZSTR_VAL(lcname));
}
+ /* Check whether the func info is completely redundant with arginfo.
+ * Ignore UNKNOWN_INFO for now. */
+ if (internal_ret == ret && (internal_ret & MAY_BE_ANY) != MAY_BE_ANY) {
+ fprintf(stderr, "Useless func info for %s()\n", ZSTR_VAL(lcname));
+ }
/* If the return type is not mixed, check that the types match exactly if we exclude
* RC and array information. */
uint32_t ret_any = ret & MAY_BE_ANY, internal_ret_any = internal_ret & MAY_BE_ANY;