Skip to content

Fix line assignment in zend_ast_create_va() #18732

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

Merged
merged 1 commit into from
Jun 1, 2025
Merged

Conversation

nikic
Copy link
Member

@nikic nikic commented Jun 1, 2025

The intent here was to assign the first found line. Instead this always fell back to CG(zend_lineno).

Not sure if this line matters for anything in php-src, but the issue was observed in nikic/php-ast#247.

The intent here was to assign the first found line. Instead this
always fell back to CG(zend_lineno).

Not sure if this line matters for anything in php-src, but the
issue was observed in nikic/php-ast#247.
@nikic nikic requested a review from iluuu1994 June 1, 2025 16:01
@nikic nikic changed the base branch from master to PHP-8.4 June 1, 2025 16:01
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.

This indeed looks like an incorrect adaptation of the zend_ast_create_ functions. Thank you Nikita! Technically we could break once we enter the branch, but it's unlikely to matter in practice as the number of children is very low. Edit: Oh, nevermind. The loop does more than look for the lineno.

@nikic nikic merged commit d66e87b into php:PHP-8.4 Jun 1, 2025
9 checks passed
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.

2 participants