[PATCH] D17129: [Compiler-rt][MSan] fix param_tls_limit test

Mohit Bhakkad via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 01:49:23 PST 2016


mohit.bhakkad updated this revision to Diff 49166.
mohit.bhakkad added a comment.

defining PARTIAL_OVERFLOW to check shadow of arguments greater than tls limit on platforms where big arguments are sliced in smaller ones.


Repository:
  rL LLVM

http://reviews.llvm.org/D17129

Files:
  test/msan/param_tls_limit.cc

Index: test/msan/param_tls_limit.cc
===================================================================
--- test/msan/param_tls_limit.cc
+++ test/msan/param_tls_limit.cc
@@ -20,6 +20,16 @@
 // In case of no overflow, it is still poisoned.
 #define NO_OVERFLOW(x) assert(__msan_test_shadow(&x, sizeof(x)) == 0)
 
+#if defined(__x86_64__)
+// In x86_64, if argument is partially outside tls, it is considered completly unpoisoned
+#define PARTIAL_OVERFLOW(x) OVERFLOW(x)
+#else
+// In other archs, bigger arguments are splitted in multiple IR arguments, so they are
+// considered poisoned till tls limit 
+#define PARTIAL_OVERFLOW(x) assert(__msan_test_shadow(&x + 800/*kMsanParamTlsSize*/, 1) == -1)
+#endif
+  
+
 template<int N>
 struct S {
   char x[N];
@@ -34,17 +44,17 @@
 }
 
 void f801(S<801> s) {
-  OVERFLOW(s);
+  PARTIAL_OVERFLOW(s);
 }
 
 void f1000(S<1000> s) {
-  OVERFLOW(s);
+  PARTIAL_OVERFLOW(s);
 }
 
 void f_many(int a, double b, S<800> s, int c, double d) {
   NO_OVERFLOW(a);
   NO_OVERFLOW(b);
-  OVERFLOW(s);
+  PARTIAL_OVERFLOW(s);
   OVERFLOW(c);
   OVERFLOW(d);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17129.49166.patch
Type: text/x-patch
Size: 1092 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160226/28e6b9b0/attachment.bin>


More information about the llvm-commits mailing list