mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
fix error handling
This commit is contained in:
parent
4b5c53aba5
commit
985951df7f
1 changed files with 7 additions and 4 deletions
|
|
@ -732,7 +732,6 @@ analyze_child_block(PySTEntryObject *entry, PyObject *bound, PyObject *free,
|
||||||
PyObject *global, PyObject* child_free)
|
PyObject *global, PyObject* child_free)
|
||||||
{
|
{
|
||||||
PyObject *temp_bound = NULL, *temp_global = NULL, *temp_free = NULL;
|
PyObject *temp_bound = NULL, *temp_global = NULL, *temp_free = NULL;
|
||||||
int success = 0;
|
|
||||||
|
|
||||||
/* Copy the bound and global dictionaries.
|
/* Copy the bound and global dictionaries.
|
||||||
|
|
||||||
|
|
@ -759,13 +758,17 @@ analyze_child_block(PySTEntryObject *entry, PyObject *bound, PyObject *free,
|
||||||
|
|
||||||
if (!analyze_block(entry, temp_bound, temp_free, temp_global))
|
if (!analyze_block(entry, temp_bound, temp_free, temp_global))
|
||||||
goto error;
|
goto error;
|
||||||
success = PyDict_Update(child_free, temp_free) >= 0;
|
if (PyDict_Update(child_free, temp_free) < 0)
|
||||||
success = 1;
|
goto error;
|
||||||
|
Py_DECREF(temp_bound);
|
||||||
|
Py_DECREF(temp_free);
|
||||||
|
Py_DECREF(temp_global);
|
||||||
|
return 1;
|
||||||
error:
|
error:
|
||||||
Py_XDECREF(temp_bound);
|
Py_XDECREF(temp_bound);
|
||||||
Py_XDECREF(temp_free);
|
Py_XDECREF(temp_free);
|
||||||
Py_XDECREF(temp_global);
|
Py_XDECREF(temp_global);
|
||||||
return success;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue