This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 21/40] fix py-value.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:44 -0600
- Subject: [PATCH 21/40] fix py-value.c
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com>
Some code in py-value.c could exit a loop without running some
cleanups made in the loop.
* python/py-value.c (valpy_binop): Call do_cleanups before
exiting loop.
---
gdb/python/py-value.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 2cbb0cb..da74982 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -776,11 +776,17 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other)
a gdb.Value object and need to convert it from python as well. */
arg1 = convert_value_from_python (self);
if (arg1 == NULL)
- break;
+ {
+ do_cleanups (cleanup);
+ break;
+ }
arg2 = convert_value_from_python (other);
if (arg2 == NULL)
- break;
+ {
+ do_cleanups (cleanup);
+ break;
+ }
switch (opcode)
{
--
1.8.1.4