Commit 79b68509 authored by Stefan Behnel's avatar Stefan Behnel

prevent potential access to dead pointers on DECREF() in __Pyx_Generator_ExceptionClear()

parent ebef63ea
...@@ -30,13 +30,17 @@ static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args); ...@@ -30,13 +30,17 @@ static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args);
static CYTHON_INLINE static CYTHON_INLINE
void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self)
{ {
Py_XDECREF(self->exc_type); PyObject *exc_type = self->exc_type;
Py_XDECREF(self->exc_value); PyObject *exc_value = self->exc_value;
Py_XDECREF(self->exc_traceback); PyObject *exc_traceback = self->exc_traceback;
self->exc_type = NULL; self->exc_type = NULL;
self->exc_value = NULL; self->exc_value = NULL;
self->exc_traceback = NULL; self->exc_traceback = NULL;
Py_XDECREF(exc_type);
Py_XDECREF(exc_value);
Py_XDECREF(exc_traceback);
} }
static CYTHON_INLINE static CYTHON_INLINE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment