Skip to content

Commit 41fdbaa

Browse files
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 e6c77d8) Co-authored-by: Gregory P. Smith <[email protected]>
1 parent 3b5b1c0 commit 41fdbaa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Objects/fileobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#define PY_SSIZE_T_CLEAN
44
#include "Python.h"
55

6-
#ifdef HAVE_GETC_UNLOCKED
6+
#if defined(HAVE_GETC_UNLOCKED) && !defined(MEMORY_SANITIZER)
7+
/* clang MemorySanitizer doesn't yet understand getc_unlocked. */
78
#define GETC(f) getc_unlocked(f)
89
#define FLOCKFILE(f) flockfile(f)
910
#define FUNLOCKFILE(f) funlockfile(f)

0 commit comments

Comments
 (0)