Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Include/internal/pycore_pythonrun.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ extern PyObject * _Py_CompileStringObjectWithModule(
* stack consumption of PyEval_EvalDefault */
#if (defined(Py_DEBUG) \
|| defined(_Py_ADDRESS_SANITIZER) \
|| defined(_Py_HWADDRESS_SANITIZER) \
|| defined(_Py_THREAD_SANITIZER))
# define _PyOS_LOG2_STACK_MARGIN 12
#else
Expand Down
10 changes: 10 additions & 0 deletions Include/pyport.h
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,12 @@ extern "C" {
# define _Py_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
# endif
# endif
# if __has_feature(hwaddress_sanitizer)
# if !defined(_Py_HWADDRESS_SANITIZER)
# define _Py_HWADDRESS_SANITIZER
# define _Py_NO_SANITIZE_HWADDRESS __attribute__((no_sanitize("hwaddress")))
# endif
# endif
# if __has_feature(thread_sanitizer)
# if !defined(_Py_THREAD_SANITIZER)
# define _Py_THREAD_SANITIZER
Expand All @@ -572,6 +578,10 @@ extern "C" {
# define _Py_ADDRESS_SANITIZER
# define _Py_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
# endif
# if defined(__SANITIZE_HWADDRESS__)
# define _Py_HWADDRESS_SANITIZER
# define _Py_NO_SANITIZE_HWADDRESS __attribute__((no_sanitize("hwaddress")))
# endif
# if defined(__SANITIZE_THREAD__)
# define _Py_THREAD_SANITIZER
# define _Py_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread))
Expand Down
3 changes: 2 additions & 1 deletion Modules/_testinternalcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1863,7 +1863,8 @@ static PyObject *
check_pyobject_freed_is_freed(PyObject *self, PyObject *Py_UNUSED(args))
{
/* ASan or TSan would report an use-after-free error */
#if defined(_Py_ADDRESS_SANITIZER) || defined(_Py_THREAD_SANITIZER)
#if defined(_Py_ADDRESS_SANITIZER) || defined(_Py_THREAD_SANITIZER) || \
defined(_Py_HWADDRESS_SANITIZER)
Py_RETURN_NONE;
#else
PyObject *op = PyObject_CallNoArgs((PyObject *)&PyBaseObject_Type);
Expand Down
Loading