From 4f726be68224dca5ea6ffc3970dedffcd7daa639 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 16 Apr 2016 22:38:06 +0200 Subject: [PATCH] Fix SSA for SEND_UNPACK --- ext/opcache/Optimizer/zend_inference.c | 10 ++++++++++ ext/opcache/Optimizer/zend_ssa.c | 1 + 2 files changed, 11 insertions(+) diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 38a278d85d..10ed53e6f2 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -3164,6 +3164,16 @@ static void zend_update_type_info(const zend_op_array *op_array, UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def); } break; + case ZEND_SEND_UNPACK: + if (ssa_ops[i].op1_def >= 0) { + tmp = t1 | MAY_BE_RC1|MAY_BE_RCN; + if (t1 & MAY_BE_ARRAY) { + /* SEND_UNPACK may acquire references into the array */ + tmp |= MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF; + } + UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def); + } + break; case ZEND_FAST_CONCAT: case ZEND_ROPE_INIT: case ZEND_ROPE_ADD: diff --git a/ext/opcache/Optimizer/zend_ssa.c b/ext/opcache/Optimizer/zend_ssa.c index a55ccc915a..9d5f5a8e18 100644 --- a/ext/opcache/Optimizer/zend_ssa.c +++ b/ext/opcache/Optimizer/zend_ssa.c @@ -585,6 +585,7 @@ static int zend_ssa_rename(const zend_op_array *op_array, uint32_t build_flags, case ZEND_SEND_VAR_NO_REF: case ZEND_SEND_VAR_EX: case ZEND_SEND_REF: + case ZEND_SEND_UNPACK: case ZEND_FE_RESET_RW: //TODO: ??? if (opline->op1_type == IS_CV) { -- 2.50.1