diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-11-18 17:18:28 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-11-18 21:57:59 +0100 |
commit | 847eaf89b449661f76f1b9d3058013e969f4f1c4 (patch) | |
tree | 0097417feef0aab446d1cae78b7a2ec2497df8b1 | |
parent | d1351f69d73dc44529c03edaa9557f3318b0212c (diff) | |
download | sparse-847eaf89b449661f76f1b9d3058013e969f4f1c4.tar.gz |
unqual: unqualify_type() should check for null ctypes
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>
-rw-r--r-- | evaluate.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |