Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/opcache/jit/zend_jit_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -6874,7 +6874,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par

ssa->var_info[j].type &= ~MAY_BE_GUARD;
op_type = concrete_type(ssa->var_info[j].type);
if (!zend_jit_type_guard(&ctx, NULL, EX_NUM_TO_VAR(i), op_type)) {
if (!zend_jit_type_guard(&ctx, (p+1)->opline, EX_NUM_TO_VAR(i), op_type)) {
goto jit_failure;
}
SET_STACK_TYPE(stack, i, op_type, 1);
Expand Down
30 changes: 30 additions & 0 deletions ext/opcache/tests/jit/gh24389.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--TEST--
GH-24389 (Tracing JIT: type guard on entry of an inlined call exits with an uninitialized opline)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=64M
opcache.jit=tracing
--EXTENSIONS--
opcache
--FILE--
<?php
function right($x, $y) {
$a = $x + $y;
return $x - $y;
}
function driver($x, $y) {
$xr = &$x;
$yr = &$y;
for ($i = 0; $i < 300; $i++) {
$r = right($x, $y);
}
return $r;
}
var_dump(driver(3, 2));
var_dump(driver(3.5, 2.5));
?>
--EXPECT--
int(1)
float(1)
Loading