From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5610 invoked by alias); 14 Feb 2011 11:58:13 -0000 Received: (qmail 5594 invoked by uid 22791); 14 Feb 2011 11:58:12 -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 11:58:06 +0000 Received: (qmail 31762 invoked from network); 14 Feb 2011 11:58:05 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 Feb 2011 11:58:05 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: No longer accept NULL values in value_bits_valid and value_bits_synthetic_pointer Date: Mon, 14 Feb 2011 11:58:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-25-generic; KDE/4.6.0; x86_64; ; ) References: <201102141156.49457.pedro@codesourcery.com> In-Reply-To: <201102141156.49457.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102141158.02189.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/msg00261.txt.bz2 On Monday 14 February 2011 11:56:49, Pedro Alves wrote: > Following up on > . > > I've checked in this patch. We shouldn't be getting > NULL values here anymore. If I missed a case were we do, the > offending caller needs to be fixed to not pass it. > > Pedro Alves > > 2011-02-14 Pedro Alves > > * value.c (value_bits_valid, value_bits_synthetic_pointer): > No longer handle NULL values. Sigh. 2011-02-14 Pedro Alves * value.c (value_bits_valid, value_bits_synthetic_pointer): No longer handle NULL values. --- gdb/value.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: src/gdb/value.c =================================================================== --- src.orig/gdb/value.c 2011-02-11 15:53:44.717504003 +0000 +++ src/gdb/value.c 2011-02-11 15:53:51.457503999 +0000 @@ -998,7 +998,7 @@ value_entirely_optimized_out (const stru int value_bits_valid (const struct value *value, int offset, int length) { - if (value == NULL || !value->optimized_out) + if (!value->optimized_out) return 1; if (value->lval != lval_computed || !value->location.computed.funcs->check_validity) @@ -1011,7 +1011,7 @@ int value_bits_synthetic_pointer (const struct value *value, int offset, int length) { - if (value == NULL || value->lval != lval_computed + if (value->lval != lval_computed || !value->location.computed.funcs->check_synthetic_pointer) return 0; return value->location.computed.funcs->check_synthetic_pointer (value,