Skip to content

Conversation

@iluuu1994
Copy link
Member

@iluuu1994 iluuu1994 commented Jan 23, 2024

Previously, this variable was necessary because of auto-vivification on UNDEF/NULL/false. It's now only used for RC inference, as auto-vivification has been removed.

This implicitly solves an inference problem for $obj->bar &= $obj; where we get a new variable for both literal references to $obj, with the first one getting the RCn flag, and the second one getting the MAY_BE_REFERENCE flag. Thus, the first variable will be missing the reference type, causing a false-positive type inference warning.

If we want to verify RC inference at some point we'll need a better solution.

For reference: https://github.com/php/php-src/actions/runs/7619720239/job/20753304348

Previously, this variable was necessary because of auto-vivification on
UNDEF/NULL/false. It's now only used for RC inference. However,
auto-vivification has been removed.

This implicitly solves an inference problem for $obj->bar &= $obj; where we get
a new variable for both literal references to $obj, with the first one getting
the RCn flag, and the second one getting the MAY_BE_REFERENCE flag. Thus, the
first variable will be missing the reference type, causing a false-positive type
inference warning.

If we want to verify RC inference at some point we'll need a better solution.
@iluuu1994 iluuu1994 requested a review from dstogov as a code owner January 23, 2024 18:16
@iluuu1994 iluuu1994 changed the title Avoid new var for SSA for ASSIGN_OBJ_REF without RC inference Avoid new SSA var for ASSIGN_OBJ_REF without RC inference Jan 23, 2024
@iluuu1994 iluuu1994 closed this in 6f6289c Jan 24, 2024
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