]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Disable getc_unlocked() with MemorySanitizer. (GH-10499)
authorGregory P. Smith <greg@krypto.org>
Tue, 13 Nov 2018 03:47:13 +0000 (19:47 -0800)
committerGitHub <noreply@github.com>
Tue, 13 Nov 2018 03:47:13 +0000 (19:47 -0800)
clang's MemorySanitizer understand getc() but does not understand
getc_unlocked().  Workaround: Don't use it on msan builds.

Objects/fileobject.c

index db788a9eccbbedb09f49446b761e680699a85445..10e8391fb479057d2e34a0bbcefc78b2000e30ac 100644 (file)
@@ -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)