From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15904 invoked by alias); 14 Dec 2011 18:38:46 -0000 Received: (qmail 15895 invoked by uid 22791); 14 Dec 2011 18:38:45 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Dec 2011 18:38:30 +0000 Received: by vbbfn1 with SMTP id fn1so1024943vbb.0 for ; Wed, 14 Dec 2011 10:38:29 -0800 (PST) Received: by 10.52.74.229 with SMTP id x5mr5882283vdv.29.1323887909381; Wed, 14 Dec 2011 10:38:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.74.229 with SMTP id x5mr5882273vdv.29.1323887909304; Wed, 14 Dec 2011 10:38:29 -0800 (PST) Received: by 10.220.199.4 with HTTP; Wed, 14 Dec 2011 10:38:29 -0800 (PST) In-Reply-To: References: Date: Wed, 14 Dec 2011 18:56:00 -0000 Message-ID: Subject: Re: Don't use obstack_empty_p From: Doug Evans To: Andreas Schwab Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2011-12/txt/msg00461.txt.bz2 On Wed, Dec 14, 2011 at 6:56 AM, Andreas Schwab wro= te: > The obstack implementation in glibc is has changed in a way so that the > obstack_empty_p macro from libiberty's obstack.h can return the wrong > value when applied to an obstack managed by glibc's obstack > implementation. =A0That results in an internal error in > cp_merge_demangle_parse_infos. =A0This is the only use of obstack_empty_p > in the whole src tree (and gcc doesn't use it either), and no other > macro in obstack.h is affected by this incompatibility. =A0So I would > suggest to just not use obstack_empty_p. > > Andreas. > > 2011-12-14 =A0Andreas Schwab =A0 > > =A0 =A0 =A0 =A0* cp-name-parser.y (cp_merge_demangle_parse_infos): Don't = use > =A0 =A0 =A0 =A0obstack_empty_p. > > diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y > index f257370..b0262f2 100644 > --- a/gdb/cp-name-parser.y > +++ b/gdb/cp-name-parser.y > @@ -2029,9 +2029,6 @@ cp_merge_demangle_parse_infos (struct demangle_pars= e_info *dest, > =A0 =A0 =A0cp_demangled_parse_info_free is called. =A0*/ > =A0 src->info =3D NULL; > > - =A0/* Assert if the SRC obstack is not empty. =A0*/ > - =A0gdb_assert (obstack_empty_p (&src->obstack)); > - > =A0 /* Free SRC. =A0*/ > =A0 cp_demangled_name_parse_free (src); > =A0} LGTM