diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2019-06-27 23:24:36 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2019-06-27 23:24:36 +0000 |
commit | 417da9fd1123408846738c217e7d7a84ab619c11 (patch) | |
tree | 7da94fd73da0bc7740520bd9e8f18355e82df05b | |
parent | de3285c6c57be31b1a67cc1e5fdbd485c6b373f6 (diff) | |
download | compiler-rt-417da9fd1123408846738c217e7d7a84ab619c11.tar.gz |
hwasan: Fix an off-by-one error in PrintTagsAroundAddr.
Previously we were printing 16 rows of tags, not 17.
Differential Revision: https://reviews.llvm.org/D63906
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@364609 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/hwasan/hwasan_report.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hwasan/hwasan_report.cpp b/lib/hwasan/hwasan_report.cpp index a57a97174..35f2a0358 100644 --- a/lib/hwasan/hwasan_report.cpp +++ b/lib/hwasan/hwasan_report.cpp @@ -335,7 +335,7 @@ static void PrintTagsAroundAddr(tag_t *tag_ptr) { tag_t *center_row_beg = reinterpret_cast<tag_t *>( RoundDownTo(reinterpret_cast<uptr>(tag_ptr), row_len)); tag_t *beg_row = center_row_beg - row_len * (num_rows / 2); - tag_t *end_row = center_row_beg + row_len * (num_rows / 2); + tag_t *end_row = center_row_beg + row_len * ((num_rows + 1) / 2); InternalScopedString s(GetPageSizeCached() * 8); for (tag_t *row = beg_row; row < end_row; row += row_len) { s.append("%s", row == center_row_beg ? "=>" : " "); |