Skip to content

Fix RC1 assumption for typed properties with __get #10833

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

Conversation

iluuu1994
Copy link
Member

Unsetting typed properties resorts back to __get which may have RC1.

Discovered using a debug flag to verify type inference I'm working on.

Unsetting typed properties resorts back to __get which may have RC1.
@iluuu1994 iluuu1994 requested a review from dstogov March 12, 2023 13:18
@@ -3444,16 +3444,12 @@ static zend_always_inline int _zend_update_type_info(
} else if (ssa_op->op1_use >= 0 && !ssa->var_info[ssa_op->op1_use].is_instanceof) {
ce = ssa->var_info[ssa_op->op1_use].ce;
}
if (prop_info) {
Copy link
Member

Choose a reason for hiding this comment

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

If the problem is related to typed properties only, can we add a check for prop_info->type here?

Copy link
Member

Choose a reason for hiding this comment

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

I checked, the problem is related not to typed property but any unset property. So the patch looks right.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, sorry the comment is misleading. I'll adjust it.

@iluuu1994 iluuu1994 closed this in 3175f24 Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants