]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Disable getc_unlocked() with MemorySanitizer. (GH-10499)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 13 Nov 2018 04:18:15 +0000 (20:18 -0800)
committerGitHub <noreply@github.com>
Tue, 13 Nov 2018 04:18:15 +0000 (20:18 -0800)
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 <greg@krypto.org>
Objects/fileobject.c

index f4424184d2df1beae58ae7beec0f037cbb3aa59c..f4944da4fccea0d1c6ad4e52a023d2c6b766a3e7 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)