-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hwasan] Respect strip_path_prefix printing locals (#76132)
- Loading branch information
1 parent
38eea57
commit 7c3b67d
Showing
2 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// RUN: %clang_hwasan -O0 %s -o %t && %env_hwasan_opts=strip_path_prefix='"%S/"' not %run %t 2>&1 | FileCheck %s | ||
|
||
// Stack histories currently are not recorded on x86. | ||
// XFAIL: target=x86_64{{.*}} | ||
|
||
#include <assert.h> | ||
#include <sanitizer/hwasan_interface.h> | ||
#include <stdio.h> | ||
|
||
int t; | ||
|
||
__attribute__((noinline)) char *buggy() { | ||
char *volatile p; | ||
char zzz = {}; | ||
char yyy = {}; | ||
p = t ? &yyy : &zzz; | ||
return p; | ||
} | ||
|
||
int main() { | ||
char *p = buggy(); | ||
return *p; | ||
// CHECK: READ of size 1 at | ||
// CHECK: #0 {{.*}} in main strip_path_prefix.c:[[@LINE-2]] | ||
// CHECK: Potentially referenced stack objects: | ||
// CHECK: zzz in buggy strip_path_prefix.c:[[@LINE-12]] | ||
} |