[compiler-rt] r193863 - [msan] Check that address is an app region before printing shadow.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Fri Nov 1 08:53:26 PDT 2013


Author: eugenis
Date: Fri Nov  1 10:53:25 2013
New Revision: 193863

URL: http://llvm.org/viewvc/llvm-project?rev=193863&view=rev
Log:
[msan] Check that address is an app region before printing shadow.

Modified:
    compiler-rt/trunk/lib/msan/msan.cc

Modified: compiler-rt/trunk/lib/msan/msan.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.cc?rev=193863&r1=193862&r2=193863&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.cc (original)
+++ compiler-rt/trunk/lib/msan/msan.cc Fri Nov  1 10:53:25 2013
@@ -372,6 +372,10 @@ void __msan_set_expect_umr(int expect_um
 }
 
 void __msan_print_shadow(const void *x, uptr size) {
+  if (!MEM_IS_APP(x)) {
+    Printf("Not a valid application address: %p\n", x);
+    return;
+  }
   unsigned char *s = (unsigned char*)MEM_TO_SHADOW(x);
   u32 *o = (u32*)MEM_TO_ORIGIN(x);
   for (uptr i = 0; i < size; i++) {





More information about the llvm-commits mailing list