summaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 17:30:03 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 17:30:03 +0000
commit232cf858dc9952f123510778333b2e8ab2dc56f9 (patch)
tree712e835f7e4521ea10f2cb39b90c9c57467ee3b0 /gdb/python/python.c
parent2ddc5b46e057658b157c26045d74d7d3bbc0c271 (diff)
downloadgdb-232cf858dc9952f123510778333b2e8ab2dc56f9.tar.gz
use explicit returns to avoid checker confusion
The checker does not understand the idiom if (except.reason < 0) { do_cleanups (whatever); GDB_PY_HANDLE_EXCEPTION (except); } because it doesn't realize that the nested 'if' actually has the same condition. This fixes instances of this to be more explicit. * python/py-breakpoint.c (bppy_get_commands): Use explicit, unconditional return. * python/py-frame.c (frapy_read_var): Likewise. * python/python.c (gdbpy_decode_line): Likewise.
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r--gdb/python/python.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 690534f1539..c94198e2985 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -653,7 +653,8 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
{
do_cleanups (cleanups);
/* We know this will always throw. */
- GDB_PY_HANDLE_EXCEPTION (except);
+ gdbpy_convert_exception (except);
+ return NULL;
}
if (sals.nelts)