[compiler-rt] bbc213a - [asan] compiler-rt version of D113143

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 4 23:51:28 PDT 2021


Author: Vitaly Buka
Date: 2021-11-04T23:51:16-07:00
New Revision: bbc213afd1bdd45c66204d28c68e049602cd998d

URL: https://github.com/llvm/llvm-project/commit/bbc213afd1bdd45c66204d28c68e049602cd998d
DIFF: https://github.com/llvm/llvm-project/commit/bbc213afd1bdd45c66204d28c68e049602cd998d.diff

LOG: [asan] compiler-rt version of D113143

Added: 
    compiler-rt/test/asan/TestCases/PR52382.c

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/PR52382.c b/compiler-rt/test/asan/TestCases/PR52382.c
new file mode 100644
index 0000000000000..9cab2b9640844
--- /dev/null
+++ b/compiler-rt/test/asan/TestCases/PR52382.c
@@ -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'


        


More information about the llvm-commits mailing list