r369980 - hwasan, codegen: Keep more lifetime markers used for hwasan
Vitaly Buka via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 26 15:16:05 PDT 2019
Author: vitalybuka
Date: Mon Aug 26 15:16:05 2019
New Revision: 369980
URL: http://llvm.org/viewvc/llvm-project?rev=369980&view=rev
Log:
hwasan, codegen: Keep more lifetime markers used for hwasan
Reviewers: eugenis
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66697
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
cfe/trunk/test/CodeGen/lifetime-sanitizer.c
cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=369980&r1=369979&r2=369980&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Mon Aug 26 15:16:05 2019
@@ -521,6 +521,7 @@ EmitMaterializeTemporaryExpr(const Mater
ConditionalEvaluation *OldConditional = nullptr;
CGBuilderTy::InsertPoint OldIP;
if (isInConditionalBranch() && !E->getType().isDestructedType() &&
+ !SanOpts.has(SanitizerKind::HWAddress) &&
!SanOpts.has(SanitizerKind::Memory) &&
!CGM.getCodeGenOpts().SanitizeAddressUseAfterScope) {
OldConditional = OutermostConditional;
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=369980&r1=369979&r2=369980&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Mon Aug 26 15:16:05 2019
@@ -49,6 +49,7 @@ static bool shouldEmitLifetimeMarkers(co
// Sanitizers may use markers.
if (CGOpts.SanitizeAddressUseAfterScope ||
+ LangOpts.Sanitize.has(SanitizerKind::HWAddress) ||
LangOpts.Sanitize.has(SanitizerKind::Memory))
return true;
Modified: cfe/trunk/test/CodeGen/lifetime-sanitizer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/lifetime-sanitizer.c?rev=369980&r1=369979&r2=369980&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/lifetime-sanitizer.c (original)
+++ cfe/trunk/test/CodeGen/lifetime-sanitizer.c Mon Aug 26 15:16:05 2019
@@ -5,6 +5,9 @@
// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
// RUN: -fsanitize=memory %s | \
// RUN: FileCheck %s -check-prefix=LIFETIME
+// RUN: %clang -target aarch64-linux-gnu -S -emit-llvm -o - -O0 \
+// RUN: -fsanitize=hwaddress %s | \
+// RUN: FileCheck %s -check-prefix=LIFETIME
extern int bar(char *A, int n);
Modified: cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp?rev=369980&r1=369979&r2=369980&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp Mon Aug 26 15:16:05 2019
@@ -6,6 +6,9 @@
// RUN: %clang -w -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
// RUN: -fsanitize=memory %s | \
// RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
+// RUN: %clang -w -target aarch64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
+// RUN: -fsanitize=hwaddress %s | \
+// RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
extern int bar(char *A, int n);
More information about the cfe-commits
mailing list