From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3319 invoked by alias); 14 Feb 2011 15:19:52 -0000 Received: (qmail 3311 invoked by uid 22791); 14 Feb 2011 15:19:51 -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; Mon, 14 Feb 2011 15:19:46 +0000 Received: (qmail 27934 invoked from network); 14 Feb 2011 15:19:44 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 Feb 2011 15:19:44 -0000 From: Pedro Alves To: Mark Kettenis Subject: Re: No longer accept NULL values in value_bits_valid and value_bits_synthetic_pointer Date: Mon, 14 Feb 2011 15:29:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-25-generic; KDE/4.6.0; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <201102141156.49457.pedro@codesourcery.com> <201102141158.02189.pedro@codesourcery.com> <201102141450.p1EEoNV6003363@glazunov.sibelius.xs4all.nl> In-Reply-To: <201102141450.p1EEoNV6003363@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201102141519.39403.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-02/txt/msg00282.txt.bz2 On Monday 14 February 2011 14:50:23, Mark Kettenis wrote: > > 2011-02-14 Pedro Alves > > > > * value.c (value_bits_valid, value_bits_synthetic_pointer): > > No longer handle NULL values. > > Would it be a good idea to add a gdb_assert() here to check for a NULL pointer? I considered it, but then didn't add it. None of the other value_ functions does that before dereferencing the value. There aren't many places these functions are called, and, I still plan on putting an assertion like that in a few more central places, near the roots of the val_print & co call chains, which should cover this as well. -- Pedro Alves