[Lldb-commits] [lldb] [lldb] Fix casting from float in `ValueObject::CastToEnumType` (PR #191908)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Sat Apr 18 09:24:47 PDT 2026


================
@@ -3334,15 +3335,15 @@ lldb::ValueObjectSP ValueObject::CastToEnumType(CompilerType type) {
       if (status & llvm::APFloatBase::opInvalidOp)
         return ValueObjectConstResult::Create(
             exe_ctx.GetBestExecutionContextScope(),
-            Status::FromErrorStringWithFormat(
-                "invalid type cast detected: %s",
-                llvm::toString(value_or_err.takeError()).c_str()));
+            Status::FromErrorString("invalid cast from float to integer"));
       return ValueObject::CreateValueObjectFromAPInt(exe_ctx, integer, type,
                                                      "result");
     } else
       return ValueObjectConstResult::Create(
           exe_ctx.GetBestExecutionContextScope(),
-          Status::FromErrorString("cannot get value as APFloat"));
+          Status::FromErrorStringWithFormat(
----------------
Michael137 wrote:

i think we have a formatv version of this iirc?

https://github.com/llvm/llvm-project/pull/191908


More information about the lldb-commits mailing list