[Lldb-commits] [lldb] r174778 - Fixing a logic flaw with NSURL summary. This was caught by running the test suite in 32bit mode

Enrico Granata egranata at apple.com
Fri Feb 8 15:54:46 PST 2013


Author: enrico
Date: Fri Feb  8 17:54:46 2013
New Revision: 174778

URL: http://llvm.org/viewvc/llvm-project?rev=174778&view=rev
Log:
Fixing a logic flaw with NSURL summary. This was caught by running the test suite in 32bit mode

Modified:
    lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp

Modified: lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp?rev=174778&r1=174777&r2=174778&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp (original)
+++ lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp Fri Feb  8 17:54:46 2013
@@ -1085,20 +1085,20 @@ lldb_private::formatters::NSURLSummaryPr
         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())





More information about the lldb-commits mailing list