From 62308221bcda97066a5f4834fa21f6c358b7a0fa Mon Sep 17 00:00:00 2001 From: Viktor Kutuzov Date: Fri, 1 Aug 2014 19:33:14 +0000 Subject: [PATCH] Fix the waitid sanitizer interceptor to work on FreeBSD in 32-bit mode Differential Revision: http://reviews.llvm.org/D4670 llvm-svn: 214543 --- compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc index 07911ff..c23f3d0 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -1542,8 +1542,14 @@ INTERCEPTOR_WITH_SUFFIX(int, wait, int *status) { 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 -- 2.7.4