Skip to content

Fix incorrect check condition in type inference #10425

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
Jan 24, 2023

Conversation

nielsdos
Copy link
Member

The "nothing to do" case would never be hit because the switch block would execute if the opcode is ZEND_ASSIGN_STATIC_PROP_OP, not ZEND_ASSIGN_STATIC_PROP. This meant that we were falling through to the else block. Fix this by correcting the check condition.

I couldn't easily find a way to write a test case for this, any pointers for that would be appreciated :)

The "nothing to do" case would never be hit because the switch block
would execute if the opcode is ZEND_ASSIGN_STATIC_PROP_OP,
not ZEND_ASSIGN_STATIC_PROP. This meant that we were falling through to
the else block. Fix this by correcting the check condition.
Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

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

Looks legit to me

@devnexen devnexen requested a review from dstogov January 23, 2023 17:55
Copy link
Member

@dstogov dstogov left a comment

Choose a reason for hiding this comment

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

This is right of course.

@dstogov dstogov merged commit 2787e3c into php:PHP-8.1 Jan 24, 2023
dstogov added a commit that referenced this pull request Jan 24, 2023
* PHP-8.1:
  Fix incorrect check condition in type inference (#10425)
dstogov added a commit that referenced this pull request Jan 24, 2023
* PHP-8.2:
  Fix incorrect check condition in type inference (#10425)
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.

3 participants