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

llvm-svn: 355129
This commit is contained in:
H.J. Lu 2019-02-28 19:34:01 +00:00
parent b79f1f2e2a
commit fadb22f4e2
2 changed files with 9 additions and 1 deletions

View File

@ -400,7 +400,7 @@ uptr internal_readlink(const char *path, char *buf, uptr bufsize) {
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
}

View File

@ -438,4 +438,12 @@ TEST(SanitizerCommon, ReservedAddressRangeUnmap) {
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