Skip to content

Commit d061089

Browse files
committed
Remove UNKNOWN_INFO func info entries
There's no need to explicitly list that we don't know anything about a function -- that's the default state.
1 parent bfa8b49 commit d061089

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

Zend/Optimizer/zend_func_info.c

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,9 @@ static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa
8989
}
9090
}
9191

92-
#define UNKNOWN_INFO (MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF)
93-
9492
static const func_info_t func_infos[] = {
9593
/* zend */
9694
F1("zend_version", MAY_BE_STRING),
97-
FN("func_get_arg", UNKNOWN_INFO),
9895
FN("func_get_args", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
9996
F1("get_class_vars", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
10097
F1("get_class_methods", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
@@ -249,14 +246,7 @@ static const func_info_t func_infos[] = {
249246
F1("get_current_user", MAY_BE_STRING),
250247
F1("get_cfg_var", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
251248
F1("error_get_last", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
252-
FN("call_user_func", UNKNOWN_INFO),
253-
FN("call_user_func_array", UNKNOWN_INFO),
254-
FN("call_user_method", UNKNOWN_INFO),
255-
FN("call_user_method_array", UNKNOWN_INFO),
256-
FN("forward_static_call", UNKNOWN_INFO),
257-
FN("forward_static_call_array", UNKNOWN_INFO),
258249
F1("serialize", MAY_BE_STRING),
259-
FN("unserialize", UNKNOWN_INFO),
260250
F1("var_export", MAY_BE_NULL | MAY_BE_STRING),
261251
F1("print_r", MAY_BE_TRUE | MAY_BE_STRING),
262252
F0("register_shutdown_function", MAY_BE_NULL | MAY_BE_FALSE),
@@ -359,19 +349,10 @@ static const func_info_t func_infos[] = {
359349
F0("usort", MAY_BE_TRUE),
360350
F0("uasort", MAY_BE_TRUE),
361351
F0("uksort", MAY_BE_TRUE),
362-
FN("end", UNKNOWN_INFO),
363-
FN("prev", UNKNOWN_INFO),
364-
FN("next", UNKNOWN_INFO),
365-
FN("reset", UNKNOWN_INFO),
366-
FN("current", UNKNOWN_INFO),
367-
FN("min", UNKNOWN_INFO),
368-
FN("max", UNKNOWN_INFO),
369352
F1("compact", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
370353
F1("array_fill", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
371354
F1("array_fill_keys", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
372355
FC("range", zend_range_info),
373-
FN("array_pop", UNKNOWN_INFO),
374-
FN("array_shift", UNKNOWN_INFO),
375356
F1("array_splice", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
376357
F1("array_slice", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
377358
F1("array_replace", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
@@ -744,8 +725,6 @@ static const func_info_t func_infos[] = {
744725
F1("exif_thumbnail", MAY_BE_FALSE | MAY_BE_STRING),
745726

746727
/* ext/filter */
747-
FN("filter_input", UNKNOWN_INFO),
748-
FN("filter_var", UNKNOWN_INFO),
749728
F1("filter_input_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
750729
F1("filter_var_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
751730
F1("filter_list", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
@@ -881,9 +860,8 @@ ZEND_API uint32_t zend_get_func_info(
881860
if (internal_ret & ~ret) {
882861
fprintf(stderr, "Inaccurate func info for %s()\n", ZSTR_VAL(lcname));
883862
}
884-
/* Check whether the func info is completely redundant with arginfo.
885-
* Ignore UNKNOWN_INFO for now. */
886-
if (internal_ret == ret && (internal_ret & MAY_BE_ANY) != MAY_BE_ANY) {
863+
/* Check whether the func info is completely redundant with arginfo. */
864+
if (internal_ret == ret) {
887865
fprintf(stderr, "Useless func info for %s()\n", ZSTR_VAL(lcname));
888866
}
889867
/* If the return type is not mixed, check that the types match exactly if we exclude

0 commit comments

Comments
 (0)