Remove undefined behavior from a left shift of a negative value.
authorAaron Jacobs <jacobsa@google.com>
Mon, 3 Aug 2015 00:58:29 +0000 (10:58 +1000)
committerAaron Jacobs <jacobsa@google.com>
Mon, 3 Aug 2015 00:58:29 +0000 (10:58 +1000)
commitcc2c15c3eb03ad633a053b37fc28d6e6b0c640c1
tree262a2c513114235d7e38d75a838b6574f0f0f53c
parent912d55094d2f3b777bcb48a76c2ed32447c7795e
Remove undefined behavior from a left shift of a negative value.

Fixed by shifting a positive value, then negating the result.

(Credit: Richard Trieu)
src/test_lib_json/main.cpp