From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 370 invoked by alias); 1 Mar 2011 21:24:46 -0000 Received: (qmail 361 invoked by uid 22791); 1 Mar 2011 21:24:45 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Mar 2011 21:24:35 +0000 Received: (qmail 17136 invoked from network); 1 Mar 2011 21:24:34 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 Mar 2011 21:24:34 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [commit] py-prettyprint.c, val may be null Date: Tue, 01 Mar 2011 21:24:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-25-generic; KDE/4.6.0; x86_64; ; ) Cc: Michael Snyder References: <4D6D5F71.5040802@vmware.com> In-Reply-To: <4D6D5F71.5040802@vmware.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201103012124.33473.pedro@codesourcery.com> 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-03/txt/msg00048.txt.bz2 On Tuesday 01 March 2011 21:04:49, Michael Snyder wrote: > 2011-03-01 Michael Snyder > > * python/py-prettyprint.c (apply_val_pretty_printer): VAL may > be null. How? I think it could a while ago, but not anymore. I've recently made sure val_print always gets a non-NULL value, and we'd now crash elsewhere otherwise. -- Pedro Alves > > Index: python/py-prettyprint.c > =================================================================== > RCS file: /cvs/src/src/gdb/python/py-prettyprint.c,v > retrieving revision 1.21 > diff -u -p -u -p -r1.21 py-prettyprint.c > --- python/py-prettyprint.c 14 Feb 2011 11:10:53 -0000 1.21 > +++ python/py-prettyprint.c 1 Mar 2011 21:02:05 -0000 > @@ -692,7 +692,8 @@ apply_val_pretty_printer (struct type *t > enum string_repr_result print_result; > > /* No pretty-printer support for unavailable values. */ > - if (!value_bytes_available (val, embedded_offset, TYPE_LENGTH (type))) > + if (val && !value_bytes_available (val, embedded_offset, > + TYPE_LENGTH (type))) > return 0; >