summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/msan/msan_linux.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/msan/msan_linux.cc')
-rw-r--r--compiler-rt/lib/msan/msan_linux.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/lib/msan/msan_linux.cc b/compiler-rt/lib/msan/msan_linux.cc
index aea29453c32..b51f6363310 100644
--- a/compiler-rt/lib/msan/msan_linux.cc
+++ b/compiler-rt/lib/msan/msan_linux.cc
@@ -51,6 +51,12 @@ bool InitShadow(bool prot1, bool prot2, bool map_shadow, bool init_origins) {
Printf("Bad1 : %p %p\n", kBad1Beg, kBad1End);
}
+ if (!MemoryRangeIsAvailable(kShadowBeg,
+ init_origins ? kOriginsEnd : kShadowEnd)) {
+ Printf("FATAL: Shadow memory range is not available.\n");
+ return false;
+ }
+
if (prot1 && !Mprotect(kBad1Beg, kBad1End - kBad1Beg))
return false;
if (prot2 && !Mprotect(kBad2Beg, kBad2End - kBad2Beg))
OpenPOWER on IntegriCloud