This revision was automatically updated to reflect the committed changes. Closed by commit rL335305: Ignore blacklist when generating __cfi_check_fail. (authored by eugenis, committed by ). Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D48454?vs=152395&id=152400#toc Repository: rL LLVM https://reviews.llvm.org/D48454 Files: cfe/trunk/lib/CodeGen/CGExpr.cpp cfe/trunk/test/CodeGen/cfi-check-fail2.c Index: cfe/trunk/test/CodeGen/cfi-check-fail2.c =================================================================== --- cfe/trunk/test/CodeGen/cfi-check-fail2.c +++ cfe/trunk/test/CodeGen/cfi-check-fail2.c @@ -3,6 +3,12 @@ // RUN: -fsanitize=cfi-vcall \ // RUN: -emit-llvm -o - %s | FileCheck %s +// Check that blacklist does not affect generated code. +// RUN: echo "src:*" > %t-all.blacklist +// RUN: %clang_cc1 -triple x86_64-unknown-linux -O0 -fsanitize-cfi-cross-dso \ +// RUN: -fsanitize=cfi-vcall -fsanitize-blacklist=%t-all.blacklist \ +// RUN: -emit-llvm -o - %s | FileCheck %s + void caller(void (*f)()) { f(); } Index: cfe/trunk/lib/CodeGen/CGExpr.cpp =================================================================== --- cfe/trunk/lib/CodeGen/CGExpr.cpp +++ cfe/trunk/lib/CodeGen/CGExpr.cpp @@ -3075,6 +3075,11 @@ StartFunction(GlobalDecl(), CGM.getContext().VoidTy, F, FI, Args, SourceLocation()); + // This function should not be affected by blacklist. This function does + // not have a source location, but "src:*" would still apply. Revert any + // changes to SanOpts made in StartFunction. + SanOpts = CGM.getLangOpts().Sanitize; + llvm::Value *Data = EmitLoadOfScalar(GetAddrOfLocalVar(&ArgData), /*Volatile=*/false, CGM.getContext().VoidPtrTy, ArgData.getLocation());
Index: cfe/trunk/test/CodeGen/cfi-check-fail2.c =================================================================== --- cfe/trunk/test/CodeGen/cfi-check-fail2.c +++ cfe/trunk/test/CodeGen/cfi-check-fail2.c @@ -3,6 +3,12 @@ // RUN: -fsanitize=cfi-vcall \ // RUN: -emit-llvm -o - %s | FileCheck %s +// Check that blacklist does not affect generated code. +// RUN: echo "src:*" > %t-all.blacklist +// RUN: %clang_cc1 -triple x86_64-unknown-linux -O0 -fsanitize-cfi-cross-dso \ +// RUN: -fsanitize=cfi-vcall -fsanitize-blacklist=%t-all.blacklist \ +// RUN: -emit-llvm -o - %s | FileCheck %s + void caller(void (*f)()) { f(); } Index: cfe/trunk/lib/CodeGen/CGExpr.cpp =================================================================== --- cfe/trunk/lib/CodeGen/CGExpr.cpp +++ cfe/trunk/lib/CodeGen/CGExpr.cpp @@ -3075,6 +3075,11 @@ StartFunction(GlobalDecl(), CGM.getContext().VoidTy, F, FI, Args, SourceLocation()); + // This function should not be affected by blacklist. This function does + // not have a source location, but "src:*" would still apply. Revert any + // changes to SanOpts made in StartFunction. + SanOpts = CGM.getLangOpts().Sanitize; + llvm::Value *Data = EmitLoadOfScalar(GetAddrOfLocalVar(&ArgData), /*Volatile=*/false, CGM.getContext().VoidPtrTy, ArgData.getLocation());
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits