diff options
author | Dmitry Stogov <dmitry@zend.com> | 2017-10-30 10:41:27 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2017-10-30 10:41:27 +0300 |
commit | 230e505fd8decde99af720fd640e70aaa297b5e2 (patch) | |
tree | 571271711b7f285c659d958269fc0c479adf3943 | |
parent | 63c0ecc44564fbb3469d53646a5403388689ceea (diff) | |
download | php-git-230e505fd8decde99af720fd640e70aaa297b5e2.tar.gz |
Fixed type inference
-rw-r--r-- | ext/opcache/Optimizer/zend_inference.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 6e0d0cb5d9..d333947c66 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -3075,7 +3075,13 @@ static int zend_update_type_info(const zend_op_array *op_array, } j = zend_ssa_next_use(ssa_ops, ssa_ops[i].result_def, j); } - UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def); + if ((tmp & MAY_BE_ARRAY) + && (tmp & (MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING))) { + UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def); + } else { + /* invalid key type */ + UPDATE_SSA_TYPE(t1, ssa_ops[i].op1_def); + } COPY_SSA_OBJ_TYPE(ssa_ops[i].op1_use, ssa_ops[i].op1_def); } /* FETCH_LIST on a string behaves like FETCH_R on null */ |