Skip to content

Commit ae2b214

Browse files
committed
Check for redundant func info
1 parent ac56ca0 commit ae2b214

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,11 @@ uint32_t zend_get_func_info(
938938
if (internal_ret & ~ret) {
939939
fprintf(stderr, "Inaccurate func info for %s()\n", ZSTR_VAL(lcname));
940940
}
941+
/* Check whether the func info is completely redundant with arginfo.
942+
* Ignore UNKNOWN_INFO for now. */
943+
if (internal_ret == ret && (internal_ret & MAY_BE_ANY) != MAY_BE_ANY) {
944+
fprintf(stderr, "Useless func info for %s()\n", ZSTR_VAL(lcname));
945+
}
941946
/* If the return type is not mixed, check that the types match exactly if we exclude
942947
* RC and array information. */
943948
uint32_t ret_any = ret & MAY_BE_ANY, internal_ret_any = internal_ret & MAY_BE_ANY;

0 commit comments

Comments
 (0)