Fix signed integer overflow in GLSL preprocessor left shift
Signed integer overflow is undefined in C++, whereas unsigned integer
overflow is not. Always cast left shift operand to unsigned to avoid
UB.
On common compilers, the behavior was already the same before this
patch, so this patch is done mostly for the benefit of automated fuzz
testing.
BUG=chromium:743136
TEST=angle_unittests
Change-Id: I7aab939036bb19a37f258cef4297b560da3cd9d5
Reviewed-on: https://chromium-review.googlesource.com/704659Reviewed-by:
Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Showing
Please
register
or
sign in
to comment