Skip to content

Commit ca6f41a

Browse files
committed
Fix out of bounds read in sccp
1 parent 50cce5e commit ca6f41a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/opcache/Optimizer/sccp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,6 +2329,7 @@ static int try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var,
23292329
if (opline->opcode == ZEND_DO_ICALL) {
23302330
removed_ops = remove_call(ctx, opline, ssa_op);
23312331
} else if (opline->opcode == ZEND_TYPE_CHECK
2332+
&& ssa_op->op1_use >= 0
23322333
&& !value_known(&ctx->values[ssa_op->op1_use])) {
23332334
/* For TYPE_CHECK we may compute the result value without knowing the
23342335
* operand, based on type inference information. Make sure the operand is

0 commit comments

Comments
 (0)