Skip to content

Commit bbc213a

Browse files
committed
[asan] compiler-rt version of D113143
1 parent def2329 commit bbc213a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %clang_asan -O0 %s -o %t -w && not %run %t 2>&1 | FileCheck %s
2+
// RUN: %clang_asan -O2 %s -o %t -w && not %run %t 2>&1 | FileCheck %s
3+
4+
int global_array[100] = {-1};
5+
6+
// This access is 412 bytes after the start of the global: past the end of the
7+
// uninstrumented array, but within the bounds of the extended instrumented
8+
// array. We should ensure this is still instrumented.
9+
int main(void) { return global_array[103]; }
10+
11+
// CHECK: AddressSanitizer: global-buffer-overflow on address
12+
// CHECK: is located 12 bytes to the right of global variable 'global_array'

0 commit comments

Comments
 (0)