mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-18 05:18:43 +00:00
Fixed a crash because we weren't generating
type-safe relocations against @reloc_placeholder. <rdar://problem/20438754> llvm-svn: 234260
This commit is contained in:
parent
430220f0a7
commit
a85f0e82dc
@ -2455,10 +2455,11 @@ IRForTarget::BuildRelocation(llvm::Type *type, uint64_t offset)
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user