From 4bb46f43eb48a9c7211916f60ee606edcd4fb4a2 Mon Sep 17 00:00:00 2001 From: Abramo Bagnara Date: Thu, 6 Jan 2011 16:55:14 +0000 Subject: [PATCH] Fixed parsing of hex floats. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122963 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/APFloat.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index a83801ed068..0048ce57c2e 100644 --- a/lib/Support/APFloat.cpp +++ b/lib/Support/APFloat.cpp @@ -194,11 +194,11 @@ totalExponent(StringRef::iterator p, StringRef::iterator end, assert(value < 10U && "Invalid character in exponent"); unsignedExponent = unsignedExponent * 10 + value; - if (unsignedExponent > 65535) + if (unsignedExponent > 32767) overflow = true; } - if (exponentAdjustment > 65535 || exponentAdjustment < -65536) + if (exponentAdjustment > 32767 || exponentAdjustment < -32768) overflow = true; if (!overflow) { @@ -206,12 +206,12 @@ totalExponent(StringRef::iterator p, StringRef::iterator end, if (negative) exponent = -exponent; exponent += exponentAdjustment; - if (exponent > 65535 || exponent < -65536) + if (exponent > 32767 || exponent < -32768) overflow = true; } if (overflow) - exponent = negative ? -65536: 65535; + exponent = negative ? -32768: 32767; return exponent; } -- 2.34.1