Skip to content

Commit af7a6c7

Browse files
committed
Zend: remove goto in zend_is_callable_at_frame()
But moving the call into the switch statement rather than trying to understand this code flow.
1 parent 4c3bd1a commit af7a6c7

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Zend/zend_API.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4186,7 +4186,6 @@ ZEND_API bool zend_is_callable_at_frame(
41864186
return 1;
41874187
}
41884188

4189-
check_func:
41904189
ret = zend_is_string_callable(Z_STR_P(callable), frame, fcc, strict_class, error, check_flags & IS_CALLABLE_SUPPRESS_DEPRECATIONS);
41914190
if (fcc == &fcc_local) {
41924191
zend_release_fcall_info_cache(fcc);
@@ -4238,10 +4237,13 @@ ZEND_API bool zend_is_callable_at_frame(
42384237
}
42394238
}
42404239

4241-
callable = method;
4242-
goto check_func;
4240+
ret = zend_is_string_callable(Z_STR_P(method), frame, fcc, strict_class, error, check_flags & IS_CALLABLE_SUPPRESS_DEPRECATIONS);
4241+
if (fcc == &fcc_local) {
4242+
zend_release_fcall_info_cache(fcc);
4243+
}
4244+
return ret;
42434245
}
4244-
return 0;
4246+
42454247
case IS_OBJECT:
42464248
if (Z_OBJ_HANDLER_P(callable, get_closure) && Z_OBJ_HANDLER_P(callable, get_closure)(Z_OBJ_P(callable), &fcc->calling_scope, &fcc->function_handler, &fcc->object, 1) == SUCCESS) {
42474249
fcc->called_scope = fcc->calling_scope;

0 commit comments

Comments
 (0)