aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 987b02bb8f..786155af28 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -224,11 +224,10 @@ static APSInt HandleFloatToIntCast(QualType DestType, QualType SrcType,
bool DestSigned = DestType->isSignedIntegerOrEnumerationType();
// FIXME: Warning for overflow.
- uint64_t Space[4];
+ APSInt Result(DestWidth, !DestSigned);
bool ignored;
- (void)Value.convertToInteger(Space, DestWidth, DestSigned,
- llvm::APFloat::rmTowardZero, &ignored);
- return APSInt(llvm::APInt(DestWidth, 4, Space), !DestSigned);
+ (void)Value.convertToInteger(Result, llvm::APFloat::rmTowardZero, &ignored);
+ return Result;
}
static APFloat HandleFloatToFloatCast(QualType DestType, QualType SrcType,