summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 17:18:54 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 17:18:54 +0000
commitf2be34e2d2574ca696ad9dfc7122a24a0d582fb7 (patch)
treeb56965d6aadbb550197711ecc1eb774be9e0cf48 /gdb
parentdb1d5ba6b2833a2b4fdd360032e5090e9e575bff (diff)
downloadgdb-f2be34e2d2574ca696ad9dfc7122a24a0d582fb7.tar.gz
fix py-value.c
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/python/py-value.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 08f247c1fb9..1f07f38cc5f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2013-05-30 Tom Tromey <tromey@redhat.com>
+ * python/py-value.c (valpy_binop): Call do_cleanups before
+ exiting loop.
+
+2013-05-30 Tom Tromey <tromey@redhat.com>
+
* python/py-prettyprint.c (print_children): Remove extra
do_cleanups call.
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 0b2a38fa404..0d87219ae84 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -769,11 +769,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)
{