Index: Source/wtf/CheckedArithmetic.h |
diff --git a/Source/wtf/CheckedArithmetic.h b/Source/wtf/CheckedArithmetic.h |
index 75d4a41b418f508166fca6e4a3fbfc5f0ffc4329..dcbc896b8ad81217d88ff96e8038ea44efdd3417 100644 |
--- a/Source/wtf/CheckedArithmetic.h |
+++ b/Source/wtf/CheckedArithmetic.h |
@@ -251,7 +251,7 @@ template <typename LHS, typename RHS, typename ResultType> struct ArithmeticOper |
return false; |
} |
} // if the signs do not match this operation can't overflow |
- result = lhs + rhs; |
+ result = static_cast<ResultType>(lhs + rhs); |
return true; |
} |
@@ -266,7 +266,7 @@ template <typename LHS, typename RHS, typename ResultType> struct ArithmeticOper |
return false; |
} |
} // if the signs match this operation can't overflow |
- result = lhs - rhs; |
+ result = static_cast<ResultType>(lhs - rhs); |
return true; |
} |
@@ -291,7 +291,7 @@ template <typename LHS, typename RHS, typename ResultType> struct ArithmeticOper |
return false; |
} |
} |
- result = lhs * rhs; |
+ result = static_cast<ResultType>(lhs * rhs); |
return true; |
} |