Skip to content

Commit 4d1d5ba

Browse files
committed
Respect optimization_level when running JIT inference
Don't enable unsafe type inference by default -- we'll segfault on some FFI tests.
1 parent e1c9032 commit 4d1d5ba

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -664,10 +664,8 @@ static int zend_jit_op_array_analyze2(zend_op_array *op_array, zend_script *scri
664664
&& !(op_array->fn_flags & ZEND_ACC_GENERATOR)
665665
&& !(ssa->cfg.flags & ZEND_FUNC_INDIRECT_VAR_ACCESS)) {
666666

667-
/* TODO: passing ZEND_OPTIMIZER_ALL_PASSES as optimization_level
668-
* may break overloaded operators (see ext/gmp/tests/overloading.phpt)
669-
*/
670-
if (zend_ssa_inference(&CG(arena), op_array, script, ssa, ZEND_OPTIMIZER_ALL_PASSES /*- ZEND_OPTIMIZER_IGNORE_OVERLOADING*/) != SUCCESS) {
667+
uint32_t optimization_level = ZCG(accel_directives).optimization_level;
668+
if (zend_ssa_inference(&CG(arena), op_array, script, ssa, optimization_level) != SUCCESS) {
671669
return FAILURE;
672670
}
673671
}

0 commit comments

Comments
 (0)