tsan: fix Windows Go crash

llvm-svn: 183898
This commit is contained in:
Dmitry Vyukov 2013-06-13 10:15:44 +00:00
parent aa76805796
commit 26daccaddb
1 changed files with 3 additions and 1 deletions

View File

@ -556,7 +556,9 @@ static void MemoryRangeSet(ThreadState *thr, uptr pc, uptr addr, uptr size,
// Don't want to touch lots of shadow memory.
// If a program maps 10MB stack, there is no need reset the whole range.
size = (size + (kShadowCell - 1)) & ~(kShadowCell - 1);
if (size < 64*1024) {
// UnmapOrDie/MmapFixedNoReserve does not work on Windows,
// so we do it only for C/C++.
if (kGoMode || size < 64*1024) {
u64 *p = (u64*)MemToShadow(addr);
CHECK(IsShadowMem((uptr)p));
CHECK(IsShadowMem((uptr)(p + size * kShadowCnt / kShadowCell - 1)));