diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 6494b76dff0..31d4911b49f 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -1540,6 +1540,12 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin if (op_type != IS_UNKNOWN) { ssa_var_info[i].type &= zend_jit_trace_type_to_info(op_type); + if (!ssa_var_info[i].type + && op_type == IS_UNDEF + && i >= op_array->last_var) { + // TODO: It's better to use NULL instead of UNDEF for temporary variables + ssa_var_info[i].type |= MAY_BE_UNDEF; + } } } i++; diff --git a/ext/opcache/tests/jit/fe_reset_001.phpt b/ext/opcache/tests/jit/fe_reset_001.phpt new file mode 100644 index 00000000000..164e5731ead --- /dev/null +++ b/ext/opcache/tests/jit/fe_reset_001.phpt @@ -0,0 +1,37 @@ +--TEST-- +FE_RESET: 001 undef $$ operand +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +--FILE-- + +OK +--EXPECTF-- +Warning: Undefined variable $0 in %sfe_reset_001.php on line 4 + +Warning: foreach() argument must be of type array|object, null given in %sfe_reset_001.php on line 4 + +Warning: Undefined variable $1 in %sfe_reset_001.php on line 4 + +Warning: foreach() argument must be of type array|object, null given in %sfe_reset_001.php on line 4 + +Warning: Undefined variable $2 in %sfe_reset_001.php on line 4 + +Warning: foreach() argument must be of type array|object, null given in %sfe_reset_001.php on line 4 + +Warning: Undefined variable $3 in %sfe_reset_001.php on line 4 + +Warning: foreach() argument must be of type array|object, null given in %sfe_reset_001.php on line 4 + +Warning: Undefined variable $4 in %sfe_reset_001.php on line 4 + +Warning: foreach() argument must be of type array|object, null given in %sfe_reset_001.php on line 4 +OK +