aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-07-09 20:29:56 +0000
committerTom Tromey <tromey@redhat.com>2010-07-09 20:29:56 +0000
commitf04e4012c7a78c18a4aa57f8d5fb8759e2e48411 (patch)
tree08d3326d242ed51076f26a5637afed0c5631e323 /gdb
parentf4dfd9c05c7ef31b55c401c1ac491c5d71b845b6 (diff)
downloadgdb-f04e4012c7a78c18a4aa57f8d5fb8759e2e48411.zip
gdb-f04e4012c7a78c18a4aa57f8d5fb8759e2e48411.tar.gz
gdb-f04e4012c7a78c18a4aa57f8d5fb8759e2e48411.tar.bz2
* python/py-prettyprint.c (gdbpy_get_display_hint): Don't use
'hint' if it is NULL.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/python/py-prettyprint.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0e8cea3..d1964c1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-09 Tom Tromey <tromey@redhat.com>
+
+ * python/py-prettyprint.c (gdbpy_get_display_hint): Don't use
+ 'hint' if it is NULL.
+
2010-07-09 Hui Zhu <teawater@gmail.com>
* source.c (print_source_lines_base): Add check for noprint.
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index 9a205b4..434c8a5 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -229,10 +229,12 @@ gdbpy_get_display_hint (PyObject *printer)
return NULL;
hint = PyObject_CallMethodObjArgs (printer, gdbpy_display_hint_cst, NULL);
- if (gdbpy_is_string (hint))
- result = python_string_to_host_string (hint);
if (hint)
- Py_DECREF (hint);
+ {
+ if (gdbpy_is_string (hint))
+ result = python_string_to_host_string (hint);
+ Py_DECREF (hint);
+ }
else
gdbpy_print_stack ();