From: Doug Evans <dje@google.com>
To: Keith Seitz <keiths@redhat.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Initialize `location' in gdbpy_decode_line
Date: Wed, 12 Aug 2015 17:46:00 -0000 [thread overview]
Message-ID: <CADPb22S-Wrhw9aEVR9LhmVJ7rPYi0GgDxKCSW8qgGUNT12jU-A@mail.gmail.com> (raw)
In-Reply-To: <1439401110-12694-1-git-send-email-keiths@redhat.com>
On Wed, Aug 12, 2015 at 10:38 AM, Keith Seitz <keiths@redhat.com> wrote:
> BuildBot flagged an uninitialized variable coming from one of the patches
> in my recently committed locations/explicit patchset.
>
> The following patch fixes this.
>
> Ok?
>
> gdb/ChangeLog
>
> * python/python.c (gdbpy_decode_line): Initialize `location' to NULL
> and only call decode_line_1 when it is non-NULL.
>
> diff --git a/gdb/python/python.c b/gdb/python/python.c
> index c28f98b..14da62c 100644
> --- a/gdb/python/python.c
> +++ b/gdb/python/python.c
> @@ -730,7 +730,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
> PyObject *result = NULL;
> PyObject *return_result = NULL;
> PyObject *unparsed = NULL;
> - struct event_location *location;
> + struct event_location *location = NULL;
>
> if (! PyArg_ParseTuple (args, "|s", &arg))
> return NULL;
> @@ -747,7 +747,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
>
> TRY
> {
> - if (arg)
> + if (location != NULL)
> sals = decode_line_1 (location, 0, 0, 0);
> else
> {
LGTM
next prev parent reply other threads:[~2015-08-12 17:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-12 17:38 Keith Seitz
2015-08-12 17:46 ` Doug Evans [this message]
2015-08-12 18:32 ` Keith Seitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADPb22S-Wrhw9aEVR9LhmVJ7rPYi0GgDxKCSW8qgGUNT12jU-A@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox