From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 13 Nov 2018 03:59:29 +0000 (-0800) Subject: Disable getc_unlocked() with MemorySanitizer. (GH-10499) X-Git-Tag: v3.7.2rc1~149 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f0b21e18d8398f010707c3c199f97d8466214dd6;p=thirdparty%2FPython%2Fcpython.git Disable getc_unlocked() with MemorySanitizer. (GH-10499) clang's MemorySanitizer understand getc() but does not understand getc_unlocked(). Workaround: Don't use it on msan builds. (cherry picked from commit e6c77d8301ec1703abb755a7d3ce5bd8c999c082) Co-authored-by: Gregory P. Smith --- diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 0f71944d526e..a49194ef6c38 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)