We should not pretend that an int is a valid ObjC pointer. If your number truly is a pointer, po (id)myNumber is a better alternative. Fixes rdar://16585032

llvm-svn: 223379
This commit is contained in:
Enrico Granata 2014-12-04 19:31:51 +00:00
parent 5b3ce71b62
commit 20675c8478
1 changed files with 2 additions and 5 deletions

View File

@ -42,11 +42,8 @@ using namespace lldb_private;
bool bool
AppleObjCRuntime::GetObjectDescription (Stream &str, ValueObject &valobj) AppleObjCRuntime::GetObjectDescription (Stream &str, ValueObject &valobj)
{ {
bool is_signed; // ObjC objects can only be pointers
// ObjC objects can only be pointers, but we extend this to integer types because an expression might just if (!valobj.IsPointerType())
// result in an address, and we should try that to see if the address is an ObjC object.
if (!(valobj.IsPointerType() || valobj.IsIntegerType(is_signed)))
return false; return false;
// Make the argument list: we pass one arg, the address of our pointer, to the print function. // Make the argument list: we pass one arg, the address of our pointer, to the print function.