Index: src/compiler/operation-typer.cc |
diff --git a/src/compiler/operation-typer.cc b/src/compiler/operation-typer.cc |
index 75a73e1bb5a7210aae1a5b779d4500977343405e..73768dae733e70c9e4f2b5a81f698cb034edd62c 100644 |
--- a/src/compiler/operation-typer.cc |
+++ b/src/compiler/operation-typer.cc |
@@ -912,6 +912,9 @@ Type* OperationTyper::NumberImul(Type* lhs, Type* rhs) { |
Type* OperationTyper::NumberMax(Type* lhs, Type* rhs) { |
DCHECK(lhs->Is(Type::Number())); |
DCHECK(rhs->Is(Type::Number())); |
+ if (!lhs->IsInhabited() || !rhs->IsInhabited()) { |
+ return Type::None(); |
+ } |
if (lhs->Is(Type::NaN()) || rhs->Is(Type::NaN())) { |
return Type::NaN(); |
} |
@@ -935,6 +938,9 @@ Type* OperationTyper::NumberMax(Type* lhs, Type* rhs) { |
Type* OperationTyper::NumberMin(Type* lhs, Type* rhs) { |
DCHECK(lhs->Is(Type::Number())); |
DCHECK(rhs->Is(Type::Number())); |
+ if (!lhs->IsInhabited() || !rhs->IsInhabited()) { |
+ return Type::None(); |
+ } |
if (lhs->Is(Type::NaN()) || rhs->Is(Type::NaN())) { |
return Type::NaN(); |
} |