]> granicus.if.org Git - php/commitdiff
Fix SSA for SEND_UNPACK
authorNikita Popov <nikic@php.net>
Sat, 16 Apr 2016 20:38:06 +0000 (22:38 +0200)
committerNikita Popov <nikic@php.net>
Sat, 16 Apr 2016 20:38:52 +0000 (22:38 +0200)
ext/opcache/Optimizer/zend_inference.c
ext/opcache/Optimizer/zend_ssa.c

index 38a278d85d08b4e3497dd82040243321134256ee..10ed53e6f29f687f0908a9a81a59e17a3ff2f774 100644 (file)
@@ -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:
index a55ccc915aab0523e05fec61215d37ec2380dfba..9d5f5a8e184fb6cb1a099a9dae6810c3e41a4bea 100644 (file)
@@ -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) {