Skip to content

Commit 972c74c

Browse files
nielsdosGirgias
authored andcommitted
Fix incorrect check in zend_internal_call_should_throw()
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 <[email protected]>
1 parent 0d9bf10 commit 972c74c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ PHP NEWS
55
- Core:
66
. Fixed incorrect check condition in ZEND_YIELD. (nielsdos)
77
. Fixed incorrect check condition in type inference. (nielsdos)
8+
. Fix incorrect check in zend_internal_call_should_throw(). (nielsdos)
89

910
- FFI:
1011
. Fixed incorrect bitshifting and masking in ffi bitfield. (nielsdos)

Zend/zend_execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ static zend_never_inline ZEND_ATTRIBUTE_UNUSED bool zend_verify_internal_arg_typ
12101210
* trust that arginfo matches what is enforced by zend_parse_parameters. */
12111211
ZEND_API bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_data *call)
12121212
{
1213-
if (fbc->internal_function.handler == ZEND_FN(pass) || (fbc->internal_function.fn_flags | ZEND_ACC_FAKE_CLOSURE)) {
1213+
if (fbc->internal_function.handler == ZEND_FN(pass) || (fbc->internal_function.fn_flags & ZEND_ACC_FAKE_CLOSURE)) {
12141214
/* Be lenient about the special pass function and about fake closures. */
12151215
return 0;
12161216
}

0 commit comments

Comments
 (0)