Check for negative 0 when deciding whether a constant has type Integer32.

Review URL: http://codereview.chromium.org/1225005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4258 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 764d8a95
......@@ -115,8 +115,12 @@ class NumberInfo {
// Integer32 is an integer that can be represented as either a signed
// 32-bit integer or as an unsigned 32-bit integer. It has to be
// in the range [-2^31, 2^32 - 1].
// in the range [-2^31, 2^32 - 1]. We also have to check for negative 0
// as it is not an Integer32.
static inline bool IsInt32Double(double value) {
const DoubleRepresentation minus_zero(-0.0);
DoubleRepresentation rep(value);
if (rep.bits == minus_zero.bits) return false;
if (value >= kMinInt && value <= kMaxUInt32) {
if (value <= kMaxInt && value == static_cast<int32_t>(value)) {
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment