From 04f915037850166c05c73baf3d6e2ba10c790ea1 Mon Sep 17 00:00:00 2001 From: Markus Trippelsdorf Date: Mon, 27 Nov 2017 12:53:16 +0000 Subject: 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 --- gcc/hash-map.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/hash-map.h') diff --git a/gcc/hash-map.h b/gcc/hash-map.h index 6b8365a9d..10ae52d 100644 --- a/gcc/hash-map.h +++ b/gcc/hash-map.h @@ -274,7 +274,8 @@ template static inline void gt_cleare_cache (hash_map *h) { - gt_cleare_cache (&h->m_table); + if (h) + gt_cleare_cache (&h->m_table); } template -- cgit v1.1