From: Daniel Jacobowitz <drow@mvista.com>
To: Jason Merrill <jason@redhat.com>, gdb-patches@sources.redhat.com
Subject: Problem with your patch to is_type_conversion_operator
Date: Tue, 15 Jan 2002 18:45:00 -0000 [thread overview]
Message-ID: <20020115214514.A14245@nevyn.them.org> (raw)
This patch caused a few dozen regressions on the GCC 2.95.x/DWARF-2
combination. This is caused by the v2 vs. v3 use of DW_AT_name for
operators. In v2 we get:
DW_AT_name : operator =
But in v3:
DW_AT_name : operator=
So in v3:
399 if (! strchr (" \t\f\n\r", *name))
400 return 0;
triggers for operator=. We never even go to look at what operator it is.
But for v2 it doesn't, and name is '='. That doesn't look like new. That
doesn't look like delete. It's not a type conversion operator!
Not that there was anything wrong with your patch; it was papering over this
potential bug (well, potential when that code was written).
I've committed the patch below to fix it.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
2002-01-15 Daniel Jacobowitz <drow@mvista.com>
* c-typeprint.c (is_type_conversion_operator): Add additional
check for non-conversion operators.
Index: c-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-typeprint.c,v
retrieving revision 1.14
diff -u -p -r1.14 c-typeprint.c
--- c-typeprint.c 2002/01/10 00:06:02 1.14
+++ c-typeprint.c 2002/01/16 02:41:47
@@ -402,7 +402,13 @@ is_type_conversion_operator (struct type
while (strchr (" \t\f\n\r", *name))
name++;
- if (strncmp (name, "new", 3) == 0)
+ if (!('a' <= *name && *name <= 'z')
+ && !('A' <= *name && *name <= 'Z')
+ && *name != '_')
+ /* If this doesn't look like the start of an identifier, then it
+ isn't a type conversion operator. */
+ return 0;
+ else if (strncmp (name, "new", 3) == 0)
name += 3;
else if (strncmp (name, "delete", 6) == 0)
name += 6;
next reply other threads:[~2002-01-16 2:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-15 18:45 Daniel Jacobowitz [this message]
2002-01-16 2:26 ` Jason Merrill
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=20020115214514.A14245@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jason@redhat.com \
/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