Skip to content

Fix incorrect check in zend_internal_call_should_throw() #10417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

nielsdos
Copy link
Member

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.

Found using a static analyser.

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.
@Girgias
Copy link
Member

Girgias commented Jan 23, 2023

Could you maybe create a test case that would have an issue?

@nielsdos
Copy link
Member Author

Could you maybe create a test case that would have an issue?

I don't know how to do that in this case. This code should only return 1 in case there is a bug somewhere regarding arginfo for internal functions AFAIK (e.g. when zend_parse_arguments doesn't match arginfo). So I don't know how to set that up in a .phpt test.

@Girgias Girgias removed the request for review from arnaud-lb January 25, 2023 00:00
@Girgias Girgias self-assigned this Jan 25, 2023
@Girgias Girgias closed this in 972c74c Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants