Skip to content

Commit f455687

Browse files
committed
PR feedback
1 parent d7337e0 commit f455687

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

Include/pyport.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ extern "C" {
553553
# if !defined(_Py_MEMORY_SANITIZER)
554554
# define _Py_MEMORY_SANITIZER
555555
# define _Py_NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory))
556+
# define _Py_MSAN_UNPOISON(p, sz) (__msan_unpoison(p, sz))
556557
# endif
557558
# endif
558559
# if __has_feature(address_sanitizer)
@@ -591,6 +592,9 @@ extern "C" {
591592
#ifndef _Py_NO_SANITIZE_MEMORY
592593
# define _Py_NO_SANITIZE_MEMORY
593594
#endif
595+
#ifndef _Py_MSAN_UNPOISON
596+
# define _Py_MSAN_UNPOISON
597+
#endif
594598

595599
/* AIX has __bool__ redefined in it's system header file. */
596600
#if defined(_AIX) && defined(__bool__)

Modules/posixmodule.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17195,9 +17195,7 @@ os_getrandom_impl(PyObject *module, Py_ssize_t size, int flags)
1719517195
goto error;
1719617196
}
1719717197

17198-
#ifdef _Py_MEMORY_SANITIZER
17199-
__msan_unpoison(data, size);
17200-
#endif
17198+
_Py_MSAN_UNPOISON(data, size);
1720117199

1720217200
return PyBytesWriter_FinishWithSize(writer, n);
1720317201

0 commit comments

Comments
 (0)