diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index d077ee5..652fe67 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -2903,10 +2903,16 @@ void CodeGenFunction::EmitSanitizerStatReport(llvm::SanitizerStatKind SSK) { void CodeGenFunction::EmitKCFIOperandBundle( const CGCallee &Callee, SmallVectorImpl<llvm::OperandBundleDef> &Bundles) { - const FunctionProtoType *FP = - Callee.getAbstractInfo().getCalleeFunctionProtoType(); - if (FP) - Bundles.emplace_back("kcfi", CGM.CreateKCFITypeId(FP->desugar())); + const CGCalleeInfo &CI = Callee.getAbstractInfo(); + const FunctionProtoType *FP = CI.getCalleeFunctionProtoType(); + if (!FP) + return; + + StringRef Salt; + if (const auto &Info = FP->getExtraAttributeInfo()) + Salt = Info.CFISalt; + + Bundles.emplace_back("kcfi", CGM.CreateKCFITypeId(FP->desugar(), Salt)); } llvm::Value * |