From ddb08e9caa02b478b6f4f3969cf5a7142fc0035e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 28 Feb 2013 20:14:08 +0000 Subject: [PATCH] * python/py-arch.c (archpy_disassemble): Use PyInt_Check and PyLong_Check. --- gdb/ChangeLog | 5 +++++ gdb/python/py-arch.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d92a703739..c788b3ba41 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-02-28 Tom Tromey + + * python/py-arch.c (archpy_disassemble): Use PyInt_Check and + PyLong_Check. + 2013-02-28 Doug Evans * python/py-finishbreakpoint.c (bpfinishpy_init): gcc -Wall lint. diff --git a/gdb/python/py-arch.c b/gdb/python/py-arch.c index b41de06252..ddfebdb2f7 100644 --- a/gdb/python/py-arch.c +++ b/gdb/python/py-arch.c @@ -111,12 +111,12 @@ archpy_disassemble (PyObject *self, PyObject *args, PyObject *kw) start = start_temp; if (end_obj) { - if (PyObject_TypeCheck (end_obj, &PyInt_Type)) + if (PyLong_Check (end_obj)) + end = PyLong_AsUnsignedLongLong (end_obj); + else if (PyInt_Check (end_obj)) /* If the end_pc value is specified without a trailing 'L', end_obj will be an integer and not a long integer. */ end = PyInt_AsLong (end_obj); - else if (PyObject_TypeCheck (end_obj, &PyLong_Type)) - end = PyLong_AsUnsignedLongLong (end_obj); else { Py_DECREF (end_obj);