Index: src/compiler/typer.cc |
diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc |
index 3649f7d79dcd4c1bf7f0699c92b9c9d512364fed..d7faa5a855b9b7134d651f599f904402b9532a47 100644 |
--- a/src/compiler/typer.cc |
+++ b/src/compiler/typer.cc |
@@ -408,10 +408,19 @@ Type* Typer::Visitor::FalsifyUndefined(Type* type, Typer* t) { |
Type* Typer::Visitor::Rangify(Type* type, Typer* t) { |
if (type->IsRange()) return type; // Shortcut. |
- if (!type->Is(t->integer)) return type; // Give up. |
+ if (!type->Is(t->integer) && !type->Is(Type::Integral32())) { |
+ return type; // Give up on non-integer types. |
+ } |
+ double min = type->Min(); |
+ double max = type->Max(); |
+ // Handle the degenerate case of empty bitset types (such as |
+ // OtherUnsigned31 and OtherSigned32 on 64-bit architectures). |
+ if (std::isnan(min)) { |
+ DCHECK(std::isnan(max)); |
+ return type; |
+ } |
Factory* f = t->isolate()->factory(); |
- return Type::Range(f->NewNumber(type->Min()), f->NewNumber(type->Max()), |
- t->zone()); |
+ return Type::Range(f->NewNumber(min), f->NewNumber(max), t->zone()); |
} |