[PATCH] Fix the waitid sanitizer interceptor to work on FreeBSD in 32-bit mode

Viktor Kutuzov vkutuzov at accesssoftek.com
Fri Jul 25 09:04:46 PDT 2014


Hi kcc, samsonov,

http://reviews.llvm.org/D4670

Files:
  lib/sanitizer_common/sanitizer_common_interceptors.inc

Index: lib/sanitizer_common/sanitizer_common_interceptors.inc
===================================================================
--- lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -1542,8 +1542,14 @@
     COMMON_INTERCEPTOR_WRITE_RANGE(ctx, status, sizeof(*status));
   return res;
 }
+// On FreeBSD id_t is always 64-bit wide.
+#if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32)
+INTERCEPTOR_WITH_SUFFIX(int, waitid, int idtype, long long id, void *infop,
+                        int options) {
+#else
 INTERCEPTOR_WITH_SUFFIX(int, waitid, int idtype, int id, void *infop,
                         int options) {
+#endif
   void *ctx;
   COMMON_INTERCEPTOR_ENTER(ctx, waitid, idtype, id, infop, options);
   // FIXME: under ASan the call below may write to freed memory and corrupt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4670.11883.patch
Type: text/x-patch
Size: 856 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140725/a1c36092/attachment.bin>


More information about the llvm-commits mailing list