From: Nikita Popov Date: Sun, 18 Feb 2018 14:13:14 +0000 (+0100) Subject: Disable negative range inference X-Git-Tag: php-7.2.4RC1~66 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39974dd65d1399d917fda591b864bc09eb53b6c0;p=php 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. --- 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)