Skip to content

Commit

Permalink
Consider op1 literal of FETCH_OBJ_R
Browse files Browse the repository at this point in the history
FETCH_OBJ_R may have an op1 CONST operand, even though it will
always error. We should take this into account when compacting
literals.
  • Loading branch information
nikic committed Jul 29, 2020
1 parent 99c48a2 commit 57ad5b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/opcache/Optimizer/compact_literals.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
case ZEND_POST_INC_OBJ:
case ZEND_POST_DEC_OBJ:
case ZEND_ISSET_ISEMPTY_PROP_OBJ:
if (opline->op1_type == IS_CONST) {
LITERAL_INFO(opline->op1.constant, LITERAL_VALUE, 1);
}
if (opline->op2_type == IS_CONST) {
LITERAL_INFO(opline->op2.constant, LITERAL_PROPERTY, 1);
}
Expand Down

0 comments on commit 57ad5b3

Please sign in to comment.