This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] PR python/15464 and python/16113


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]