summaryrefslogtreecommitdiff
path: root/lib/VMCore/ConstantFold.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-12-29 01:33:36 +0000
committerChris Lattner <sabre@nondot.org>2010-12-29 01:33:36 +0000
commite562dba845265b5577699eb857fead1ea0f7905b (patch)
tree36e175f00fec410dfece6c6150501f117d11a829 /lib/VMCore/ConstantFold.cpp
parentb4601bd2ffdde372f1323f6b6ec98acd433501ce (diff)
downloadllvm-e562dba845265b5577699eb857fead1ea0f7905b.tar.gz
llvm-e562dba845265b5577699eb857fead1ea0f7905b.tar.bz2
llvm-e562dba845265b5577699eb857fead1ea0f7905b.tar.xz
fix PR8867: a crash handling fp128. Thanks to Nick for the testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r--lib/VMCore/ConstantFold.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index 5c284b746d..27676562d4 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -637,7 +637,7 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, Constant *V,
case Instruction::SIToFP:
if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
APInt api = CI->getValue();
- APFloat apf(APInt::getNullValue(DestTy->getPrimitiveSizeInBits()));
+ APFloat apf(APInt::getNullValue(DestTy->getPrimitiveSizeInBits()), true);
(void)apf.convertFromAPInt(api,
opc==Instruction::SIToFP,
APFloat::rmNearestTiesToEven);