Skip to content

Avoid new SSA var for ASSIGN_OBJ_REF without RC inference #13233

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/Optimizer/zend_inference.c
Original file line number Diff line number Diff line change
Expand Up @@ -3157,7 +3157,7 @@ static zend_always_inline zend_result _zend_update_type_info(
}
break;
case ZEND_ASSIGN_OBJ_REF:
if (opline->op1_type == IS_CV) {
if (opline->op1_type == IS_CV && ssa_op->op1_def >= 0) {
tmp = t1;
if (tmp & MAY_BE_OBJECT) {
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
Expand Down
2 changes: 1 addition & 1 deletion Zend/Optimizer/zend_ssa.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ static zend_always_inline int _zend_ssa_rename_op(const zend_op_array *op_array,
}
break;
case ZEND_ASSIGN_OBJ_REF:
if (opline->op1_type == IS_CV) {
if ((build_flags & ZEND_SSA_RC_INFERENCE) && opline->op1_type == IS_CV) {
ssa_ops[k].op1_def = ssa_vars_count;
var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count;
ssa_vars_count++;
Expand Down