From 39974dd65d1399d917fda591b864bc09eb53b6c0 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 18 Feb 2018 15:13:14 +0100 Subject: [PATCH] Disable negative range inference The negative range inference implementation does not work correctly, and it's not clear right now how it can be fixed. As such, disable it entirely for now. --- ext/opcache/Optimizer/zend_inference.c | 3 ++- ext/opcache/tests/neg_range_inference.phpt | 26 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 ext/opcache/tests/neg_range_inference.phpt diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 1bfd395dd0..b5488c4dc0 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -39,7 +39,8 @@ #define SYM_RANGE /* Whether to handle negative range constraints */ -#define NEG_RANGE +/* Negative range inference is buggy, so disabled for now */ +#undef NEG_RANGE /* Number of warmup passes to use prior to widening */ #define RANGE_WARMUP_PASSES 16 diff --git a/ext/opcache/tests/neg_range_inference.phpt b/ext/opcache/tests/neg_range_inference.phpt new file mode 100644 index 0000000000..b3dd4a72be --- /dev/null +++ b/ext/opcache/tests/neg_range_inference.phpt @@ -0,0 +1,26 @@ +--TEST-- +Incorrect negative range inference +--FILE-- + +--EXPECT-- +int(1) +int(1) +int(1) +int(1) +int(1) +int(0) +int(0) +int(0) +int(0) -- 2.50.1