From e95faaeebd23535aa3ce6c90e9edef6f471509c7 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 26 Oct 2023 23:14:30 +0300 Subject: [PATCH] Fixed codegeneration for IDENTICAL Fixes oss-fuzz #63618 --- ext/opcache/jit/zend_jit_ir.c | 4 ++-- ext/opcache/tests/jit/identical_004.phpt | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 ext/opcache/tests/jit/identical_004.phpt diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 09fb277a54d..52ebb094998 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -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); } diff --git a/ext/opcache/tests/jit/identical_004.phpt b/ext/opcache/tests/jit/identical_004.phpt new file mode 100644 index 00000000000..80a1d19fc95 --- /dev/null +++ b/ext/opcache/tests/jit/identical_004.phpt @@ -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-- + +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