Skip to content

Commit

Permalink
Check for redundant func info
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jul 21, 2020
1 parent ac56ca0 commit ae2b214
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ext/opcache/Optimizer/zend_func_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ae2b214

Please sign in to comment.