[Python-checkins] Disable getc_unlocked() with MemorySanitizer. (GH-10499)

Miss Islington (bot) webhook-mailer at python.org
Mon Nov 12 23:18:19 EST 2018


https://github.com/python/cpython/commit/41fdbaa3ea622c3f64d4ab8f70fc79d35729071a
commit: 41fdbaa3ea622c3f64d4ab8f70fc79d35729071a
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-11-12T20:18:15-08:00
summary:

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 <greg at krypto.org>

files:
M Objects/fileobject.c

diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index f4424184d2df..f4944da4fcce 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)



More information about the Python-checkins mailing list