Descriptioncc: Handle overflow/underflow in MathUtil::RoundUp/RoundDown functions.
The existing functions are renamed as given below.
RoundUp -> UncheckedRoundUp
RoundDown -> UncheckedRoundDown
These functions add the DCHECKs for verifying overflow/underflow by
using VerifyOverflow and VerifyUnderflow functions. The checked
versions CheckedRoundUp and CheckedRoundDown are added to implicitly
check the overflow and underflow conditions. These versions CRASH if
rounded up/down values overflow/underflow.
P.N. All the rounding functions in current codebase have been replaced
by unchecked versions.
Following new unittests are added.
MathUtilTest.RoundUpOverFlow
MathUtilTest.RoundDownUnderFlow
BUG=515566
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Committed: https://crrev.com/239014d69890b6441de528a08340eda25747ecf2
Cr-Commit-Position: refs/heads/master@{#342049}
Patch Set 1 #Patch Set 2 : Fixed signed/unsigned mismatch error. #
Total comments: 3
Patch Set 3 : Review comments. #Patch Set 4 : Small nit. #Patch Set 5 : Small nit. #
Depends on Patchset: Messages
Total messages: 23 (9 generated)
|