[hwasan] Fix new[] with zero size.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 31 Aug 2018 17:49:49 +0000 (17:49 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 31 Aug 2018 17:49:49 +0000 (17:49 +0000)
commit5abf7d90ace56e96ebf7b4d72de5a56c8c368d80
tree32c48e57680d0d5123c236c0eb315ec045994334
parent6a7efef4af55b995fdfe9a0819adcb823cbb6191
[hwasan] Fix new[] with zero size.

Fixes "allocator is out of memory trying to allocate 0x0 bytes" by
always allocating at least one byte.

llvm-svn: 341229
compiler-rt/lib/hwasan/hwasan_allocator.cc
compiler-rt/test/hwasan/TestCases/malloc-test.c
compiler-rt/test/hwasan/TestCases/new-test.cc [new file with mode: 0644]