diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index debcca264ae..7345adc931c 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -11893,6 +11893,10 @@ static int zend_jit_fetch_dimension_address_inner(zend_jit_ctx *jit, } if (type == BP_JIT_IS + && !(op2_info & (MAY_BE_ANY|MAY_BE_UNDEF))) { + /* dead code */ + ir_END_list(*end_inputs); + } else if (type == BP_JIT_IS && (op1_info & MAY_BE_ARRAY) && (op2_info & (MAY_BE_LONG|MAY_BE_STRING)) && test_zval_inputs->count) { diff --git a/ext/opcache/tests/jit/isset_002.phpt b/ext/opcache/tests/jit/isset_002.phpt new file mode 100644 index 00000000000..1df489fc4f3 --- /dev/null +++ b/ext/opcache/tests/jit/isset_002.phpt @@ -0,0 +1,33 @@ +--TEST-- +ISSET_ISEMPTY_DIM with undefined variable +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +--FILE-- + $value) { + if (is_int($key)) { + if (is_int($key)) { + $keyy++; + } + if (isset($row[$key])) { + return false; + } + } + if (isset($row[$key])) { + return false; + } + } + return true; +} +foo(); +?> +DONE +--EXPECTF-- +Warning: Undefined variable $how in %sisset_002.php on line 3 + +Warning: foreach() argument must be of type array|object, null given in %sisset_002.php on line 3 +DONE \ No newline at end of file