diff mbox series

[2/5] unqual: unqualify_type() should check for null ctypes

Message ID 20201118211147.10680-3-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series fix qualifier dropping | expand

Commit Message

Luc Van Oostenryck Nov. 18, 2020, 9:11 p.m. UTC
It's possible that the input type is NULL, so add a check for it.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 evaluate.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/evaluate.c b/evaluate.c
index c39f9ec73da9..fd84205c7f2c 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -63,6 +63,8 @@  static inline int valid_subexpr_type(struct expression *expr)
 
 static struct symbol *unqualify_type(struct symbol *ctype)
 {
+	if (!ctype)
+		return ctype;
 	if (ctype->type == SYM_NODE && (ctype->ctype.modifiers & MOD_QUALIFIER)) {
 		struct symbol *unqual = alloc_symbol(ctype->pos, 0);