summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapi/exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_testcapi/exceptions.c')
-rw-r--r--Modules/_testcapi/exceptions.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/_testcapi/exceptions.c b/Modules/_testcapi/exceptions.c
index b1388d7..b54ce0c 100644
--- a/Modules/_testcapi/exceptions.c
+++ b/Modules/_testcapi/exceptions.c
@@ -120,12 +120,15 @@ _testcapi_exc_set_object_fetch_impl(PyObject *module, PyObject *exc,
PyObject *obj)
/*[clinic end generated code: output=7a5ff5f6d3cf687f input=77ec686f1f95fa38]*/
{
- PyObject *type;
- PyObject *value;
- PyObject *tb;
+ PyObject *type = UNINITIALIZED_PTR;
+ PyObject *value = UNINITIALIZED_PTR;
+ PyObject *tb = UNINITIALIZED_PTR;
PyErr_SetObject(exc, obj);
PyErr_Fetch(&type, &value, &tb);
+ assert(type != UNINITIALIZED_PTR);
+ assert(value != UNINITIALIZED_PTR);
+ assert(tb != UNINITIALIZED_PTR);
Py_XDECREF(type);
Py_XDECREF(tb);
return value;
@@ -244,7 +247,7 @@ _testcapi_set_exc_info_impl(PyObject *module, PyObject *new_type,
PyObject *new_value, PyObject *new_tb)
/*[clinic end generated code: output=b55fa35dec31300e input=ea9f19e0f55fe5b3]*/
{
- PyObject *type, *value, *tb;
+ PyObject *type = UNINITIALIZED_PTR, *value = UNINITIALIZED_PTR, *tb = UNINITIALIZED_PTR;
PyErr_GetExcInfo(&type, &value, &tb);
Py_INCREF(new_type);