mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.4'
* PHP-8.4: Fix invalid target opline with jit->reuse_ip active (#16457)
This commit is contained in:
commit
e61e2c1eb8
2 changed files with 47 additions and 0 deletions
|
@ -8809,6 +8809,14 @@ jit_SET_EX_OPLINE(jit, opline);
|
||||||
delayed_call_chain = 1;
|
delayed_call_chain = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (trace
|
||||||
|
&& trace->op == ZEND_JIT_TRACE_END
|
||||||
|
&& trace->stop >= ZEND_JIT_TRACE_STOP_INTERPRETER) {
|
||||||
|
if (!zend_jit_set_ip(jit, opline + 1)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9254,6 +9262,14 @@ static int zend_jit_init_static_method_call(zend_jit_ctx *jit,
|
||||||
delayed_call_chain = 1;
|
delayed_call_chain = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (trace
|
||||||
|
&& trace->op == ZEND_JIT_TRACE_END
|
||||||
|
&& trace->stop >= ZEND_JIT_TRACE_STOP_INTERPRETER) {
|
||||||
|
if (!zend_jit_set_ip(jit, opline + 1)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
31
ext/opcache/tests/jit/init_fcall_004.phpt
Normal file
31
ext/opcache/tests/jit/init_fcall_004.phpt
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
--TEST--
|
||||||
|
JIT INIT_FCALL: 004 Invalid target opline with jit->reuse_ip active
|
||||||
|
--INI--
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.enable_cli=1
|
||||||
|
--EXTENSIONS--
|
||||||
|
opcache
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
function gen() {
|
||||||
|
yield 1;
|
||||||
|
yield 2;
|
||||||
|
return 3;
|
||||||
|
};
|
||||||
|
|
||||||
|
opcache_jit_blacklist(gen(...));
|
||||||
|
|
||||||
|
for ($i = 0; $i < 2; ++$i) {
|
||||||
|
foreach (gen() as $val) {
|
||||||
|
var_dump($val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
DONE
|
||||||
|
--EXPECT--
|
||||||
|
int(1)
|
||||||
|
int(2)
|
||||||
|
int(1)
|
||||||
|
int(2)
|
||||||
|
DONE
|
Loading…
Add table
Add a link
Reference in a new issue