Skip to content

Commit

Permalink
zend_std_get_static_method() should return NULL in case of exception …
Browse files Browse the repository at this point in the history
…thrown from user error handler
  • Loading branch information
dstogov committed Sep 28, 2021
1 parent 51f8067 commit f81f874
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Zend/zend_object_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,10 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
fbc = get_static_method_fallback(ce, function_name);
}

if (UNEXPECTED(!key)) {
zend_string_release_ex(lc_function_name, 0);
}

if (EXPECTED(fbc)) {
if (UNEXPECTED(fbc->common.fn_flags & ZEND_ACC_ABSTRACT)) {
zend_abstract_method_call(fbc);
Expand All @@ -1419,13 +1423,12 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
"Calling static trait method %s::%s is deprecated, "
"it should only be called on a class using the trait",
ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
if (EG(exception)) {
return NULL;
}
}
}

if (UNEXPECTED(!key)) {
zend_string_release_ex(lc_function_name, 0);
}

return fbc;
}
/* }}} */
Expand Down

0 comments on commit f81f874

Please sign in to comment.