[PATCH] D43909: [3/3] OpenBSD UBsan support / common
Kamil Rytarowski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 1 04:39:36 PST 2018
krytarowski added inline comments.
================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:428
+#elif SANITIZER_OPENBSD
+ return internal_syscall_ptr(SYSCALL(renameat), AT_FDCWD, (uptr)oldpath,
+ AT_FDCWD, (uptr)newpath);
----------------
Linux should switch to `internal_syscall_ptr` as well in all these mentioned branches.
================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:476
tid_t GetTid() {
-#if SANITIZER_FREEBSD || SANITIZER_OPENBSD
- return (uptr)pthread_self();
+#if SANITIZER_FREEBSD || SANITIZER_SOLARIS
+ return (uptr)thr_self();
----------------
This is still wrong. thr_self returns 0 on success, -1 on error.
Cast to (uptr) in both cases is wrong.
Also tid_t shall be corrected and marked u64 for everybody.
https://reviews.llvm.org/D43909
More information about the llvm-commits
mailing list