Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index 79c7964d15492ead5d3312a5ef53ad82770c1154..5e08b466aff1ba06518de0fe978ab19546c21638 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -1673,6 +1673,16 @@ Range* HChange::InferRange(Zone* zone) { |
set_type(HType::Smi()); |
ClearChangesFlag(kNewSpacePromotion); |
} |
+ if (to().IsSmiOrTagged() && |
+ input_range != NULL && |
+ input_range->IsInSmiRange() && |
+ (!SmiValuesAre32Bits() || |
+ !value()->CheckFlag(HValue::kUint32) || |
+ input_range->upper() != kMaxInt)) { |
+ // The Range class can't express upper bounds in the (kMaxInt, kMaxUint32] |
+ // interval, so we treat kMaxInt as a sentinel for this entire interval. |
+ ClearFlag(kCanOverflow); |
+ } |
Range* result = (input_range != NULL) |
? input_range->Copy(zone) |
: HValue::InferRange(zone); |