Skip to content

Commit a414547

Browse files
vitalybukamemfrob
authored andcommitted
[scudo] GWP_ASAN runs on untagged pointers
It's already covered by multiple tests, but to trigger this path we need MTE+GWP which disabled. Reviewed By: hctim, pcc Differential Revision: https://reviews.llvm.org/D105232
1 parent 479599a commit a414547

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler-rt/lib/scudo/standalone/combined.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,6 @@ class Allocator {
569569
reportAllocationSizeTooBig(NewSize, 0, MaxAllowedMallocSize);
570570
}
571571

572-
void *OldTaggedPtr = OldPtr;
573-
OldPtr = getHeaderTaggedPointer(OldPtr);
574-
575572
// The following cases are handled by the C wrappers.
576573
DCHECK_NE(OldPtr, nullptr);
577574
DCHECK_NE(NewSize, 0);
@@ -591,6 +588,9 @@ class Allocator {
591588
}
592589
#endif // GWP_ASAN_HOOKS
593590

591+
void *OldTaggedPtr = OldPtr;
592+
OldPtr = getHeaderTaggedPointer(OldPtr);
593+
594594
if (UNLIKELY(!isAligned(reinterpret_cast<uptr>(OldPtr), MinAlignment)))
595595
reportMisalignedPointer(AllocatorAction::Reallocating, OldPtr);
596596

0 commit comments

Comments
 (0)