From f3300387104722cbfcfc955bdacb474c7f33ba9e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 30 May 2013 17:30:03 +0000 Subject: 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. --- gdb/python/py-frame.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gdb/python/py-frame.c') diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c index 2615ddf..f960b08 100644 --- a/gdb/python/py-frame.c +++ b/gdb/python/py-frame.c @@ -477,7 +477,8 @@ frapy_read_var (PyObject *self, PyObject *args) if (except.reason < 0) { do_cleanups (cleanup); - GDB_PY_HANDLE_EXCEPTION (except); + gdbpy_convert_exception (except); + return NULL; } if (!var) -- cgit v1.1