Commit d445357315299e30c18c756f657ff928653128c2

Olli Etuaho 2016-09-27T13:21:46

Fix integer division constant folding corner cases ESSL has undefined behavior when the integer modulus operator is used on negative operands. Generate a warning and fold the result to zero in this case. In case the minimum representable signed integer is divided by -1, the result is defined to be either the maximum or minimum representable value. We choose to fold the calculation to the maximum representable value in this case. BUG=angleproject:1537 TEST=angle_unittests Change-Id: I57fac6b54a3553b7a0f0e36cc6ba0ed59a88eea9 Reviewed-on: https://chromium-review.googlesource.com/390251 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>