Skip to content

Commit

Permalink
Avoid construction of empty live-ranges because of OP_DATA instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Dec 8, 2015
1 parent 964b40d commit c1803bf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Zend/zend_compile.c
Expand Up @@ -1945,10 +1945,14 @@ static void zend_find_live_range(zend_op *opline, zend_uchar type, uint32_t var)

static zend_always_inline int zend_is_def_range(zend_op *opline, zend_uchar type, uint32_t var) /* {{{ */
{
return opline->result_type == type &&
opline->result.var == var &&
opline->opcode != ZEND_ADD_ARRAY_ELEMENT &&
opline->opcode != ZEND_ROPE_ADD;
if (opline->result_type == type && opline->result.var == var) {
return opline->opcode != ZEND_ADD_ARRAY_ELEMENT &&
opline->opcode != ZEND_ROPE_ADD;
} else if (opline->opcode == ZEND_OP_DATA) {
return (opline-1)->result_type == type &&
(opline-1)->result.var == var;
}
return 0;
}
/* }}} */

Expand Down

0 comments on commit c1803bf

Please sign in to comment.