summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/APFloat.cpp4
-rw-r--r--llvm/lib/Support/StringRef.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp
index f6999a6f236..d26c5e6cd2e 100644
--- a/llvm/lib/Support/APFloat.cpp
+++ b/llvm/lib/Support/APFloat.cpp
@@ -4511,7 +4511,9 @@ hash_code hash_value(const APFloat &Arg) {
APFloat::APFloat(const fltSemantics &Semantics, StringRef S)
: APFloat(Semantics) {
auto StatusOrErr = convertFromString(S, rmNearestTiesToEven);
- assert(StatusOrErr && "Invalid floating point representation");
+ if (!StatusOrErr) {
+ assert(false && "Invalid floating point representation");
+ }
}
APFloat::opStatus APFloat::convert(const fltSemantics &ToSemantics,
diff --git a/llvm/lib/Support/StringRef.cpp b/llvm/lib/Support/StringRef.cpp
index 4142d130d51..b5db172cc1a 100644
--- a/llvm/lib/Support/StringRef.cpp
+++ b/llvm/lib/Support/StringRef.cpp
@@ -590,7 +590,7 @@ bool StringRef::getAsDouble(double &Result, bool AllowInexact) const {
APFloat F(0.0);
auto ErrOrStatus = F.convertFromString(*this, APFloat::rmNearestTiesToEven);
if (!ErrOrStatus) {
- assert("Invalid floating point representation");
+ assert(false && "Invalid floating point representation");
return true;
}
OpenPOWER on IntegriCloud