diff options
| author | Kostya Serebryany <kcc@google.com> | 2013-11-19 14:54:14 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2013-11-19 14:54:14 +0000 |
| commit | 3771a3dd73f2ca527e434fea59b1f97dd471f8da (patch) | |
| tree | 814342b4dbeaa854c94c6e9d724cea324e734523 | |
| parent | bfb2016c838ec4b24cbf74b19010c992e84c6a5e (diff) | |
| download | bcm5719-llvm-3771a3dd73f2ca527e434fea59b1f97dd471f8da.tar.gz bcm5719-llvm-3771a3dd73f2ca527e434fea59b1f97dd471f8da.zip | |
[asan] remove a fixed FIXME; extend the comment around __sanitizer_annotate_contiguous_container
llvm-svn: 195131
| -rw-r--r-- | compiler-rt/include/sanitizer/common_interface_defs.h | 11 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_poisoning.cc | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/compiler-rt/include/sanitizer/common_interface_defs.h b/compiler-rt/include/sanitizer/common_interface_defs.h index ce6b994a9dd..801fe48a93b 100644 --- a/compiler-rt/include/sanitizer/common_interface_defs.h +++ b/compiler-rt/include/sanitizer/common_interface_defs.h @@ -70,7 +70,16 @@ extern "C" { // // Use with caution and don't use for anything other than vector-like classes. // - // For AddressSanitizer, 'beg' should be 8-aligned. + // For AddressSanitizer, 'beg' should be 8-aligned and 'end' should + // be either 8-aligned or it should point to the end of a separate heap-, + // stack-, or global- allocated buffer. I.e. the following will not work: + // int64_t x[2]; // 16 bytes, 8-aligned. + // char *beg = (char *)&x[0]; + // char *end = beg + 12; // Not 8 aligned, not the end of the buffer. + // This however will work fine: + // int32_t x[3]; // 12 bytes, but 8-aligned under AddressSanitizer. + // char *beg = (char*)&x[0]; + // char *end = beg + 12; // Not 8-aligned, but is the end of the buffer. void __sanitizer_annotate_contiguous_container(const void *beg, const void *end, const void *old_mid, diff --git a/compiler-rt/lib/asan/asan_poisoning.cc b/compiler-rt/lib/asan/asan_poisoning.cc index 9887fe19349..2d1706e2d21 100644 --- a/compiler-rt/lib/asan/asan_poisoning.cc +++ b/compiler-rt/lib/asan/asan_poisoning.cc @@ -292,7 +292,6 @@ void __sanitizer_annotate_contiguous_container(const void *beg_p, uptr b2 = RoundUpTo(new_mid, granularity); // New state: // [a, b1) is good, [b2, c) is bad, [b1, b2) is partially good. - // FIXME: we may want to have a separate poison magic value. PoisonShadow(a, b1 - a, 0); PoisonShadow(b2, c - b2, kAsanContiguousContainerOOBMagic); if (b1 != b2) { |

