From 84019ff7e5b787f3d1004dd35302ed9b7345cf80 Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Wed, 21 May 2014 07:49:03 +0000 Subject: [PATCH] Cast pointers to uptr when calling internal_syscall For Linux/x86-64, pointers passed to internal_syscall should be casted to uptr first. Otherwise, they won't be properly extended to 64-bit for x32. Patch by H.J. Lu llvm-svn: 209278 --- compiler-rt/lib/sanitizer_common/sanitizer_linux.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc index ff73fb5..a8d5836 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc @@ -555,8 +555,9 @@ uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, #else __sanitizer_kernel_sigset_t *k_set = (__sanitizer_kernel_sigset_t *)set; __sanitizer_kernel_sigset_t *k_oldset = (__sanitizer_kernel_sigset_t *)oldset; - return internal_syscall(SYSCALL(rt_sigprocmask), (uptr)how, &k_set->sig[0], - &k_oldset->sig[0], sizeof(__sanitizer_kernel_sigset_t)); + return internal_syscall(SYSCALL(rt_sigprocmask), (uptr)how, + (uptr)&k_set->sig[0], (uptr)&k_oldset->sig[0], + sizeof(__sanitizer_kernel_sigset_t)); #endif } -- 2.7.4