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

Unified Diff: tests/MathTest.cpp

Issue 1503423003: ubsan shift fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: tests/MathTest.cpp
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index 3c2bc644073ddcd211e732c645a28fd894a4b00d..e6419611fe1570e7de5b37795919b785effd394f 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -561,7 +561,7 @@ DEF_TEST(Math, reporter) {
SkFixed numer = rand.nextS();
SkFixed denom = rand.nextS();
SkFixed result = SkFixedDiv(numer, denom);
- int64_t check = ((int64_t)numer << 16) / denom;
+ int64_t check = (int64_t)numer * (1 << 16) / denom;
(void)SkCLZ(numer);
(void)SkCLZ(denom);
« include/core/SkFixed.h ('K') | « src/utils/SkDashPath.cpp ('k') | tests/RandomTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698