[PATCH] [Msan] Fix the if_indextoname.cc test to pass on FreeBSD

Phabricator reviews at reviews.llvm.org
Mon May 11 07:49:59 PDT 2015


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9456

Files:
  compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
  compiler-rt/trunk/test/msan/if_indextoname.cc

Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -226,7 +226,8 @@
 #define SANITIZER_INTERCEPT_GETRESID SI_LINUX
 #define SANITIZER_INTERCEPT_GETIFADDRS \
   SI_FREEBSD || SI_LINUX_NOT_ANDROID || SI_MAC
-#define SANITIZER_INTERCEPT_IF_INDEXTONAME SI_LINUX_NOT_ANDROID || SI_MAC
+#define SANITIZER_INTERCEPT_IF_INDEXTONAME \
+  SI_FREEBSD || SI_LINUX_NOT_ANDROID || SI_MAC
 #define SANITIZER_INTERCEPT_CAPGET SI_LINUX_NOT_ANDROID
 #define SANITIZER_INTERCEPT_AEABI_MEM SI_LINUX && defined(__arm__)
 #define SANITIZER_INTERCEPT___BZERO SI_MAC
Index: compiler-rt/trunk/test/msan/if_indextoname.cc
===================================================================
--- compiler-rt/trunk/test/msan/if_indextoname.cc
+++ compiler-rt/trunk/test/msan/if_indextoname.cc
@@ -18,6 +18,6 @@
     printf("No network interfaces found.\n");
     return 0;
   }
-  assert(strlen(ifname) + 1 == __msan_test_shadow(ifname, sizeof(ifname)));
+  assert(strlen(ifname) + 1 <= __msan_test_shadow(ifname, sizeof(ifname)));
   return 0;
 }

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9456.25471.patch
Type: text/x-patch
Size: 1273 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150511/401c5b35/attachment.bin>


More information about the llvm-commits mailing list