[HWASAN] Add unlikely to if in HwasanAllocate.

This commit is contained in:
Kirill Stoimenov 2023-02-07 00:39:17 +00:00
parent 01176191d2
commit e403fd8705

View File

@ -165,7 +165,7 @@ static void *HwasanAllocate(StackTrace *stack, uptr orig_size, uptr alignment,
// Keep this consistent with LSAN and ASAN behavior.
if (UNLIKELY(orig_size == 0))
orig_size = 1;
if (orig_size > kMaxAllowedMallocSize) {
if (UNLIKELY(orig_size > kMaxAllowedMallocSize)) {
if (AllocatorMayReturnNull()) {
Report("WARNING: HWAddressSanitizer failed to allocate 0x%zx bytes\n",
orig_size);