Message ID | orwn6dfpia.fsf@lxoliva.fsfla.org |
---|---|
State | New |
Headers | show |
Series | [01/13] scoped tables: insert before further lookups | expand |
On 12/26/22 21:18, Alexandre Oliva via Gcc-patches wrote: > > Avoid adding NULL vnodes to referenced tables. > > Regstrapped on x86_64-linux-gnu. Ok to install? > > > for gcc/ChangeLog > > * varpool.c (symbol_table::remove_unreferenced_decls): Do not > add NULL vnodes to referenced table. OK jeff
diff --git a/gcc/varpool.cc b/gcc/varpool.cc index bfd17f1250cc0..ccbd6e50f4b01 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); } }