scudo: Adjust test to use correct check for primary allocations.

canAllocate() does not take into account the header size so it does
not return the right answer in borderline cases. There was already
code handling this correctly in isTaggedAllocation() so split it out
into a separate function and call it from the test.

Furthermore the test was incorrect when MTE is enabled because MTE
does not pattern fill primary allocations. Fix it.

Differential Revision: https://reviews.llvm.org/D93437

GitOrigin-RevId: e22d802e587b8954748e2b2193195a946ba105e8
Change-Id: I902eb6ccbdccd876f101255d7a36b03a5761004d
1 file changed