diff options
author | Tom Tromey <tromey@redhat.com> | 2013-05-20 20:38:47 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-05-20 20:38:47 +0000 |
commit | 97b77b3951bc72a15481a82fca2fd3ee9dd3d1d8 (patch) | |
tree | b2fc9d34c2c7aa7cbd11441e244360762e9ab19c | |
parent | 53e66479289df8761b06870304d67bdaf91f247d (diff) | |
download | gdb-97b77b3951bc72a15481a82fca2fd3ee9dd3d1d8.zip gdb-97b77b3951bc72a15481a82fca2fd3ee9dd3d1d8.tar.gz gdb-97b77b3951bc72a15481a82fca2fd3ee9dd3d1d8.tar.bz2 |
* python/py-value.c (valpy_get_dynamic_type): Simplify
dynamic_type assignment. Use Py_XINCREF.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/python/py-value.c | 11 |
2 files changed, 7 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fde010c..99fc791 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-05-20 Tom Tromey <tromey@redhat.com> + * python/py-value.c (valpy_get_dynamic_type): Simplify + dynamic_type assignment. Use Py_XINCREF. + +2013-05-20 Tom Tromey <tromey@redhat.com> + * python/py-type.c (typy_fields): Unconditionally decref 'r'. 2013-05-20 Tom Tromey <tromey@redhat.com> diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index 9c55fe1..0b2a38f 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -334,18 +334,11 @@ valpy_get_dynamic_type (PyObject *self, void *closure) GDB_PY_HANDLE_EXCEPTION (except); if (type == NULL) - { - /* Ensure that the TYPE field is ready. */ - if (!valpy_get_type (self, NULL)) - return NULL; - /* We don't need to incref here, because valpy_get_type already - did it for us. */ - obj->dynamic_type = obj->type; - } + obj->dynamic_type = valpy_get_type (self, NULL); else obj->dynamic_type = type_to_type_object (type); - Py_INCREF (obj->dynamic_type); + Py_XINCREF (obj->dynamic_type); return obj->dynamic_type; } |