Change zend_ast_attr from uint16_t to uint32_t #20490
Open
+7
−1
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.
The zend_ast_attr type was defined as uint16_t, limiting it to 16 bits, but it’s used to store ZEND_ACC_* flags which can use bits up to 31:
While the current code doesn’t appear to assign these high-bit flags to ast->attr fields, the type mismatch creates a potential bug where any future code attempting to store ZEND_ACC flags with bits 16–31 would have those bits silently truncated to zero.
This change:
The structure sizes remain unchanged: we’re making existing implicit padding explicit and widening the attr field to properly accommodate all ZEND_ACC_* flag values.