Skip to content

Commit

Permalink
Fix incorrect check in zend_internal_call_should_throw()
Browse files Browse the repository at this point in the history
This debug code is part of arginfo validation. This validation will
never trigger properly because the OR operation makes the first if
always true. Fix it by changing to an AND.

Closes GH-10417

Signed-off-by: George Peter Banyard <girgias@php.net>
  • Loading branch information
nielsdos authored and Girgias committed Jan 25, 2023
1 parent 0d9bf10 commit 972c74c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -5,6 +5,7 @@ PHP NEWS
- Core:
. Fixed incorrect check condition in ZEND_YIELD. (nielsdos)
. Fixed incorrect check condition in type inference. (nielsdos)
. Fix incorrect check in zend_internal_call_should_throw(). (nielsdos)

- FFI:
. Fixed incorrect bitshifting and masking in ffi bitfield. (nielsdos)
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_execute.c
Expand Up @@ -1210,7 +1210,7 @@ static zend_never_inline ZEND_ATTRIBUTE_UNUSED bool zend_verify_internal_arg_typ
* trust that arginfo matches what is enforced by zend_parse_parameters. */
ZEND_API bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_data *call)
{
if (fbc->internal_function.handler == ZEND_FN(pass) || (fbc->internal_function.fn_flags | ZEND_ACC_FAKE_CLOSURE)) {
if (fbc->internal_function.handler == ZEND_FN(pass) || (fbc->internal_function.fn_flags & ZEND_ACC_FAKE_CLOSURE)) {
/* Be lenient about the special pass function and about fake closures. */
return 0;
}
Expand Down

0 comments on commit 972c74c

Please sign in to comment.