[asan] Fix nonsensical reports of partial right OOB.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Tue, 5 Feb 2013 14:32:03 +0000 (14:32 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Tue, 5 Feb 2013 14:32:03 +0000 (14:32 +0000)
commit1bc7298c441318b6199152571dd9f221d390cab1
tree5a0b63dddd06235f0e4e6d891d60fae630debe01
parent4b724429b8f0afee0f5f00a62365a3fa706cab34
[asan] Fix nonsensical reports of partial right OOB.

In case of partial right OOB, ASan was reporting
  X is located 0 bytes to the right of [A, B)
where X was actually inside [A, B).

With this change, ASan will report B as the error address in such case.

llvm-svn: 174373
compiler-rt/lib/asan/asan_allocator.cc
compiler-rt/lib/asan/asan_allocator.h
compiler-rt/lib/asan/asan_allocator2.cc
compiler-rt/lib/asan/asan_globals.cc
compiler-rt/lib/asan/asan_interceptors.cc
compiler-rt/lib/asan/asan_report.cc
compiler-rt/lib/asan/asan_report.h
compiler-rt/lib/asan/lit_tests/partial_right.cc [new file with mode: 0644]
compiler-rt/lib/asan/lit_tests/strncpy-overflow.cc