[llvm-branch-commits] [lldb] r183191 - Merging r183153:
Bill Wendling
isanbard at gmail.com
Mon Jun 3 21:40:04 PDT 2013
Author: void
Date: Mon Jun 3 23:40:03 2013
New Revision: 183191
URL: http://llvm.org/viewvc/llvm-project?rev=183191&view=rev
Log:
Merging r183153:
------------------------------------------------------------------------
r183153 | dmalea | 2013-06-03 13:45:54 -0700 (Mon, 03 Jun 2013) | 7 lines
Fix crash (in optimized builds) due to invalid metadata operand
- ConstantDataArray is not a valid MDNode operand
- encode function-name strings in metadata by wrapping in an MDString instead
- should resolve reported by http://llvm-jenkins.debian.net/job/llvm-toolchain-quantal-binaries/architecture=amd64,distribution=quantal/173/
------------------------------------------------------------------------
Modified:
lldb/branches/release_33/ (props changed)
lldb/branches/release_33/source/Expression/IRDynamicChecks.cpp
lldb/branches/release_33/source/Expression/IRForTarget.cpp
Propchange: lldb/branches/release_33/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jun 3 23:40:03 2013
@@ -1 +1,2 @@
/lldb/branches/apple/python-GIL:156467-162159
+/lldb/trunk:183153
Modified: lldb/branches/release_33/source/Expression/IRDynamicChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_33/source/Expression/IRDynamicChecks.cpp?rev=183191&r1=183190&r2=183191&view=diff
==============================================================================
--- lldb/branches/release_33/source/Expression/IRDynamicChecks.cpp (original)
+++ lldb/branches/release_33/source/Expression/IRDynamicChecks.cpp Mon Jun 3 23:40:03 2013
@@ -517,23 +517,16 @@ private:
return false;
}
- ConstantDataArray *real_name = dyn_cast<ConstantDataArray>(metadata->getOperand(0));
+ MDString *real_name = dyn_cast<MDString>(metadata->getOperand(0));
if (!real_name)
{
if (log)
- log->Printf("Function call metadata is not a ConstantArray for [%p] %s", call_inst, PrintValue(call_inst).c_str());
+ log->Printf("Function call metadata is not an MDString for [%p] %s", call_inst, PrintValue(call_inst).c_str());
return false;
}
-
- if (!real_name->isString())
- {
- if (log)
- log->Printf("Function call metadata is not a string for [%p] %s", call_inst, PrintValue(call_inst).c_str());
- return false;
- }
-
- std::string name_str = real_name->getAsString();
+
+ std::string name_str = real_name->getString();
const char* name_cstr = name_str.c_str();
if (log)
Modified: lldb/branches/release_33/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_33/source/Expression/IRForTarget.cpp?rev=183191&r1=183190&r2=183191&view=diff
==============================================================================
--- lldb/branches/release_33/source/Expression/IRForTarget.cpp (original)
+++ lldb/branches/release_33/source/Expression/IRForTarget.cpp Mon Jun 3 23:40:03 2013
@@ -337,12 +337,10 @@ IRForTarget::RegisterFunctionMetadata(LL
if (Instruction *user_inst = dyn_cast<Instruction>(user))
{
- Constant *name_array = ConstantDataArray::getString(context, StringRef(name));
-
- ArrayRef<Value *> md_values(name_array);
-
- MDNode *metadata = MDNode::get(context, md_values);
-
+ MDString* md_name = MDString::get(context, StringRef(name));
+
+ MDNode *metadata = MDNode::get(context, md_name);
+
user_inst->setMetadata("lldb.call.realName", metadata);
}
else
More information about the llvm-branch-commits
mailing list