mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-24 21:14:56 +00:00
Fixed parsing of hex floats.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122963 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2f867a63da
commit
4bb46f43eb
@ -194,11 +194,11 @@ totalExponent(StringRef::iterator p, StringRef::iterator end,
|
|||||||
assert(value < 10U && "Invalid character in exponent");
|
assert(value < 10U && "Invalid character in exponent");
|
||||||
|
|
||||||
unsignedExponent = unsignedExponent * 10 + value;
|
unsignedExponent = unsignedExponent * 10 + value;
|
||||||
if (unsignedExponent > 65535)
|
if (unsignedExponent > 32767)
|
||||||
overflow = true;
|
overflow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exponentAdjustment > 65535 || exponentAdjustment < -65536)
|
if (exponentAdjustment > 32767 || exponentAdjustment < -32768)
|
||||||
overflow = true;
|
overflow = true;
|
||||||
|
|
||||||
if (!overflow) {
|
if (!overflow) {
|
||||||
@ -206,12 +206,12 @@ totalExponent(StringRef::iterator p, StringRef::iterator end,
|
|||||||
if (negative)
|
if (negative)
|
||||||
exponent = -exponent;
|
exponent = -exponent;
|
||||||
exponent += exponentAdjustment;
|
exponent += exponentAdjustment;
|
||||||
if (exponent > 65535 || exponent < -65536)
|
if (exponent > 32767 || exponent < -32768)
|
||||||
overflow = true;
|
overflow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overflow)
|
if (overflow)
|
||||||
exponent = negative ? -65536: 65535;
|
exponent = negative ? -32768: 32767;
|
||||||
|
|
||||||
return exponent;
|
return exponent;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user