From 43a31f4fd52d9034e2e15981c21676885d16e50b Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith [Google]" Date: Mon, 12 Nov 2018 19:03:04 -0800 Subject: [PATCH] Disable getc_unlocked() with MemorySanitizer. clang's MemorySanitizer understand getc() but does not understand getc_unlocked(). Workaround: Don't use it on msan builds. --- Objects/fileobject.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/fileobject.c b/Objects/fileobject.c index db788a9eccbbed..10e8391fb47905 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -3,7 +3,8 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#ifdef HAVE_GETC_UNLOCKED +#if defined(HAVE_GETC_UNLOCKED) && !defined(MEMORY_SANITIZER) +/* clang MemorySanitizer doesn't yet understand getc_unlocked. */ #define GETC(f) getc_unlocked(f) #define FLOCKFILE(f) flockfile(f) #define FUNLOCKFILE(f) funlockfile(f)