rikardfalkeborn 13ffefc8b8 Valueflow: Fix right shift with more than 31 bits (#1553)
When comparing if the shift is large enough to make the result zero, use
an unsigned long long to make sure the result fits. Also, a check that
avoids setting the value if the shift is equal to or larger than the
number of bits in the operand (this is undefined behaviour). Finally,
add a check to make sure the calculated value is not too large to store.

Add test cases to cover this.

This was detected by an MSVC warning.

valueflow.cpp(1350): warning C4334: '<<' : result of 32-bit shift implicitly
                     converted to 64 bits (was 64-bit shift intended?)
2019-01-01 14:15:50 +01:00
..
2018-10-13 18:20:31 +02:00
2018-10-13 18:20:31 +02:00
2018-12-25 21:11:23 +01:00
2018-12-25 21:11:23 +01:00
2018-12-28 12:59:05 +01:00
2018-05-15 16:37:40 +02:00
2018-12-23 12:42:18 +01:00
2018-12-28 12:59:05 +01:00
2018-12-25 21:11:23 +01:00
2018-12-25 21:11:23 +01:00
2018-12-31 10:18:28 +01:00
2018-12-30 18:31:37 +01:00
2018-12-25 21:11:23 +01:00
2018-07-15 23:05:48 +02:00
2018-01-14 15:37:52 +01:00
2018-10-13 18:20:31 +02:00
2018-10-13 18:20:31 +02:00
2018-03-31 20:59:09 +02:00
2018-10-20 15:28:34 +02:00
2018-06-17 09:06:16 +02:00
2018-10-13 18:20:31 +02:00
2018-01-14 15:37:52 +01:00
2018-06-17 17:20:16 +02:00
2018-06-17 17:20:16 +02:00
2018-12-21 13:54:59 +01:00
2018-12-28 12:59:05 +01:00
2018-12-30 19:31:50 +01:00
2018-12-08 11:53:37 +01:00