[HWASAN] Modify HwasanAllocate to set the size to 1 if requested size is 0
authorKirill Stoimenov <kstoimenov@google.com>
Tue, 7 Feb 2023 00:34:26 +0000 (00:34 +0000)
committerKirill Stoimenov <kstoimenov@google.com>
Tue, 7 Feb 2023 00:35:56 +0000 (00:35 +0000)
commit01176191d2fc3fd6807a362fec9702990a46a97c
treeb53e779320bb3808d2355a55103189cac0f26af1
parentc7880f52e43bd7f08866a60d641b2c64738664b1
[HWASAN] Modify HwasanAllocate to set the size to 1 if requested size is 0

This should keep it consistent with LSAN and ASAN,

Reviewed By: vitalybuka, MaskRay

Differential Revision: https://reviews.llvm.org/D143438
compiler-rt/test/hwasan/TestCases/malloc-test.c
compiler-rt/test/hwasan/TestCases/new-test.cpp