Index: src/crankshaft/hydrogen-instructions.cc |
diff --git a/src/crankshaft/hydrogen-instructions.cc b/src/crankshaft/hydrogen-instructions.cc |
index 7273788bc734e8f4c54f91ed86da3bfa6836d244..465a18ae46e6145d08cb35d5156306cc3ab378d3 100644 |
--- a/src/crankshaft/hydrogen-instructions.cc |
+++ b/src/crankshaft/hydrogen-instructions.cc |
@@ -3578,10 +3578,12 @@ HInstruction* HDiv::New(Isolate* isolate, Zone* zone, HValue* context, |
return H_CONSTANT_INT(double_res); |
} |
return H_CONSTANT_DOUBLE(double_res); |
- } else { |
+ } else if (c_left->DoubleValue() != 0) { |
int sign = Double(c_left->DoubleValue()).Sign() * |
Double(c_right->DoubleValue()).Sign(); // Right could be -0. |
return H_CONSTANT_DOUBLE(sign * V8_INFINITY); |
+ } else { |
+ return H_CONSTANT_DOUBLE(std::numeric_limits<double>::quiet_NaN()); |
} |
} |
} |