aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2018-08-25 11:52:24 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2018-08-25 11:52:24 -0400
commitbbbbbceebc342d583057a11d88bae85f451cd904 (patch)
treea665fb43cf86a032130c6ee497f1696b2dcf11d7 /gdb/python
parent7a815dd566f3dd32435ac73aa0a0cc948d525e06 (diff)
downloadgdb-bbbbbceebc342d583057a11d88bae85f451cd904.zip
gdb-bbbbbceebc342d583057a11d88bae85f451cd904.tar.gz
gdb-bbbbbceebc342d583057a11d88bae85f451cd904.tar.bz2
Initialize variable in py_get_event_thread
The pythread variable could be used without being initialized, fix it by initializing it to nullptr. gdb/ChangeLog: * python/py-threadevent.c (py_get_event_thread): Initialize pythread.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-threadevent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/python/py-threadevent.c b/gdb/python/py-threadevent.c
index a78f0a3..4f822b4 100644
--- a/gdb/python/py-threadevent.c
+++ b/gdb/python/py-threadevent.c
@@ -25,7 +25,7 @@
PyObject *
py_get_event_thread (ptid_t ptid)
{
- PyObject *pythread;
+ PyObject *pythread = nullptr;
if (non_stop)
{
@@ -36,7 +36,7 @@ py_get_event_thread (ptid_t ptid)
else
pythread = Py_None;
- if (!pythread)
+ if (pythread == nullptr)
{
PyErr_SetString (PyExc_RuntimeError, "Could not find event thread");
return NULL;