mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.4'
* PHP-8.4: Fix GH-16770: Tracing JIT type mismatch when returning UNDEF
This commit is contained in:
@@ -5560,6 +5560,9 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
|
||||
res_type = Z_TYPE_P(RT_CONSTANT(opline, opline->op1));
|
||||
} else if (op1_type != IS_UNKNOWN) {
|
||||
res_type = op1_type;
|
||||
if (res_type == IS_UNDEF) {
|
||||
res_type = IS_NULL;
|
||||
}
|
||||
}
|
||||
if (op_array->type == ZEND_EVAL_CODE
|
||||
// TODO: support for top-level code
|
||||
|
||||
39
ext/opcache/tests/jit/gh16770.phpt
Normal file
39
ext/opcache/tests/jit/gh16770.phpt
Normal file
@@ -0,0 +1,39 @@
|
||||
--TEST--
|
||||
GH-16770 (Tracing JIT type mismatch when returning UNDEF)
|
||||
--INI--
|
||||
opcache.jit=1254
|
||||
opcache.jit_hot_loop=1
|
||||
opcache.jit_buffer_size=32M
|
||||
--EXTENSIONS--
|
||||
opcache
|
||||
--FILE--
|
||||
<?php
|
||||
function ret_undef($k) {
|
||||
return $undefined;
|
||||
}
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
$output = ret_undef($i);
|
||||
}
|
||||
var_dump($output);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Undefined variable $undefined in %s on line %d
|
||||
|
||||
Warning: Undefined variable $undefined in %s on line %d
|
||||
|
||||
Warning: Undefined variable $undefined in %s on line %d
|
||||
|
||||
Warning: Undefined variable $undefined in %s on line %d
|
||||
|
||||
Warning: Undefined variable $undefined in %s on line %d
|
||||
|
||||
Warning: Undefined variable $undefined in %s on line %d
|
||||
|
||||
Warning: Undefined variable $undefined in %s on line %d
|
||||
|
||||
Warning: Undefined variable $undefined in %s on line %d
|
||||
|
||||
Warning: Undefined variable $undefined in %s on line %d
|
||||
|
||||
Warning: Undefined variable $undefined in %s on line %d
|
||||
NULL
|
||||
Reference in New Issue
Block a user