[PATCH] D58413: [sanitizers] Restore internal_readlink for x32

H.J Lu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 19 15:38:28 PST 2019


hjl.tools created this revision.
hjl.tools added reviewers: kcc, eugenis, krytarowski.
Herald added subscribers: Sanitizers, kubamracek.
Herald added projects: LLVM, Sanitizers.

r316591 has

  @@ -389,13 +383,11 @@ uptr internal_dup2(int oldfd, int newfd) {
   }
  
   uptr internal_readlink(const char *path, char *buf, uptr bufsize) {
  -#if SANITIZER_NETBSD
  -  return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize);
  -#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
  +#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
     return internal_syscall(SYSCALL(readlinkat), AT_FDCWD,
                             (uptr)path, (uptr)buf, bufsize);
   #else
  -  return internal_syscall(SYSCALL(readlink), (uptr)path, (uptr)buf, bufsize);
  +  return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize);
   #endif
   }

which dropped the (uptr) cast and broke x32.  This patch puts back the
(uptr) cast to restore x32.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D58413

Files:
  lib/sanitizer_common/sanitizer_linux.cc


Index: lib/sanitizer_common/sanitizer_linux.cc
===================================================================
--- lib/sanitizer_common/sanitizer_linux.cc
+++ lib/sanitizer_common/sanitizer_linux.cc
@@ -400,7 +400,7 @@
   return internal_syscall(SYSCALL(readlinkat), AT_FDCWD, (uptr)path, (uptr)buf,
                           bufsize);
 #else
-  return internal_syscall(SYSCALL(readlink), path, buf, bufsize);
+  return internal_syscall(SYSCALL(readlink), (uptr)path, (uptr)buf, bufsize);
 #endif
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58413.187462.patch
Type: text/x-patch
Size: 507 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190219/3398b48f/attachment.bin>


More information about the llvm-commits mailing list