[Lldb-commits] [lldb] r148450 - /lldb/trunk/source/Target/ObjCLanguageRuntime.cpp
Sean Callanan
scallanan at apple.com
Wed Jan 18 17:10:27 PST 2012
Author: spyffe
Date: Wed Jan 18 19:10:27 2012
New Revision: 148450
URL: http://llvm.org/viewvc/llvm-project?rev=148450&view=rev
Log:
Fix to ensure that methods aren't called on NULL
objects.
Modified:
lldb/trunk/source/Target/ObjCLanguageRuntime.cpp
Modified: lldb/trunk/source/Target/ObjCLanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ObjCLanguageRuntime.cpp?rev=148450&r1=148449&r2=148450&view=diff
==============================================================================
--- lldb/trunk/source/Target/ObjCLanguageRuntime.cpp (original)
+++ lldb/trunk/source/Target/ObjCLanguageRuntime.cpp Wed Jan 18 19:10:27 2012
@@ -148,18 +148,20 @@
if (name_sans_category || class_name_sans_category)
{
const char *open_paren = strchr (name, '(');
- const char *close_paren = NULL;
if (open_paren)
{
if (class_name_sans_category)
class_name_sans_category->SetCStringWithLength (name + 2, open_paren - name - 2);
- close_paren = strchr (name, ')');
- if (close_paren)
+
+ if (name_sans_category)
{
- std::string buffer (name, open_paren - name);
- buffer.append (close_paren + 1);
- name_sans_category->SetCString (buffer.c_str());
-
+ const char *close_paren = strchr (name, ')');
+ if (close_paren)
+ {
+ std::string buffer (name, open_paren - name);
+ buffer.append (close_paren + 1);
+ name_sans_category->SetCString (buffer.c_str());
+ }
}
}
}
More information about the lldb-commits
mailing list