Skip to content
Snippets Groups Projects
Commit 04f91503 authored by Markus Trippelsdorf's avatar Markus Trippelsdorf Committed by Markus Trippelsdorf
Browse files

Fix UB in hash-map.h

bootstrap-ubsan shows:
  gcc/hash-map.h:277:19: runtime error: member access within null pointer of type 'struct hash_map'

Fix the issue by returning early.

From-SVN: r255166
parent ff27462e
No related merge requests found
2017-11-27 Markus Trippelsdorf <markus@trippelsdorf.de>
* hash-map.h (gt_cleare_cache): Avoid UB.
2017-11-27 Eric Botcazou <ebotcazou@adacore.com>
 
* cfgloop.h (struct loop): Document usage of USHRT_MAX for unroll.
......@@ -274,7 +274,8 @@ template<typename K, typename V, typename H>
static inline void
gt_cleare_cache (hash_map<K, V, H> *h)
{
gt_cleare_cache (&h->m_table);
if (h)
gt_cleare_cache (&h->m_table);
}
template<typename K, typename V, typename H>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment