From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3472 invoked by alias); 15 Aug 2007 18:39:51 -0000 Received: (qmail 3205 invoked by uid 22791); 15 Aug 2007 18:39:49 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 15 Aug 2007 18:39:43 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C9AD12AA96F; Wed, 15 Aug 2007 14:39:41 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bP0lk-cvPj6V; Wed, 15 Aug 2007 14:39:41 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 918082AA909; Wed, 15 Aug 2007 14:39:41 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id B8D8FE7B54; Wed, 15 Aug 2007 11:43:27 -0700 (PDT) Date: Wed, 15 Aug 2007 18:39:00 -0000 From: Joel Brobecker To: msnyder@sonic.net Cc: gdb-patches@sourceware.org Subject: [commit] ada-lang, possible_user_operator_p, null pointer (take 2) Message-ID: <20070815184327.GH11498@adacore.com> References: <19577.12.7.175.2.1186864998.squirrel@webmail.sonic.net> <20070814043053.GB11498@adacore.com> <20070814052419.GE11498@adacore.com> <23927.12.7.175.2.1187116409.squirrel@webmail.sonic.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Qz2CZ664xQdCRdPu" Content-Disposition: inline In-Reply-To: <23927.12.7.175.2.1187116409.squirrel@webmail.sonic.net> User-Agent: Mutt/1.4.2.2i 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: 2007-08/txt/msg00313.txt.bz2 --Qz2CZ664xQdCRdPu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 711 Hello, > > In the meantime, I think it's fine to check in your patch. > > We'll probably end up rewriting this part of the code, but > > that won't actually change the actual logic, so.... > > Glad you're on it, and I'll commit this patch. Paul Hilfinger pointed out that we actually have the perfect function for it, so we don't even have to create it. I just committed the following patch, which considerably simplifies the complexity of the condition :). 2007-08-15 Paul Hilfinger Joel Brobecker * ada-lang.c (possible_user_operator_p): Alternative fix to last checkin guarding against NULL. Tested on x86-linux. -- Joel --Qz2CZ664xQdCRdPu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="user_op.diff" Content-length: 994 Index: ada-lang.c =================================================================== RCS file: /cvs/src/src/gdb/ada-lang.c,v retrieving revision 1.102 diff -u -p -r1.102 ada-lang.c --- ada-lang.c 14 Aug 2007 20:16:16 -0000 1.102 +++ ada-lang.c 15 Aug 2007 18:31:06 -0000 @@ -3532,14 +3535,7 @@ possible_user_operator_p (enum exp_opcod return (!(scalar_type_p (type0) && scalar_type_p (type1))); case BINOP_CONCAT: - return - ((TYPE_CODE (type0) != TYPE_CODE_ARRAY - && (TYPE_CODE (type0) != TYPE_CODE_PTR - || TYPE_CODE (TYPE_TARGET_TYPE (type0)) != TYPE_CODE_ARRAY)) - || (type1 != NULL && TYPE_CODE (type1) != TYPE_CODE_ARRAY - && (TYPE_CODE (type1) != TYPE_CODE_PTR - || (TYPE_CODE (TYPE_TARGET_TYPE (type1)) - != TYPE_CODE_ARRAY)))); + return !ada_is_array_type (type0) || !ada_is_array_type (type1); case BINOP_EXP: return (!(numeric_type_p (type0) && integer_type_p (type1))); --Qz2CZ664xQdCRdPu--