[PATCH] D69770: Add recoverable string parsing errors to APFloat

Ehud Katz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 10:29:13 PST 2019


ekatz marked 2 inline comments as done.
ekatz added inline comments.


================
Comment at: llvm/lib/Support/APFloat.cpp:273
+  if (p != end)
+    return createError("Invalid exponent in exponent");
 
----------------
arsenm wrote:
> Error message sounds like nonsense 
It is actually incorrect. There should not be an error returned, but `absExponent` should still be clamped.


================
Comment at: llvm/unittests/ADT/APFloatTest.cpp:1322
+  EXPECT_EQ(convertToErrorFromString("+0x1.1p-"), "Exponent has no digits");
+  EXPECT_EQ(convertToErrorFromString("-0x1.1p-"), "Exponent has no digits");
 }
----------------
arsenm wrote:
> It’s a gtestism that these operands should be swapped
Will do.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69770/new/

https://reviews.llvm.org/D69770





More information about the llvm-commits mailing list