[compiler-rt] r202846 - [msan] Make up for missing interceptor in getxattr() test.

Sergey Matveev earthdok at google.com
Tue Mar 4 05:13:34 PST 2014


Author: smatveev
Date: Tue Mar  4 07:13:34 2014
New Revision: 202846

URL: http://llvm.org/viewvc/llvm-project?rev=202846&view=rev
Log:
[msan] Make up for missing interceptor in getxattr() test.

Modified:
    compiler-rt/trunk/test/msan/Linux/xattr.cc

Modified: compiler-rt/trunk/test/msan/Linux/xattr.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/Linux/xattr.cc?rev=202846&r1=202845&r2=202846&view=diff
==============================================================================
--- compiler-rt/trunk/test/msan/Linux/xattr.cc (original)
+++ compiler-rt/trunk/test/msan/Linux/xattr.cc Tue Mar  4 07:13:34 2014
@@ -107,10 +107,12 @@ void test_get(ssize_t fun(const char *,
   // Try every attribute, until we see one we can access. Attribute names are
   // null-separated strings in attr_list.
   size_t attr_list_len = argz_count(attr_list, attr_list_size);
-  char **attrs = (char **)malloc((attr_list_len + 1) * sizeof(char *));
+  size_t argv_size = (attr_list_len + 1) * sizeof(char *);
+  char **attrs = (char **)malloc(argv_size);
   argz_extract(attr_list, attr_list_size, attrs);
-  size_t i;
-  for (i = 0; (i < attr_list_len) && attrs[i]; i++) {
+  // TODO(smatveev): we need proper argz_* interceptors
+  __msan_unpoison(attrs, argv_size);
+  for (size_t i = 0; (i < attr_list_len) && attrs[i]; i++) {
     if (test_get_single_attr(fun, attrs[i]))
       return;
   }





More information about the llvm-commits mailing list