public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Siva Chandra <sivachandra@google.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [Patch] PR python/15464 and python/16113
Date: Mon, 06 Jan 2014 20:50:00 -0000	[thread overview]
Message-ID: <87lhysltqs.fsf@fleche.redhat.com> (raw)
In-Reply-To: <CAGyQ6gwgsCuOu_bSVVWumcVKPs3fyB41KS-QDgCafQggpWBHgg@mail.gmail.com>	(Siva Chandra's message of "Mon, 30 Dec 2013 06:26:59 -0800")

>>>>> "Siva" == Siva Chandra <sivachandra@google.com> writes:

Siva> Attached is a newer version of the patch which an 'xfree' moved to a
Siva> more appropriate place.

Thanks.

Siva> +	  if (name_obj != Py_None)
Siva> +	    {
Siva> +	      field = python_string_to_host_string (name_obj);
Siva> +	      Py_DECREF (name_obj);
Siva> +	      name_obj = NULL;
Siva> +	      if (field == NULL)
Siva> +		return NULL;
Siva> +	    }
Siva> +
Siva> +	  if (name_obj == Py_None || field[0] == '\0')
Siva> +	    {
Siva> +	      PyObject *bitpos_obj;
Siva> +	      int valid;
Siva> +
Siva> +	      Py_XDECREF (name_obj);

I think that if name_obj is the Python string "", then it will be
decref'd twice.

Siva> +	res_val = value_struct_elt_bitpos (&tmp, bitpos, "struct/class/union");

I think this approach will fail in the situation where multiple
anonymous sub-objects appear at the same bitpos.  I think this happens
with inheritance, typically at bitpos 0 but perhaps elsewhere with
multiple inheritance.

It may be sufficient to also pass in an expected type, which could be
extracted from the Field object.

Tom

  reply	other threads:[~2014-01-06 20:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-27 22:38 Siva Chandra
2013-12-30 14:27 ` Siva Chandra
2014-01-06 20:50   ` Tom Tromey [this message]
2014-01-07 14:28     ` Siva Chandra
2014-01-13 21:12       ` Tom Tromey
2014-01-14  1:51         ` Siva Chandra
2014-01-14 14:48         ` Siva Chandra
2014-01-14 14:50           ` Tom Tromey
2014-01-15 12:46             ` Joel Brobecker
2014-01-15 13:19               ` Siva Chandra
2014-01-06 20:36 ` Tom Tromey

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=87lhysltqs.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sivachandra@google.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).