[compiler-rt] 3f7c9cc - [compiler-rt] Conceal UB in sanitizer_common/TestCases/Linux/signal_line.cpp test
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 9 04:40:00 PDT 2021
Author: Roman Lebedev
Date: 2021-07-09T14:39:47+03:00
New Revision: 3f7c9cc27422f7302cf5a683eeb3978e6cb84270
URL: https://github.com/llvm/llvm-project/commit/3f7c9cc27422f7302cf5a683eeb3978e6cb84270
DIFF: https://github.com/llvm/llvm-project/commit/3f7c9cc27422f7302cf5a683eeb3978e6cb84270.diff
LOG: [compiler-rt] Conceal UB in sanitizer_common/TestCases/Linux/signal_line.cpp test
Store to null is deleted, so the test no longer did what it was expecting to do.
Conceal that by creating null pointer in a more elaborate way,
thus retaining original test coverage.
Added:
Modified:
compiler-rt/test/sanitizer_common/TestCases/Linux/signal_line.cpp
Removed:
################################################################################
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_line.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_line.cpp
index 208ece3e05af..0da531e557ca 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_line.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_line.cpp
@@ -14,13 +14,11 @@
int main(int argc, char **argv) {
int n = atoi(argv[1]);
- if (n == 1)
- *((volatile int *)0x0) = __LINE__;
- // CHECK1: #{{[0-9]+ .*}}main {{.*}}signal_line.cpp:[[@LINE-1]]:[[TAB:[0-9]+]]
- // CHECK1: SUMMARY: [[SAN]]: SEGV {{.*}}signal_line.cpp:[[@LINE-2]]:[[TAB]] in main
+ *((volatile int *)(n - 1)) = __LINE__;
- if (n == 2)
- *((volatile int *)0x1) = __LINE__;
- // CHECK2: #{{[0-9]+ .*}}main {{.*}}signal_line.cpp:[[@LINE-1]]:[[TAB:[0-9]+]]
- // CHECK2: SUMMARY: [[SAN]]: SEGV {{.*}}signal_line.cpp:[[@LINE-2]]:[[TAB]] in main
+ // CHECK1: #{{[0-9]+ .*}}main {{.*}}signal_line.cpp:[[@LINE-2]]:[[TAB:[0-9]+]]
+ // CHECK1: SUMMARY: [[SAN]]: SEGV {{.*}}signal_line.cpp:[[@LINE-3]]:[[TAB]] in main
+
+ // CHECK2: #{{[0-9]+ .*}}main {{.*}}signal_line.cpp:[[@LINE-5]]:[[TAB:[0-9]+]]
+ // CHECK2: SUMMARY: [[SAN]]: SEGV {{.*}}signal_line.cpp:[[@LINE-6]]:[[TAB]] in main
}
More information about the llvm-commits
mailing list