[compiler-rt] r334670 - [ASAN] Fix fputs interception for 32-bit macOS
Peter Wu via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 13 16:19:21 PDT 2018
Author: lekensteyn
Date: Wed Jun 13 16:19:21 2018
New Revision: 334670
URL: http://llvm.org/viewvc/llvm-project?rev=334670&view=rev
Log:
[ASAN] Fix fputs interception for 32-bit macOS
On 32-bit macOS, "_fputs$UNIX2003" is called instead of "fputs" and the
"fgets_fputs" test fails. Apparently previous versions still passed the
test due to the internal implementation calling "strlen", but that does
not seem to be the case with macOS 10.13.3. Fixes r334450.
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc?rev=334670&r1=334669&r2=334670&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Wed Jun 13 16:19:21 2018
@@ -1208,7 +1208,7 @@ INTERCEPTOR(char *, fgets, char *s, SIZE
#endif
#if SANITIZER_INTERCEPT_FPUTS
-INTERCEPTOR(int, fputs, char *s, void *file) {
+INTERCEPTOR_WITH_SUFFIX(int, fputs, char *s, void *file) {
// libc file streams can call user-supplied functions, see fopencookie.
void *ctx;
COMMON_INTERCEPTOR_ENTER(ctx, fputs, s, file);
More information about the llvm-commits
mailing list