summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/IRForTarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Expression/IRForTarget.cpp')
-rw-r--r--lldb/source/Expression/IRForTarget.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp
index 2c0d8ba80fa..c16e1266b91 100644
--- a/lldb/source/Expression/IRForTarget.cpp
+++ b/lldb/source/Expression/IRForTarget.cpp
@@ -1831,19 +1831,27 @@ IRForTarget::ResolveExternals (Function &llvm_function)
global != end;
++global)
{
+ if (!global)
+ {
+ if (m_error_stream)
+ m_error_stream->Printf("Internal error [IRForTarget]: global variable is NULL");
+
+ return false;
+ }
+
+ std::string global_name = (*global).getName().str();
+
if (log)
log->Printf("Examining %s, DeclForGlobalValue returns %p",
- (*global).getName().str().c_str(),
+ global_name.c_str(),
DeclForGlobal(global));
-
- std::string global_name = (*global).getName().str();
if (global_name.find("OBJC_IVAR") == 0)
{
if (!HandleSymbol(global))
{
if (m_error_stream)
- m_error_stream->Printf("Error [IRForTarget]: Couldn't find Objective-C indirect ivar symbol %s\n", (*global).getName().str().c_str());
+ m_error_stream->Printf("Error [IRForTarget]: Couldn't find Objective-C indirect ivar symbol %s\n", global_name.c_str());
return false;
}
@@ -1863,7 +1871,7 @@ IRForTarget::ResolveExternals (Function &llvm_function)
if (!MaybeHandleVariable (global))
{
if (m_error_stream)
- m_error_stream->Printf("Internal error [IRForTarget]: Couldn't rewrite external variable %s\n", (*global).getName().str().c_str());
+ m_error_stream->Printf("Internal error [IRForTarget]: Couldn't rewrite external variable %s\n", global_name.c_str());
return false;
}
OpenPOWER on IntegriCloud