This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 19/40] fix py-frame.c
- From: Tom Tromey <tromey at redhat dot com>
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 09 May 2013 12:51:38 -0600
- Subject: [PATCH 19/40] fix py-frame.c
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com>
A couple return paths in frapy_read_var were missing do_cleanups calls.
* python/py-frame.c (frapy_read_var): Call do_cleanups along
all return paths.
---
gdb/python/py-frame.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
index e2eb9c5..33d0bd0 100644
--- a/gdb/python/py-frame.c
+++ b/gdb/python/py-frame.c
@@ -456,6 +456,7 @@ frapy_read_var (PyObject *self, PyObject *args)
{
PyErr_SetString (PyExc_RuntimeError,
_("Second argument must be block."));
+ do_cleanups (cleanup);
return NULL;
}
}
@@ -468,7 +469,11 @@ frapy_read_var (PyObject *self, PyObject *args)
block = get_frame_block (frame, NULL);
var = lookup_symbol (var_name, block, VAR_DOMAIN, NULL);
}
- GDB_PY_HANDLE_EXCEPTION (except);
+ if (except.reason < 0)
+ {
+ do_cleanups (cleanup);
+ GDB_PY_HANDLE_EXCEPTION (except);
+ }
if (!var)
{
--
1.8.1.4