[compiler-rt] r212268 - [msan] Stop propagating shadow in blacklisted functions.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Thu Jul 3 04:56:30 PDT 2014


Author: eugenis
Date: Thu Jul  3 06:56:30 2014
New Revision: 212268

URL: http://llvm.org/viewvc/llvm-project?rev=212268&view=rev
Log:
[msan] Stop propagating shadow in blacklisted functions.

With this change all values passed through blacklisted functions
become fully initialized. Previous behavior was to initialize all
loads in blacklisted functions, but apply normal shadow propagation
logic for all other operation.

This makes blacklist applicable in a wider range of situations.

It also makes code for blacklisted functions a lot shorter, which
works as yet another workaround for PR17409.

Modified:
    compiler-rt/trunk/test/msan/no_sanitize_memory_prop.cc

Modified: compiler-rt/trunk/test/msan/no_sanitize_memory_prop.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/no_sanitize_memory_prop.cc?rev=212268&r1=212267&r2=212268&view=diff
==============================================================================
--- compiler-rt/trunk/test/msan/no_sanitize_memory_prop.cc (original)
+++ compiler-rt/trunk/test/msan/no_sanitize_memory_prop.cc Thu Jul  3 06:56:30 2014
@@ -1,16 +1,9 @@
 // RUN: %clangxx_msan -m64 -O0 %s -o %t && %run %t >%t.out 2>&1
-// RUN: %clangxx_msan -m64 -O1 %s -o %t && not %run %t >%t.out 2>&1
-// RUN: FileCheck %s < %t.out
-// RUN: %clangxx_msan -m64 -O2 %s -o %t && not %run %t >%t.out 2>&1
-// RUN: FileCheck %s < %t.out
-// RUN: %clangxx_msan -m64 -O3 %s -o %t && not %run %t >%t.out 2>&1
-// RUN: FileCheck %s < %t.out
+// RUN: %clangxx_msan -m64 -O1 %s -o %t && %run %t >%t.out 2>&1
+// RUN: %clangxx_msan -m64 -O2 %s -o %t && %run %t >%t.out 2>&1
+// RUN: %clangxx_msan -m64 -O3 %s -o %t && %run %t >%t.out 2>&1
 
-// Test that (no_sanitize_memory) functions propagate shadow.
-
-// Note that at -O0 there is no report, because 'x' in 'f' is spilled to the
-// stack, and then loaded back as a fully initialiazed value (due to
-// no_sanitize_memory attribute).
+// Test that (no_sanitize_memory) functions DO NOT propagate shadow.
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -25,8 +18,6 @@ int main(void) {
   int x;
   int * volatile p = &x;
   int y = f(*p);
-  // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
-  // CHECK: {{#0 0x.* in main .*no_sanitize_memory_prop.cc:}}[[@LINE+1]]
   if (y)
     exit(0);
   return 0;





More information about the llvm-commits mailing list