1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00

Merge branch 'PHP-8.1'

* PHP-8.1:
  JIT: Fix crash during compilation of function with incompletely constructed SSA
This commit is contained in:
Dmitry Stogov
2021-12-13 11:51:50 +03:00
2 changed files with 23 additions and 1 deletions
+4 -1
View File
@@ -2879,7 +2879,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
}
end = ssa->cfg.blocks[b].start + ssa->cfg.blocks[b].len - 1;
for (i = ssa->cfg.blocks[b].start; i <= end; i++) {
zend_ssa_op *ssa_op = &ssa->ops[i];
zend_ssa_op *ssa_op = ssa->ops ? &ssa->ops[i] : NULL;
opline = op_array->opcodes + i;
switch (opline->opcode) {
case ZEND_INIT_FCALL:
@@ -2910,6 +2910,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
res_use_info = -1;
if (opline->result_type == IS_CV
&& ssa->vars
&& ssa_op->result_use >= 0
&& !ssa->vars[ssa_op->result_use].no_val) {
zend_jit_addr res_use_addr = RES_USE_REG_ADDR();
@@ -2970,6 +2971,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
res_use_info = -1;
if (opline->result_type == IS_CV
&& ssa->vars
&& ssa_op->result_use >= 0
&& !ssa->vars[ssa_op->result_use].no_val) {
zend_jit_addr res_use_addr = RES_USE_REG_ADDR();
@@ -3023,6 +3025,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
res_use_info = -1;
if (opline->result_type == IS_CV
&& ssa->vars
&& ssa_op->result_use >= 0
&& !ssa->vars[ssa_op->result_use].no_val) {
zend_jit_addr res_use_addr = RES_USE_REG_ADDR();
+19
View File
@@ -0,0 +1,19 @@
--TEST--
JIT MOD: 005
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
opcache.protect_memory=1
--FILE--
<?php
function foo(){
$a = 1;
$b = $a % 0;
yield $b;
}
?>
DONE
--EXPECT--
DONE