com php-src: Fix bug #73668: NEWS ext/opcache/Optimizer/zend_ inference.c ext/opcache/tests/bug73668.phpt

From: Date: Tue, 06 Dec 2016 21:25:35 +0000
Subject: com php-src: Fix bug #73668: NEWS ext/opcache/Optimizer/zend_ inference.c ext/opcache/tests/bug73668.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-96232@lists.php.net to get a copy of this message
Commit: 76c4a3db080e347663a3999ae38b78cf26dd4c84 Author: Nikita Popov <nikic@php.net> Tue, 6 Dec 2016 22:25:35 +0100 Parents: d7e7f74b24dfb85bd373efba94adb9663927e49f Branches: PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=76c4a3db080e347663a3999ae38b78cf26dd4c84 Log: Fix bug #73668 Not bothering to implement special handling to get an accurate range for this case. Bugs: https://bugs.php.net/73668 Changed paths: M NEWS M ext/opcache/Optimizer/zend_inference.c A ext/opcache/tests/bug73668.phpt Diff: diff --git a/NEWS b/NEWS index b13acb9..8f07727 100644 --- a/NEWS +++ b/NEWS @@ -2,10 +2,14 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2017, PHP 7.1.1 -- Opcache: +- Core: . Fixed bug #73663 ("Invalid opcode 65/16/8" occurs with a variable created with list()). (Laruence) + +- Opcache: . Fixed bug #73654 (Segmentation fault in zend_call_function). (Nikita) + . Fixed bug #73668 ("SIGFPE Arithmetic exception" in opcache when divide by + minus 1). (Nikita) 01 Dec 2016, PHP 7.1.0 diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 24be5c3..062f8c6 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -610,6 +610,10 @@ static int zend_inference_calc_binary_op_range( if (op2_min <= 0 && op2_max >= 0) { break; } + if (op1_min == ZEND_LONG_MIN && op2_max == -1) { + /* Avoid ill-defined division, which may trigger SIGFPE. */ + break; + } t1 = op1_min / op2_min; t2 = op1_min / op2_max; t3 = op1_max / op2_min; diff --git a/ext/opcache/tests/bug73668.phpt b/ext/opcache/tests/bug73668.phpt new file mode 100644 index 0000000..aac5c9e --- /dev/null +++ b/ext/opcache/tests/bug73668.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #73668: "SIGFPE Arithmetic exception" in opcache when divide by minus 1 +--FILE-- +<?php +$a/-1; +?> +--EXPECTF-- +Notice: Undefined variable: a in %s on line %d

« previous php.cvs (#96232) next »