-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[LLDB] Add more helper functions to ValueObject class. #87197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
68cb68d
b6a1e23
145e74b
22e1b06
b8eee30
8709f70
1e41bfa
28748a9
499a097
fa25850
d4e7f69
6ca00e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's better, but now the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops! Good catch; I've fixed that now. |
||
m_error.SetErrorString( | ||
"target type cannot be smaller than the pointer type"); | ||
return GetSP(); | ||
} | ||
if (!type.IsInteger()) { | ||
m_error.SetErrorString("target type must be an integer"); | ||
return GetSP(); | ||
} | ||
} | ||
|
||
if (type.IsBoolean()) { | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure what the original code intended with that
type.IsBoolean
? Makes no sense we would only return the "too small" error when the incoming type is Boolean.But 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.