[PATCH] D89552: ASAN: Support detect_invalid_pointer_pairs=1 with detect_stack_use_after_return=1
Martin Liška via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 19 01:01:37 PDT 2020
marxin updated this revision to Diff 298949.
marxin marked an inline comment as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89552/new/
https://reviews.llvm.org/D89552
Files:
compiler-rt/lib/asan/asan_thread.cpp
compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cpp
Index: compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cpp
===================================================================
--- compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cpp
+++ compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cpp
@@ -1,6 +1,7 @@
// RUN: %clangxx_asan -O0 %s -o %t -mllvm -asan-detect-invalid-pointer-pair
// RUN: %env_asan_opts=detect_invalid_pointer_pairs=2 %run %t
+// RUN: %env_asan_opts=detect_invalid_pointer_pairs=2,detect_stack_use_after_return=1 %run %t
#include <assert.h>
#include <stdlib.h>
Index: compiler-rt/lib/asan/asan_thread.cpp
===================================================================
--- compiler-rt/lib/asan/asan_thread.cpp
+++ compiler-rt/lib/asan/asan_thread.cpp
@@ -366,7 +366,9 @@
bottom = stack_bottom();
} else if (has_fake_stack()) {
bottom = fake_stack()->AddrIsInFakeStack(addr);
- CHECK(bottom);
+ if (bottom == 0) {
+ return 0;
+ }
} else {
return 0;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89552.298949.patch
Type: text/x-patch
Size: 1036 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201019/c01726a2/attachment.bin>
More information about the llvm-commits
mailing list