Fixing a logic flaw with NSURL summary. This was caught by running the test suite in 32bit mode

llvm-svn: 174778
This commit is contained in:
Enrico Granata 2013-02-08 23:54:46 +00:00
parent a94ee7da81
commit 27692bcf28
1 changed files with 3 additions and 3 deletions

View File

@ -1085,20 +1085,20 @@ lldb_private::formatters::NSURLSummaryProvider (ValueObject& valobj, Stream& str
ClangASTType type(valobj.GetClangAST(),valobj.GetClangType());
ValueObjectSP text(valobj.GetSyntheticChildAtOffset(offset_text, type, true));
ValueObjectSP base(valobj.GetSyntheticChildAtOffset(offset_base, type, true));
if (!text || !base)
if (!text)
return false;
if (text->GetValueAsUnsigned(0) == 0)
return false;
StreamString summary;
if (!NSStringSummaryProvider(*text, summary))
return false;
if (base->GetValueAsUnsigned(0))
if (base && base->GetValueAsUnsigned(0))
{
if (summary.GetSize() > 0)
summary.GetString().resize(summary.GetSize()-1);
summary.Printf(" -- ");
StreamString base_summary;
if (NSStringSummaryProvider(*base, base_summary) && base_summary.GetSize() > 0)
if (NSURLSummaryProvider(*base, base_summary) && base_summary.GetSize() > 0)
summary.Printf("%s",base_summary.GetSize() > 2 ? base_summary.GetData() + 2 : base_summary.GetData());
}
if (summary.GetSize())