[compiler-rt] r233707 - [ASan/Win] UnmapOrDie should not fail on zero address / size
Timur Iskhodzhanov
timurrrr at google.com
Tue Mar 31 09:39:20 PDT 2015
Author: timurrrr
Date: Tue Mar 31 11:39:20 2015
New Revision: 233707
URL: http://llvm.org/viewvc/llvm-project?rev=233707&view=rev
Log:
[ASan/Win] UnmapOrDie should not fail on zero address / size
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc?rev=233707&r1=233706&r2=233707&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc Tue Mar 31 11:39:20 2015
@@ -93,6 +93,9 @@ void *MmapOrDie(uptr size, const char *m
}
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",
More information about the llvm-commits
mailing list