From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25021 invoked by alias); 14 Feb 2011 14:52:01 -0000 Received: (qmail 25001 invoked by uid 22791); 14 Feb 2011 14:52:00 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Feb 2011 14:51:53 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id p1EEoSSe004182; Mon, 14 Feb 2011 15:50:28 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id p1EEoNV6003363; Mon, 14 Feb 2011 15:50:23 +0100 (CET) Date: Mon, 14 Feb 2011 15:17:00 -0000 Message-Id: <201102141450.p1EEoNV6003363@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: pedro@codesourcery.com CC: gdb-patches@sourceware.org In-reply-to: <201102141158.02189.pedro@codesourcery.com> (message from Pedro Alves on Mon, 14 Feb 2011 11:58:02 +0000) Subject: Re: No longer accept NULL values in value_bits_valid and value_bits_synthetic_pointer References: <201102141156.49457.pedro@codesourcery.com> <201102141158.02189.pedro@codesourcery.com> 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/msg00280.txt.bz2 > From: Pedro Alves > Date: Mon, 14 Feb 2011 11:58:02 +0000 > > 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. Would it be a good idea to add a gdb_assert() here to check for a NULL pointer? > --- > 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, >