Fix GH-22112: assertion when error handler throws during NaN coercion#70
Closed
iliaal wants to merge 1 commit into
Closed
Fix GH-22112: assertion when error handler throws during NaN coercion#70iliaal wants to merge 1 commit into
iliaal wants to merge 1 commit into
Conversation
zend_parse_arg_bool_weak and zend_parse_arg_str_weak could return success with EG(exception) already set, because zend_is_true and convert_to_string emit the NaN coercion warning without checking whether the user error handler threw. Recv-arg verification for a userland function then took the no-check ZEND_VM_NEXT_OPCODE branch, aborting on ZEND_ASSERT(!EG(exception)). Mirror the existing check in zend_parse_arg_long_weak and propagate failure when the warning leaves an exception pending. Fixes phpGH-22112
Owner
Author
|
Submitted upstream as php#22114. Closing this staging PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recv-arg verification for a userland function asserts
!EG(exception)after a successful weak coercion.zend_parse_arg_bool_weakandzend_parse_arg_str_weakreturned success without checking whether the NaN-coerced-to-bool/string warning had triggered a throw from the user error handler. Mirror the post-warning check inzend_parse_arg_long_weak.Fixes php#22112