From: Joel Brobecker <brobecker@adacore.com>
To: msnyder@sonic.net
Cc: gdb-patches@sourceware.org
Subject: [commit] ada-lang, possible_user_operator_p, null pointer (take 2)
Date: Wed, 15 Aug 2007 18:39:00 -0000 [thread overview]
Message-ID: <20070815184327.GH11498@adacore.com> (raw)
In-Reply-To: <23927.12.7.175.2.1187116409.squirrel@webmail.sonic.net>
[-- Attachment #1: Type: text/plain, Size: 711 bytes --]
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 <hilfinger@adacore.com>
Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (possible_user_operator_p): Alternative fix to last
checkin guarding against NULL.
Tested on x86-linux.
--
Joel
[-- Attachment #2: user_op.diff --]
[-- Type: text/plain, Size: 994 bytes --]
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)));
prev parent reply other threads:[~2007-08-15 18:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-11 20:43 [PATCH] ada-lang, possible_user_operator_p, null pointer msnyder
2007-08-14 4:27 ` Joel Brobecker
2007-08-14 5:20 ` Joel Brobecker
2007-08-14 18:33 ` msnyder
2007-08-15 18:39 ` Joel Brobecker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070815184327.GH11498@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@sonic.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox