Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[asan] compiler-rt version of D113143
- Loading branch information
1 parent
def2329
commit bbc213a
Showing
1 changed file
with
12 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// RUN: %clang_asan -O0 %s -o %t -w && not %run %t 2>&1 | FileCheck %s | ||
// RUN: %clang_asan -O2 %s -o %t -w && not %run %t 2>&1 | FileCheck %s | ||
|
||
int global_array[100] = {-1}; | ||
|
||
// This access is 412 bytes after the start of the global: past the end of the | ||
// uninstrumented array, but within the bounds of the extended instrumented | ||
// array. We should ensure this is still instrumented. | ||
int main(void) { return global_array[103]; } | ||
|
||
// CHECK: AddressSanitizer: global-buffer-overflow on address | ||
// CHECK: is located 12 bytes to the right of global variable 'global_array' |