aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/ExecutionEngine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index 325ab8af52..fb9ff371d5 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -525,10 +525,10 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
GenericValue Result;
switch (C->getType()->getTypeID()) {
case Type::FloatTyID:
- Result.FloatVal = (float)cast<ConstantFP>(C)->getValue();
+ Result.FloatVal = cast<ConstantFP>(C)->getValueAPF().convertToFloat();
break;
case Type::DoubleTyID:
- Result.DoubleVal = (double)cast<ConstantFP>(C)->getValue();
+ Result.DoubleVal = cast<ConstantFP>(C)->getValueAPF().convertToDouble();
break;
case Type::IntegerTyID:
Result.IntVal = cast<ConstantInt>(C)->getValue();