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

Fixed codegeneration for ISSET_ISEMPTY_DIM

Fixes oss-fuzz #63805
This commit is contained in:
Dmitry Stogov
2023-11-02 19:48:04 +03:00
parent 1c95e227e9
commit 1226fe027a
2 changed files with 37 additions and 0 deletions

View File

@@ -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) {

View File

@@ -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--
<?php
function foo() {
foreach ($how as $key => $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