[turbofan] Fix bug in Rangify.
authorbmeurer@chromium.org <bmeurer@chromium.org>
Mon, 3 Nov 2014 11:50:43 +0000 (11:50 +0000)
committerbmeurer@chromium.org <bmeurer@chromium.org>
Mon, 3 Nov 2014 11:51:18 +0000 (11:51 +0000)
R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#25067}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/compiler/typer.cc

index 3649f7d..dc85405 100644 (file)
@@ -408,7 +408,9 @@ 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.
+  }
   Factory* f = t->isolate()->factory();
   return Type::Range(f->NewNumber(type->Min()), f->NewNumber(type->Max()),
                      t->zone());