mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
btf: check hash maps are non-null before emptying
These maps will always be non-null in btf_finalize under normal circumstances, but be safe and verify that before trying to empty them. gcc/ * btfout.cc (btf_finalize): Check that hash maps are non-null before emptying them.
This commit is contained in:
parent
2a2e678407
commit
6571e8f863
@ -1661,13 +1661,19 @@ btf_finalize (void)
|
|||||||
datasecs.release ();
|
datasecs.release ();
|
||||||
|
|
||||||
funcs = NULL;
|
funcs = NULL;
|
||||||
|
if (func_map)
|
||||||
|
{
|
||||||
func_map->empty ();
|
func_map->empty ();
|
||||||
func_map = NULL;
|
func_map = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (debug_prune_btf)
|
if (debug_prune_btf)
|
||||||
|
{
|
||||||
|
if (btf_used_types)
|
||||||
{
|
{
|
||||||
btf_used_types->empty ();
|
btf_used_types->empty ();
|
||||||
btf_used_types = NULL;
|
btf_used_types = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
fixups.release ();
|
fixups.release ();
|
||||||
forwards = NULL;
|
forwards = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user