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 | 39cc9036cec20e713f4ec002e425422c21f81b12 (patch) | |
tree | 6729748265f8c1b3a71cdd10c797ec976c5fe85a /gdb/python | |
parent | 29b26fc5635d26ca73927809396f6c8c03de159e (diff) | |
download | gdb-39cc9036cec20e713f4ec002e425422c21f81b12.tar.gz |
* python/py-value.c (valpy_get_dynamic_type): Simplify
dynamic_type assignment. Use Py_XINCREF.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-value.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index 9c55fe1f1e5..0b2a38fa404 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; } |