aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-18 17:18:28 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-18 21:57:59 +0100
commit847eaf89b449661f76f1b9d3058013e969f4f1c4 (patch)
tree0097417feef0aab446d1cae78b7a2ec2497df8b1
parentd1351f69d73dc44529c03edaa9557f3318b0212c (diff)
downloadsparse-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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/evaluate.c b/evaluate.c
index c39f9ec7..fd84205c 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);