[Lldb-commits] [lldb] r234260 - Fixed a crash because we weren't generating

Sean Callanan scallanan at apple.com
Mon Apr 6 16:51:08 PDT 2015


Author: spyffe
Date: Mon Apr  6 18:51:08 2015
New Revision: 234260

URL: http://llvm.org/viewvc/llvm-project?rev=234260&view=rev
Log:
Fixed a crash because we weren't generating
type-safe relocations against @reloc_placeholder.

<rdar://problem/20438754>

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=234260&r1=234259&r2=234260&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRForTarget.cpp (original)
+++ lldb/trunk/source/Expression/IRForTarget.cpp Mon Apr  6 18:51:08 2015
@@ -2455,10 +2455,11 @@ IRForTarget::BuildRelocation(llvm::Type
 
     llvm::ArrayRef<llvm::Constant *> offsets(offset_array, 1);
 
-    llvm::Constant *reloc_getelementptr = ConstantExpr::getGetElementPtr(type, m_reloc_placeholder, offsets);
-    llvm::Constant *reloc_getbitcast = ConstantExpr::getBitCast(reloc_getelementptr, type);
+    llvm::Constant *reloc_placeholder_bitcast = ConstantExpr::getBitCast(m_reloc_placeholder, type->getPointerTo());
+    llvm::Constant *reloc_getelementptr = ConstantExpr::getGetElementPtr(type, reloc_placeholder_bitcast, offsets);
+    llvm::Constant *reloc_bitcast = ConstantExpr::getBitCast(reloc_getelementptr, type);
 
-    return reloc_getbitcast;
+    return reloc_bitcast;
 }
 
 bool





More information about the lldb-commits mailing list