* python/python-value.c (valpy_richcompare): Don't return from
authorTom Tromey <tromey@redhat.com>
Mon, 24 Aug 2009 18:55:21 +0000 (18:55 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 24 Aug 2009 18:55:21 +0000 (18:55 +0000)
inside a TRY_CATCH.

gdb/ChangeLog
gdb/python/python-value.c

index dcd1e6b4b8585547cdd282800be8c64526e2908c..cfe60356355871322aa40d635506e0b856085771 100644 (file)
@@ -1,3 +1,8 @@
+2009-08-24  Tom Tromey  <tromey@redhat.com>
+
+       * python/python-value.c (valpy_richcompare): Don't return from
+       inside a TRY_CATCH.
+
 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * CONTRIBUTE: Bump documented Autoconf version.
index c4217d571d6ea8273353c3c907aceb11f339f837..3d88aa31f8b2ab24afdcd6791b9a944ff1ad626f 100644 (file)
@@ -693,7 +693,10 @@ valpy_richcompare (PyObject *self, PyObject *other, int op)
     {
       value_other = convert_value_from_python (other);
       if (value_other == NULL)
-       return NULL;
+       {
+         result = -1;
+         break;
+       }
 
       switch (op) {
         case Py_LT:
@@ -720,11 +723,16 @@ valpy_richcompare (PyObject *self, PyObject *other, int op)
          /* Can't happen.  */
          PyErr_SetString (PyExc_NotImplementedError,
                           "Invalid operation on gdb.Value.");
-         return NULL;
+         result = -1;
+         break;
       }
     }
   GDB_PY_HANDLE_EXCEPTION (except);
 
+  /* In this case, the Python exception has already been set.  */
+  if (result < 0)
+    return NULL;
+
   if (result == 1)
     Py_RETURN_TRUE;
 
This page took 0.02871 seconds and 4 git commands to generate.