Skip to content

Commit e95faae

Browse files
committed
Fixed codegeneration for IDENTICAL
Fixes oss-fuzz #63618
1 parent ce26917 commit e95faae

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

ext/opcache/jit/zend_jit_ir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6982,13 +6982,13 @@ static int zend_jit_identical(zend_jit_ctx *jit,
69826982

69836983
if (opline->op1_type == IS_CV && (op1_info & MAY_BE_UNDEF)) {
69846984
ir_ref op1 = jit_ZVAL_ADDR(jit, op1_addr);
6985-
op1 = zend_jit_zval_check_undef(jit, op1, opline->op1.var, NULL, 0);
6985+
op1 = zend_jit_zval_check_undef(jit, op1, opline->op1.var, opline, 0);
69866986
op1_info |= MAY_BE_NULL;
69876987
op1_addr = ZEND_ADDR_REF_ZVAL(op1);
69886988
}
69896989
if (opline->op2_type == IS_CV && (op2_info & MAY_BE_UNDEF)) {
69906990
ir_ref op2 = jit_ZVAL_ADDR(jit, op2_addr);
6991-
op2 = zend_jit_zval_check_undef(jit, op2, opline->op2.var, NULL, 0);
6991+
op2 = zend_jit_zval_check_undef(jit, op2, opline->op2.var, opline, 0);
69926992
op2_info |= MAY_BE_NULL;
69936993
op2_addr = ZEND_ADDR_REF_ZVAL(op2);
69946994
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
JIT IDENTICAL: 004 undefined error
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
opcache.protect_memory=1
9+
--FILE--
10+
<?php
11+
function foo() {
12+
$y === $y;
13+
}
14+
foo();
15+
?>
16+
DONE
17+
--EXPECTF--
18+
Warning: Undefined variable $y in %sidentical_004.php on line 3
19+
20+
Warning: Undefined variable $y in %sidentical_004.php on line 3
21+
DONE

0 commit comments

Comments
 (0)