================ @@ -3138,13 +3141,13 @@ lldb::ValueObjectSP ValueObject::CastToBasicType(CompilerType type) { val_byte_size = temp.value(); if (is_pointer) { - if (type.IsBoolean() && type_byte_size < val_byte_size) { + if (!type.IsBoolean() && type_byte_size < val_byte_size) { ---------------- jimingham wrote:
The `!` here seems right, but still this logic is odd. With this code, if I pass 32 bit float (on a 64 bit pointers system), the error I'll get is that it's too small. OTOH, if I pass a 64 bit float, I'll get "must be integer". That's confusing. If you aren't planning to take anything but integers, it seems like you should check that first, then check the size. https://github.com/llvm/llvm-project/pull/87197 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits