public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] varpool: do not add NULL vnodes to referenced
@ 2022-12-28 5:23 Alexandre Oliva
0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2022-12-28 5:23 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:e575665ae99f83788c1471f1e355922c3359e728
commit e575665ae99f83788c1471f1e355922c3359e728
Author: Alexandre Oliva <oliva@adacore.com>
Date: Wed Dec 28 02:21:29 2022 -0300
varpool: do not add NULL vnodes to referenced
Avoid adding NULL vnodes to referenced tables.
for gcc/ChangeLog
* varpool.c (symbol_table::remove_unreferenced_decls): Do not
add NULL vnodes to referenced table.
Diff:
---
gcc/varpool.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gcc/varpool.cc b/gcc/varpool.cc
index bfd17f1250c..ccbd6e50f4b 100644
--- a/gcc/varpool.cc
+++ b/gcc/varpool.cc
@@ -680,10 +680,12 @@ symbol_table::remove_unreferenced_decls (void)
enqueue_node (vnode, &first);
else
{
- referenced.add (vnode);
+ if (vnode)
+ referenced.add (vnode);
while (vnode && vnode->alias && vnode->definition)
{
vnode = vnode->get_alias_target ();
+ gcc_checking_assert (vnode);
referenced.add (vnode);
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-28 5:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-28 5:23 [gcc(refs/users/aoliva/heads/testme)] varpool: do not add NULL vnodes to referenced Alexandre Oliva
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).