projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c2d8974
)
[hwasan] Fix LsanMetadata::LsanMetadata
author
Vitaly Buka
<vitalybuka@google.com>
Wed, 18 Jan 2023 03:21:17 +0000
(19:21 -0800)
committer
Vitaly Buka
<vitalybuka@google.com>
Wed, 18 Jan 2023 03:23:42 +0000
(19:23 -0800)
compiler-rt/lib/hwasan/hwasan_allocator.cpp
patch
|
blob
|
history
diff --git
a/compiler-rt/lib/hwasan/hwasan_allocator.cpp
b/compiler-rt/lib/hwasan/hwasan_allocator.cpp
index
e650738
..
9f7d1f3
100644
(file)
--- a/
compiler-rt/lib/hwasan/hwasan_allocator.cpp
+++ b/
compiler-rt/lib/hwasan/hwasan_allocator.cpp
@@
-106,7
+106,6
@@
inline u32 Metadata::GetAllocStackId() const {
return atomic_load(&alloc_context_id, memory_order_relaxed);
}
-static const uptr kChunkHeaderSize = sizeof(HwasanChunkView);
void GetAllocatorStats(AllocatorStatCounters s) {
allocator.GetStats(s);
@@
-534,9
+533,8
@@
uptr GetUserBegin(uptr chunk) {
}
LsanMetadata::LsanMetadata(uptr chunk) {
- metadata_ = chunk ? reinterpret_cast<__hwasan::Metadata *>(
- chunk - __hwasan::kChunkHeaderSize)
- : nullptr;
+ metadata_ =
+ chunk ? (reinterpret_cast<__hwasan::Metadata *>(chunk) - 1) : nullptr;
}
bool LsanMetadata::allocated() const {