tsan: fix munmap interceptor
authorDmitry Vyukov <dvyukov@google.com>
Mon, 6 Apr 2015 07:57:32 +0000 (07:57 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Mon, 6 Apr 2015 07:57:32 +0000 (07:57 +0000)
commit19300f856bd3a24a6a66251f1902d114887fafcc
tree18b7621c6247cddd90b577abd5ff697a6d7ade80
parent2000211ff3b99eea9e7d634fc2eea8f371619ae9
tsan: fix munmap interceptor

MetaMap::ResetRange/FreeRange rounds the range up to at least kMetaShadowSize.
This is requried for e.g. free(malloc(0)). However, munmap returns EINVAL
and do not unmap any memory when length arguments is equal to 0.
So don't free meta shadow in this case as well.

llvm-svn: 234145
compiler-rt/lib/tsan/rtl/tsan_interceptors.cc