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

Unified Diff: src/base/safe_math_impl.h

Issue 1135293003: Update safe_math_impl.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/safe_math_impl.h
diff --git a/src/base/safe_math_impl.h b/src/base/safe_math_impl.h
index 055e2a0275038893e707da0b1b734dfb7e9d9c19..eb2a151191bba51e1dcc3fdff932ff2ded7fbafb 100644
--- a/src/base/safe_math_impl.h
+++ b/src/base/safe_math_impl.h
@@ -208,8 +208,8 @@ typename enable_if<std::numeric_limits<T>::is_integer &&
(sizeof(T) * 2 > sizeof(uintmax_t)),
T>::type
CheckedMul(T x, T y, RangeConstraint* validity) {
- // if either side is zero then the result will be zero.
- if (!(x || y)) {
+ // If either side is zero then the result will be zero.
+ if (!x || !y) {
return RANGE_VALID;
} else if (x > 0) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698