[compiler-rt] r355129 - Revert "Revert "[sanitizers] Restore internal_readlink for x32""
H.J. Lu via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 28 11:34:02 PST 2019
Author: hjl
Date: Thu Feb 28 11:34:01 2019
New Revision: 355129
URL: http://llvm.org/viewvc/llvm-project?rev=355129&view=rev
Log:
Revert "Revert "[sanitizers] Restore internal_readlink for x32""
This reverts revision 354601 and disables ReadBinaryNameCached check on
Windows since Windows has no working ReadBinaryName.
Differential Revision: https://reviews.llvm.org/D58788
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_common_test.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=355129&r1=355128&r2=355129&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Thu Feb 28 11:34:01 2019
@@ -400,7 +400,7 @@ uptr internal_readlink(const char *path,
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
}
Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_common_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_common_test.cc?rev=355129&r1=355128&r2=355129&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_common_test.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_common_test.cc Thu Feb 28 11:34:01 2019
@@ -438,4 +438,12 @@ TEST(SanitizerCommon, ReservedAddressRan
EXPECT_DEATH(address_range.Unmap(base_addr + (PageSize * 2), PageSize), ".*");
}
+// Windows has no working ReadBinaryName.
+#if !SANITIZER_WINDOWS
+TEST(SanitizerCommon, ReadBinaryNameCached) {
+ char buf[256];
+ EXPECT_NE((uptr)0, ReadBinaryNameCached(buf, sizeof(buf)));
+}
+#endif
+
} // namespace __sanitizer
More information about the llvm-commits
mailing list