Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Unified Diff: tests/RandomTest.cpp

Issue 1503423003: ubsan shift fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add cast to work around win compiler Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/MathTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/RandomTest.cpp
diff --git a/tests/RandomTest.cpp b/tests/RandomTest.cpp
index 8d93d87df6cd7fafbfc11630244b7865217bb580..448f07340f41bbf488ac81246871377677a6f407 100644
--- a/tests/RandomTest.cpp
+++ b/tests/RandomTest.cpp
@@ -119,7 +119,7 @@ static double test_single_gorilla(skiatest::Reporter* reporter, int shift) {
// now make some strings and track them
for (int i = 0; i < kN; ++i) {
- value <<= 1;
+ value = SkLeftShift(value, 1);
unsigned int rnd = rand.nextU();
value |= ((rnd >> shift) & 0x1);
« no previous file with comments | « tests/MathTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698