From: Nikita Popov Date: Tue, 28 May 2019 15:28:33 +0000 (+0200) Subject: Respect optimization_level when running JIT inference X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d1d5babde725febc5fdc7a7ccf576f3d0e3c099;p=php Respect optimization_level when running JIT inference Don't enable unsafe type inference by default -- we'll segfault on some FFI tests. --- diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index eabdcf3f71..0d43576ed3 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -664,10 +664,8 @@ static int zend_jit_op_array_analyze2(zend_op_array *op_array, zend_script *scri && !(op_array->fn_flags & ZEND_ACC_GENERATOR) && !(ssa->cfg.flags & ZEND_FUNC_INDIRECT_VAR_ACCESS)) { - /* TODO: passing ZEND_OPTIMIZER_ALL_PASSES as optimization_level - * may break overloaded operators (see ext/gmp/tests/overloading.phpt) - */ - if (zend_ssa_inference(&CG(arena), op_array, script, ssa, ZEND_OPTIMIZER_ALL_PASSES /*- ZEND_OPTIMIZER_IGNORE_OVERLOADING*/) != SUCCESS) { + uint32_t optimization_level = ZCG(accel_directives).optimization_level; + if (zend_ssa_inference(&CG(arena), op_array, script, ssa, optimization_level) != SUCCESS) { return FAILURE; } }