Skip to content

Commit

Permalink
Revert "[hwasan] do not check if freed pointer belonged to allocator."
Browse files Browse the repository at this point in the history
This reverts commit 119146f.
  • Loading branch information
fmayer committed Aug 20, 2021
1 parent 62f4c90 commit de916a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler-rt/lib/hwasan/hwasan_allocator.cpp
Expand Up @@ -208,7 +208,8 @@ static bool PointerAndMemoryTagsMatch(void *tagged_ptr) {
static bool CheckInvalidFree(StackTrace *stack, void *untagged_ptr,
void *tagged_ptr) {
// This function can return true if halt_on_error is false.
if (!PointerAndMemoryTagsMatch(tagged_ptr)) {
if (!allocator.PointerIsMine(untagged_ptr) ||
!PointerAndMemoryTagsMatch(tagged_ptr)) {
ReportInvalidFree(stack, reinterpret_cast<uptr>(tagged_ptr));
return true;
}
Expand Down

0 comments on commit de916a7

Please sign in to comment.