[Lldb-commits] [lldb] [LLDB] Fix error returns in CastToBasicType and CastToEnumType in ValueObject. (PR #117401)

via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 3 10:54:25 PST 2024


================
@@ -3194,16 +3194,19 @@ lldb::ValueObjectSP ValueObject::CastToBasicType(CompilerType type) {
       GetCompilerType().IsPointerType() || GetCompilerType().IsNullPtrType();
   bool is_float = GetCompilerType().IsFloat();
   bool is_integer = GetCompilerType().IsInteger();
+  ExecutionContext exe_ctx(GetExecutionContextRef());
 
   if (!type.IsScalarType()) {
-    m_error = Status::FromErrorString("target type must be a scalar");
-    return GetSP();
+    Status error = Status::FromErrorString("target type must be a scalar");
+    return ValueObjectConstResult::Create(
+        exe_ctx.GetBestExecutionContextScope(), error.Clone());
----------------
cmtice wrote:

Done.

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


More information about the lldb-commits mailing list