aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-10-12 22:44:20 +0000
committerTom Tromey <tromey@redhat.com>2010-10-12 22:44:20 +0000
commit1bdb0c5472c10b1af38b915df48ceee417192aa3 (patch)
tree00ea9be44f983ff25858e1fc057ddad38b15a297 /gdb/python
parent0526b37ab5b8f8ba89f8ea4d4d86522fc4bd807c (diff)
downloadgdb-1bdb0c5472c10b1af38b915df48ceee417192aa3.zip
gdb-1bdb0c5472c10b1af38b915df48ceee417192aa3.tar.gz
gdb-1bdb0c5472c10b1af38b915df48ceee417192aa3.tar.bz2
* python/py-prettyprint.c (search_pp_list): Fix error checking.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-prettyprint.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index 434c8a5..7aa83bc 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -49,9 +49,20 @@ search_pp_list (PyObject *list, PyObject *value)
return NULL;
/* Skip if disabled. */
- if (PyObject_HasAttr (function, gdbpy_enabled_cst)
- && ! PyObject_IsTrue (PyObject_GetAttr (function, gdbpy_enabled_cst)))
- continue;
+ if (PyObject_HasAttr (function, gdbpy_enabled_cst))
+ {
+ PyObject *attr = PyObject_GetAttr (function, gdbpy_enabled_cst);
+ int cmp;
+
+ if (!attr)
+ return NULL;
+ cmp = PyObject_IsTrue (attr);
+ if (cmp == -1)
+ return NULL;
+
+ if (!cmp)
+ continue;
+ }
printer = PyObject_CallFunctionObjArgs (function, value, NULL);
if (! printer)