[Lldb-commits] [lldb] r159700 - /lldb/trunk/source/Expression/IRForTarget.cpp

Sean Callanan scallanan at apple.com
Tue Jul 3 18:26:26 PDT 2012


Author: spyffe
Date: Tue Jul  3 20:26:26 2012
New Revision: 159700

URL: http://llvm.org/viewvc/llvm-project?rev=159700&view=rev
Log:
Fixed a potential crash if a metadata category
we write into doesn't already exist.

<rdar://problem/11775508>

Modified:
    lldb/trunk/source/Expression/IRForTarget.cpp

Modified: lldb/trunk/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=159700&r1=159699&r2=159700&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRForTarget.cpp (original)
+++ lldb/trunk/source/Expression/IRForTarget.cpp Tue Jul  3 20:26:26 2012
@@ -1378,7 +1378,7 @@
     // What we're going to do here is make believe this was a regular old external
     // variable.  That means we need to make the metadata valid.
     
-    NamedMDNode *named_metadata = m_module->getNamedMetadata("clang.global.decl.ptrs");
+    NamedMDNode *named_metadata = m_module->getOrInsertNamedMetadata("clang.global.decl.ptrs");
     
     llvm::Value* values[2];
     values[0] = persistent_global;





More information about the lldb-commits mailing list