Skip to content

Commit 4bd4649

Browse files
authored
[clang] add a 'DisableCFICheck' restriction to KCFI
1 parent 67753f2 commit 4bd4649

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,8 @@ void CodeGenModule::Release() {
10711071
CodeGenOpts.SanitizeCfiCanonicalJumpTables);
10721072
}
10731073

1074-
if (LangOpts.Sanitize.has(SanitizerKind::KCFI)) {
1074+
if (LangOpts.Sanitize.has(SanitizerKind::KCFI) &&
1075+
!CodeGenOpts.DisableCFICheck) {
10751076
getModule().addModuleFlag(llvm::Module::Override, "kcfi", 1);
10761077
// KCFI assumes patchable-function-prefix is the same for all indirectly
10771078
// called functions. Store the expected offset for code generation.

0 commit comments

Comments
 (0)