[ASan/Win] UnmapOrDie should not fail on zero address / size
llvm-svn: 233707
This commit is contained in:
parent
b919c7d9eb
commit
89608af26d
|
@ -93,6 +93,9 @@ void *MmapOrDie(uptr size, const char *mem_type) {
|
|||
}
|
||||
|
||||
void UnmapOrDie(void *addr, uptr size) {
|
||||
if (!size || !addr)
|
||||
return;
|
||||
|
||||
if (VirtualFree(addr, size, MEM_DECOMMIT) == 0) {
|
||||
Report("ERROR: %s failed to "
|
||||
"deallocate 0x%zx (%zd) bytes at address %p (error code: %d)\n",
|
||||
|
|
Loading…
Reference in New Issue