gen_stub: Add support for attributes on constants in stubs#18735
Merged
DanielEScherzer merged 4 commits intophp:masterfrom Jun 5, 2025
Merged
gen_stub: Add support for attributes on constants in stubs#18735DanielEScherzer merged 4 commits intophp:masterfrom
DanielEScherzer merged 4 commits intophp:masterfrom
Conversation
Update to PHP-Parser 5.5.0 and add support for attributes on constants in stubs. For now, I have only migrated over E_STRICT, once the support is in place I'll do a larger migration of the existing deprecated constants.
kocsismate
reviewed
Jun 3, 2025
Member
There was a problem hiding this comment.
LGTM once CI passes.
In order to fix the use-after-frees, you may try to set the attributes array to NULL inside free_zend_constant() after releasing it, otherwise freeing may be attempted again if the function is called again, since the value of the pointer remains non-NULL (but it refers to garbage).
E.g. function attributes are freed the same way:
Line 163 in 3f03f7e
Wasn't triggered before so I didn't realize, zend_array_dup() is wrong
TimWolla
added a commit
to TimWolla/php-src
that referenced
this pull request
Jun 10, 2025
> PHP Warning: Undefined variable $code in build/gen_stub.php on line 5322 Introduced in php#18735.
TimWolla
added a commit
that referenced
this pull request
Jun 10, 2025
> PHP Warning: Undefined variable $code in build/gen_stub.php on line 5322 Introduced in #18735.
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.
Update to PHP-Parser 5.5.0 and add support for attributes on constants in stubs. For now, I have only migrated over E_STRICT, once the support is in place I'll do a larger migration of the existing deprecated constants.