CFI: Introduce -fsanitize=cfi-icall flag.
This flag causes the compiler to emit bit set entries for functions as well as runtime bitset checks at indirect call sites. Depends on the new function bitset mechanism. Differential Revision: http://reviews.llvm.org/D11857 llvm-svn: 247238
This commit is contained in:
@@ -2473,12 +2473,9 @@ void CodeGenFunction::EmitVTablePtrCheck(const CXXRecordDecl *RD,
|
||||
|
||||
SanitizerScope SanScope(this);
|
||||
|
||||
std::string OutName;
|
||||
llvm::raw_string_ostream Out(OutName);
|
||||
CGM.getCXXABI().getMangleContext().mangleCXXVTableBitSet(RD, Out);
|
||||
|
||||
llvm::Value *BitSetName = llvm::MetadataAsValue::get(
|
||||
getLLVMContext(), llvm::MDString::get(getLLVMContext(), Out.str()));
|
||||
getLLVMContext(),
|
||||
CGM.CreateMetadataIdentifierForType(QualType(RD->getTypeForDecl(), 0)));
|
||||
|
||||
llvm::Value *CastedVTable = Builder.CreateBitCast(VTable, Int8PtrTy);
|
||||
llvm::Value *BitSetTest =
|
||||
|
||||
Reference in New Issue
Block a user