[Lldb-commits] [lldb] [LLDB] Add more helper functions to ValueObject class. (PR #87197)

via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 6 09:56:48 PDT 2024


================
@@ -3141,15 +3141,15 @@ lldb::ValueObjectSP ValueObject::CastToBasicType(CompilerType type) {
     val_byte_size = temp.value();
 
   if (is_pointer) {
+    if (!type.IsInteger()) {
+      m_error.SetErrorString("target type must be an integer");
+      return GetSP();
+    }
     if (!type.IsBoolean() && type_byte_size < val_byte_size) {
----------------
jimingham wrote:

That's better, but now the `type.IsBoolean` is entirely pointless, since you would never get to this code in that case.

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


More information about the lldb-commits mailing list