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.
datasecs.release ();
funcs = NULL;
- func_map->empty ();
- func_map = NULL;
+ if (func_map)
+ {
+ func_map->empty ();
+ func_map = NULL;
+ }
if (debug_prune_btf)
{
- btf_used_types->empty ();
- btf_used_types = NULL;
+ if (btf_used_types)
+ {
+ btf_used_types->empty ();
+ btf_used_types = NULL;
+ }
fixups.release ();
forwards = NULL;