summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-06-10 11:37:22 (GMT)
committerGitHub <noreply@github.com>2021-06-10 11:37:22 (GMT)
commit31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b (patch)
tree1ce0b4151af7504e454ec387be4406d8fdc1e537 /Modules
parent54cb63863f19a7c64d9a3a5fd97bdfc0dd7ab374 (diff)
downloadcpython-31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b.zip
cpython-31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b.tar.gz
cpython-31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b.tar.bz2
bpo-44363: Get test_capi passing with address sanitizer (GH-26639)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_testcapimodule.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index ab47949..b983dee 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -4784,6 +4784,10 @@ check_pyobject_forbidden_bytes_is_freed(PyObject *self, PyObject *Py_UNUSED(args
static PyObject*
check_pyobject_freed_is_freed(PyObject *self, PyObject *Py_UNUSED(args))
{
+ /* This test would fail if run with the address sanitizer */
+#ifdef _Py_ADDRESS_SANITIZER
+ Py_RETURN_NONE;
+#else
PyObject *op = _PyObject_CallNoArg((PyObject *)&PyBaseObject_Type);
if (op == NULL) {
return NULL;
@@ -4793,6 +4797,7 @@ check_pyobject_freed_is_freed(PyObject *self, PyObject *Py_UNUSED(args))
Py_SET_REFCNT(op, 1);
/* object memory is freed! */
return test_pyobject_is_freed("check_pyobject_freed_is_freed", op);
+#endif
}