* python/py-value.c (valpy_get_dynamic_type): Simplify
dynamic_type assignment. Use Py_XINCREF.
This commit is contained in:
parent
53e6647928
commit
97b77b3951
2 changed files with 7 additions and 9 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
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>
|
2013-05-20 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* python/py-type.c (typy_fields): Unconditionally decref 'r'.
|
* python/py-type.c (typy_fields): Unconditionally decref 'r'.
|
||||||
|
|
|
@ -334,18 +334,11 @@ valpy_get_dynamic_type (PyObject *self, void *closure)
|
||||||
GDB_PY_HANDLE_EXCEPTION (except);
|
GDB_PY_HANDLE_EXCEPTION (except);
|
||||||
|
|
||||||
if (type == NULL)
|
if (type == NULL)
|
||||||
{
|
obj->dynamic_type = valpy_get_type (self, 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;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
obj->dynamic_type = type_to_type_object (type);
|
obj->dynamic_type = type_to_type_object (type);
|
||||||
|
|
||||||
Py_INCREF (obj->dynamic_type);
|
Py_XINCREF (obj->dynamic_type);
|
||||||
return obj->dynamic_type;
|
return obj->dynamic_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue