summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-07-21 11:10:53 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-07-21 13:01:12 +0200
commitae2b214be2ea263ca9719b4e5aa3195a648d667e (patch)
treec2f7b35357c6acf3528add3231aadb3cb1c71e8b
parentac56ca0dccc2ce0e1b8e7f8a96cff39ac49a1670 (diff)
downloadphp-git-ae2b214be2ea263ca9719b4e5aa3195a648d667e.tar.gz
Check for redundant func info
-rw-r--r--ext/opcache/Optimizer/zend_func_info.c5
1 files changed, 5 insertions, 0 deletions
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;