fix py-value.c
authorTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:18:54 +0000 (17:18 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:18:54 +0000 (17:18 +0000)
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/ChangeLog
gdb/python/py-value.c

index 08f247c1fb94be49da07b47e8f93f92ce8aee11f..1f07f38cc5fc1a2ff794d2a4b0b9687e82acd277 100644 (file)
@@ -1,3 +1,8 @@
+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
index 0b2a38fa40498111a17570d1554862a0c73d7919..0d87219ae8472af95e51873c52b8cc1940ba112b 100644 (file)
@@ -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)
        {