aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2014-01-22 08:44:41 -0700
committerTom Tromey <tromey@redhat.com>2014-01-23 08:03:51 -0700
commit0740f8d82dd18e48d1531c8d86b531341fc9e099 (patch)
tree6440d7d659446284e1d3a8a2a0586154704d0cba /gdb/python
parent21909fa1c6d934bfa0c7ad3ef95909db48f6f756 (diff)
downloadgdb-0740f8d82dd18e48d1531c8d86b531341fc9e099.zip
gdb-0740f8d82dd18e48d1531c8d86b531341fc9e099.tar.gz
gdb-0740f8d82dd18e48d1531c8d86b531341fc9e099.tar.bz2
fix erroneous error-handling in frame filter code
This fixes PR python/16487. The bug here is that the function-name-handling code in py_print_frame had a small logic error (really a misplaced closing brace). This error could lead to a Py_DECREF(NULL), which crashes. This patch fixes the bug in the obvious way. Built and regtested on x86-64 Fedora 18. New test case included. 2014-01-23 Tom Tromey <tromey@redhat.com> PR python/16487: * python/py-framefilter.c (py_print_frame): Don't call Py_DECREF on a NULL pointer. Move "goto error" to correct place. 2014-01-23 Tom Tromey <tromey@redhat.com> PR python/16487: * gdb.python/py-framefilter.exp: Add test using "Error" filter. * gdb.python/py-framefilter.py (ErrorInName, ErrorFilter): New classes.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-framefilter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
index c6a29ef..1a9f3e0 100644
--- a/gdb/python/py-framefilter.c
+++ b/gdb/python/py-framefilter.c
@@ -1218,11 +1218,11 @@ py_print_frame (PyObject *filter, int flags, enum py_frame_args args_type,
gdbpy_convert_exception (except);
goto error;
}
+ Py_DECREF (py_func);
}
- Py_DECREF (py_func);
+ else
+ goto error;
}
- else
- goto error;
}