From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5232 invoked by alias); 6 Jan 2014 20:50:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 5218 invoked by uid 89); 6 Jan 2014 20:50:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Jan 2014 20:50:55 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s06KoqEE009731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Jan 2014 15:50:52 -0500 Received: from barimba (ovpn-113-85.phx2.redhat.com [10.3.113.85]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s06KopEr031238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 6 Jan 2014 15:50:51 -0500 From: Tom Tromey To: Siva Chandra Cc: gdb-patches Subject: Re: [Patch] PR python/15464 and python/16113 References: Date: Mon, 06 Jan 2014 20:50:00 -0000 In-Reply-To: (Siva Chandra's message of "Mon, 30 Dec 2013 06:26:59 -0800") Message-ID: <87lhysltqs.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-01/txt/msg00098.txt.bz2 >>>>> "Siva" == Siva Chandra 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