Fix float to int conversion in base/numerics
commitfafe071bac241504791c2904af9fbfea476274c8
authorjschuh <jschuh@chromium.org>
Mon, 14 Sep 2015 20:21:24 +0000 (14 13:21 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 14 Sep 2015 20:21:58 +0000 (14 20:21 +0000)
treebd4acb9766b91cfdd651eeca4aeb333c501553bf
parentc161aa945c811b260f7f2981e592f63d16c3a106
Fix float to int conversion in base/numerics

This addresses the bug where range checks are incorrect when
converting from a floating point value to an integral value of
higher precision but lower width. It also reverts a previous
attempted fix that eliminated false negatives but introduced
false positives.

BUG=522989

Review URL: https://codereview.chromium.org/1338553003

Cr-Commit-Position: refs/heads/master@{#348706}
base/numerics/safe_conversions_impl.h
base/numerics/safe_numerics_unittest.cc