Bug 1093356 - Refine the range of constants outside the int32 range r=nbp,h4writer

This commit is contained in:
Dan Gohman 2014-11-04 10:26:31 -08:00
parent 75a86bdd93
commit b607ef3ff8

View File

@ -609,6 +609,9 @@ Range::setDouble(double l, double h)
if (l >= INT32_MIN && l <= INT32_MAX) {
lower_ = int32_t(::floor(l));
hasInt32LowerBound_ = true;
} else if (l >= INT32_MAX) {
lower_ = INT32_MAX;
hasInt32LowerBound_ = true;
} else {
lower_ = INT32_MIN;
hasInt32LowerBound_ = false;
@ -616,6 +619,9 @@ Range::setDouble(double l, double h)
if (h >= INT32_MIN && h <= INT32_MAX) {
upper_ = int32_t(::ceil(h));
hasInt32UpperBound_ = true;
} else if (h <= INT32_MIN) {
upper_ = INT32_MIN;
hasInt32UpperBound_ = true;
} else {
upper_ = INT32_MAX;
hasInt32UpperBound_ = false;