[Lldb-commits] [lldb] r164574 - /lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h

Enrico Granata egranata at apple.com
Mon Sep 24 16:30:10 PDT 2012


Author: enrico
Date: Mon Sep 24 18:30:10 2012
New Revision: 164574

URL: http://llvm.org/viewvc/llvm-project?rev=164574&view=rev
Log:
Making sure we do not try to compare a NULL string - which would cause us to crash

Modified:
    lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h

Modified: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h?rev=164574&r1=164573&r2=164574&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h Mon Sep 24 18:30:10 2012
@@ -68,7 +68,8 @@
             if (m_is_kvo == eLazyBoolCalculate)
             {
                 const char* class_name = GetClassName().AsCString();
-                m_is_kvo = (LazyBool)(strstr(class_name,"NSKVONotifying_") == class_name);
+                if (class_name && *class_name)
+                    m_is_kvo = (LazyBool)(strstr(class_name,"NSKVONotifying_") == class_name);
             }
             return (m_is_kvo == eLazyBoolYes);
         }
@@ -81,8 +82,9 @@
             if (m_is_cf == eLazyBoolCalculate)
             {
                 const char* class_name = GetClassName().AsCString();
-                m_is_cf = (LazyBool)(strcmp(class_name,"__NSCFType") == 0 ||
-                                     strcmp(class_name,"NSCFType") == 0);
+                if (class_name && *class_name)
+                    m_is_cf = (LazyBool)(strcmp(class_name,"__NSCFType") == 0 ||
+                                         strcmp(class_name,"NSCFType") == 0);
             }
             return (m_is_cf == eLazyBoolYes);
         }





More information about the lldb-commits mailing list