summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-08-12 17:42:34 +0000
committerDale Johannesen <dalej@apple.com>2009-08-12 17:42:34 +0000
commit34c08bbbf97ef5672c8c955f9b31549be0d83eff (patch)
tree0cba8e5073303c9fadf0b2fb607f1a1615691f66 /llvm/lib
parentcecfe61cd1a95fdfc2a9256e1ca23d1079a2305a (diff)
downloadbcm5719-llvm-34c08bbbf97ef5672c8c955f9b31549be0d83eff.tar.gz
bcm5719-llvm-34c08bbbf97ef5672c8c955f9b31549be0d83eff.zip
Fix a nondeterministic bug in APInt::roundToDouble;
when !isSingleWord() but getActiveBits() is small, we were using the pointer value instead of the low word of the integer value. llvm-svn: 78821
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/APInt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index a034fd1e797..6638fccfef5 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -897,10 +897,10 @@ double APInt::roundToDouble(bool isSigned) const {
// Handle the simple case where the value is contained in one uint64_t.
if (isSingleWord() || getActiveBits() <= APINT_BITS_PER_WORD) {
if (isSigned) {
- int64_t sext = (int64_t(VAL) << (64-BitWidth)) >> (64-BitWidth);
+ int64_t sext = (int64_t(getWord(0)) << (64-BitWidth)) >> (64-BitWidth);
return double(sext);
} else
- return double(VAL);
+ return double(getWord(0));
}
// Determine if the value is negative.
OpenPOWER on IntegriCloud