Skip to content

Commit f3435f9

Browse files
committed
Fixes after adding tests
1 parent d69d623 commit f3435f9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Zend/zend_execute_API.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,8 +1134,10 @@ ZEND_API zend_result zend_call_method_if_exists(
11341134
zend_function *fn = zend_hash_find_ptr_lc(&ce->function_table, method_name);
11351135
bool is_trampoline = false;
11361136

1137-
if (UNEXPECTED(fn == NULL)) {
1138-
/* We don't have a trampoline */
1137+
/* Can only call methods that exist (regardless of them being static) and are public */
1138+
if (UNEXPECTED(fn == NULL || (fn->common.fn_flags & ZEND_ACC_PUBLIC) == 0)) {
1139+
/* Unless they have a trampoline (but not a static one) which we can use */
1140+
// TODO: Should static trampolines be allowed?
11391141
if (!ce->__call) {
11401142
ZVAL_UNDEF(retval);
11411143
return FAILURE;

0 commit comments

Comments
 (0)