* [incremental] Patch: FYI: handle null binding in duplicate_decls
@ 2007-12-14 16:44 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2007-12-14 16:44 UTC (permalink / raw)
To: Gcc Patch List
I'm checking this in on the incremental-compiler branch.
The 'binding' argument to duplicate_decls can be NULL. This happens
with the 20041005-1.c test case. We didn't account for this, causing
a crash.
This patch fixes the problem and lets us pass a few more tests.
Tom
ChangeLog:
2007-12-14 Tom Tromey <tromey@redhat.com>
* c-decl.c (pushdecl): Pass NULL directly to duplicate_decls.
(duplicate_decls): Check for non-NULL binding.
Index: c-decl.c
===================================================================
--- c-decl.c (revision 130776)
+++ c-decl.c (working copy)
@@ -2113,7 +2113,8 @@
since we do not want to smash any generally visible (and
reusable) decl. FIXME: should make just one duplicate for
both scopes. */
- if ((B_IN_FILE_SCOPE (binding) || B_IN_EXTERNAL_SCOPE (binding))
+ if (binding
+ && (B_IN_FILE_SCOPE (binding) || B_IN_EXTERNAL_SCOPE (binding))
&& !object_in_current_hunk_p (olddecl))
{
/* Modify a copy of OLDDECL and install that in the
@@ -2461,7 +2462,7 @@
}
else if (TREE_PUBLIC (x))
{
- if (visdecl && !b && duplicate_decls (x, visdecl, b))
+ if (visdecl && !b && duplicate_decls (x, visdecl, NULL))
{
/* An external declaration at block scope referring to a
visible entity with internal linkage. The composite
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-12-14 16:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-14 16:44 [incremental] Patch: FYI: handle null binding in duplicate_decls Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).