Skip to content

Conversation

TimWolla
Copy link
Member

No description provided.

This actually caught a bug in the implementation of attributes on regular
constants: A list of 4 constants with an attribute did not correctly result in
an error, since the reallocated list wasn't stored anywhere.
Copy link
Member

@DanielEScherzer DanielEScherzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RM approval
Technical review performed in my capacity as a normal developer, looks good to m

@@ -2956,7 +2956,7 @@ zend_ast * ZEND_FASTCALL zend_ast_with_attributes(zend_ast *ast, zend_ast *attr)
/* Since constants are already stored in a list, just add the attributes
* to that list instead of storing them elsewhere;
* zend_compile_const_decl() checks the kind of the list elements. */
zend_ast_list_add(ast, attr);
ast = zend_ast_list_add(ast, attr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, thanks

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! LGTM.

@TimWolla TimWolla merged commit 6ba5f7e into php:master Aug 29, 2025
9 checks passed
@TimWolla TimWolla deleted the zend-ast-list-add-nodiscard branch August 29, 2025 17:57
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.

4 participants