1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fixed codegeneration for IDENTICAL

Fixes oss-fuzz #63618
This commit is contained in:
Dmitry Stogov
2023-10-26 23:14:30 +03:00
parent ce269178a9
commit e95faaeebd
2 changed files with 23 additions and 2 deletions

View File

@@ -6982,13 +6982,13 @@ static int zend_jit_identical(zend_jit_ctx *jit,
if (opline->op1_type == IS_CV && (op1_info & MAY_BE_UNDEF)) {
ir_ref op1 = jit_ZVAL_ADDR(jit, op1_addr);
op1 = zend_jit_zval_check_undef(jit, op1, opline->op1.var, NULL, 0);
op1 = zend_jit_zval_check_undef(jit, op1, opline->op1.var, opline, 0);
op1_info |= MAY_BE_NULL;
op1_addr = ZEND_ADDR_REF_ZVAL(op1);
}
if (opline->op2_type == IS_CV && (op2_info & MAY_BE_UNDEF)) {
ir_ref op2 = jit_ZVAL_ADDR(jit, op2_addr);
op2 = zend_jit_zval_check_undef(jit, op2, opline->op2.var, NULL, 0);
op2 = zend_jit_zval_check_undef(jit, op2, opline->op2.var, opline, 0);
op2_info |= MAY_BE_NULL;
op2_addr = ZEND_ADDR_REF_ZVAL(op2);
}

View File

@@ -0,0 +1,21 @@
--TEST--
JIT IDENTICAL: 004 undefined error
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
opcache.protect_memory=1
--FILE--
<?php
function foo() {
$y === $y;
}
foo();
?>
DONE
--EXPECTF--
Warning: Undefined variable $y in %sidentical_004.php on line 3
Warning: Undefined variable $y in %sidentical_004.php on line 3
DONE