[ASan/Win] UnmapOrDie should not fail on zero address / size

llvm-svn: 233707
This commit is contained in:
Timur Iskhodzhanov 2015-03-31 16:39:20 +00:00
parent b919c7d9eb
commit 89608af26d
1 changed files with 3 additions and 0 deletions

View File

@ -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",