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
+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.
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>