From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113616 invoked by alias); 6 Dec 2018 19:20:10 -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 113171 invoked by uid 89); 6 Dec 2018 19:20:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Description X-HELO: mail-wr1-f48.google.com Received: from mail-wr1-f48.google.com (HELO mail-wr1-f48.google.com) (209.85.221.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Dec 2018 19:20:08 +0000 Received: by mail-wr1-f48.google.com with SMTP id p4so1598907wrt.7 for ; Thu, 06 Dec 2018 11:20:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KLfj+1Q4NW8WyIa8W/JvzG9YgXJtwgac25JztRKrT4U=; b=he7XRPIfSz636TIR2Qlql+QJIVFTDhJLuQVqS4K0tqXufk8etKmLRldJsZmiwM8HdD tsHFiYiwrrajlyh5bs4B7wNMJ9dwXwFOuqp5TNsvRkV6Lij+VixsrhIEfgZlgYaqOzxM Nx1bAn9kZ0buKHcXFKSm8xbHnzhyQsoeLvRoGv6PQN6A19AGnLFtTW3Yoifipdnb0sFk 1/Iw93PHpYNUZbWjycJCmoDg13JPssQX+mz4z3FzbkzboP3ge9cbZ8AVprhvN/G/Jd0O reybhZbqYMVeWM2HegcJ5nAzR1GBDgkT/ALgLMBAwqm1j09o0JJfgixiNG/TOk8rw3Vm +sHA== Return-Path: Received: from localhost (host86-156-236-210.range86-156.btcentralplus.com. [86.156.236.210]) by smtp.gmail.com with ESMTPSA id d8sm653005wrw.70.2018.12.06.11.20.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 11:20:04 -0800 (PST) Date: Thu, 06 Dec 2018 19:20:00 -0000 From: Andrew Burgess To: Bob Steagall Cc: gdb-patches@sourceware.org Subject: Re: potential patch for gdb bug c++/20020 Message-ID: <20181206192003.GZ18841@embecosm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Fortune: Factorials were someone's attempt to make math LOOK exciting. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00074.txt.bz2 * Bob Steagall [2018-12-06 13:29:31 -0500]: > Description: This patch, against released version 8.2, fixes the > problem reported in gdb bug c++/20020, using the approach described in > comment 1 of that report. > > Changelog entry: > > 2018-12-06 Bob Steagall > > * cp-valprint.c: Fixes bug c++/20020. > --- gdb/cp-valprint.c 2018-09-05 03:27:13.000000000 -0400 > +++ gdb/cp-valprint.c.new 2018-12-06 13:01:06.819266165 -0500 > @@ -326,12 +326,16 @@ cp_print_value_fields (struct type *type > fprintf_filtered (stream, > _(""), > ex.message); > + v = NULL; I don't think this NULL assignment should be needed. `v` starts as NULL, and we only end in this block if `value_static_field` throws an exception, which will be before `v` is assigned too. > } > END_CATCH > > - cp_print_static_field (TYPE_FIELD_TYPE (type, i), > - v, stream, recurse + 1, > - options); > + if (v != NULL) > + { You should drop the '{' and '}' here for a single statement block. > + cp_print_static_field (TYPE_FIELD_TYPE (type, i), > + v, stream, recurse + 1, > + options); > + } > } > else if (i == vptr_fieldno && type == vptr_basetype) > { I'm not a maintainer so can't approve patches, but this seems sensible to me. Thanks, Andrew