Skip to content

Commit be27cbd

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Avoid possible spill conflict (one of the problem that caused phpGH-16821) (php#16947)
2 parents b3db7f7 + d31de85 commit be27cbd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ext/opcache/jit/zend_jit_ir.c

+7
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,13 @@ static bool zend_jit_spilling_may_cause_conflict(zend_jit_ctx *jit, int var, ir_
13061306
&& (jit->ssa->cfg.blocks[jit->ssa->vars[jit->ssa->ops[jit->ssa->vars[var].definition].op1_use].definition_phi->block].flags & ZEND_BB_LOOP_HEADER)) {
13071307
/* Avoid moving spill store out of loop */
13081308
return 1;
1309+
} else if (jit->ssa->vars[var].definition >= 0
1310+
&& jit->ssa->ops[jit->ssa->vars[var].definition].op1_def == var
1311+
&& jit->ssa->ops[jit->ssa->vars[var].definition].op1_use >= 0
1312+
&& jit->ssa->ops[jit->ssa->vars[var].definition].op2_use >= 0
1313+
&& jit->ra[jit->ssa->ops[jit->ssa->vars[var].definition].op2_use].ref == val) {
1314+
/* Avoid spill conflict between of ASSIGN.op1_def and ASSIGN.op1_use */
1315+
return 1;
13091316
}
13101317
return 0;
13111318
}

0 commit comments

Comments
 (0)