Skip to content

Commit 4bd7f4e

Browse files
committed
Check that MAY_BE_REF variables cannot have a ce
1 parent 701e10c commit 4bd7f4e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Zend/Optimizer/ssa_integrity.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ void ssa_verify_integrity(zend_op_array *op_array, zend_ssa *ssa, const char *ex
176176
if ((type & MAY_BE_ARRAY_OF_ANY) && !(type & MAY_BE_ARRAY_KEY_ANY)) {
177177
FAIL("var " VARFMT " has array value type but not key type\n", VAR(i));
178178
}
179+
if ((type & MAY_BE_REF) && ssa->var_info[i].ce) {
180+
FAIL("var " VARFMT " may be ref but has ce\n", VAR(i));
181+
}
179182
}
180183

181184
/* Instructions */

Zend/Optimizer/zend_inference.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3411,6 +3411,7 @@ static zend_always_inline zend_result _zend_update_type_info(
34113411
tmp |= zend_fetch_prop_type(script, prop_info, &ce);
34123412
if (opline->result_type == IS_VAR) {
34133413
tmp |= MAY_BE_REF | MAY_BE_INDIRECT;
3414+
ce = NULL;
34143415
} else if (!(opline->op1_type & (IS_VAR|IS_TMP_VAR)) || !(t1 & MAY_BE_RC1)) {
34153416
zend_class_entry *ce = NULL;
34163417

0 commit comments

Comments
 (0)