math: handle lists of numbers binopped together better
commit63b0907254782a29f0ce970125ee6e3f4ff355ae
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 7 Jan 2015 06:58:42 +0000 (7 09:58 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 7 Jan 2015 06:58:42 +0000 (7 09:58 +0300)
treee28c09424798636ffa46d0e9b3d0231aa92c0b38
parentad03a522848a531bcb47667418f15c01d6b5689e
math: handle lists of numbers binopped together better

Say you have "x = 1,3,5" and "y = 2" then we can find "x * y" by doing the
multiplications individually 1 * 2, 3 * 2, 5 * 2. And combining the
results.  The old way was just to take the highest and lowest numbers and
figuring out the range of the results.

Also this improves MOD operation a lot because that wasn't handling it
correctly if the left side was a single value.

Reported-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_math.c