diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-11-18 17:18:47 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-11-18 21:57:59 +0100 |
commit | a624f755195c4d69b4ad554ec0fe88e2e8efe70d (patch) | |
tree | 2545827e1a4af12d0c48b8d3203044cd17ffc140 | |
parent | 847eaf89b449661f76f1b9d3058013e969f4f1c4 (diff) | |
download | sparse-a624f755195c4d69b4ad554ec0fe88e2e8efe70d.tar.gz |
unqual: comma expressions should drop qualifiers
Comma expressions should be subjected to lvalue-conversion
and thus should drop qualifiers.
Fix this by calling unqualify_type() after array-to-pointer
conversion.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | evaluate.c | 2 | ||||
-rw-r--r-- | validation/eval/unqual-comma.c | 1 |
2 files changed, 1 insertions, 2 deletions
@@ -1028,7 +1028,7 @@ static struct symbol *evaluate_binop(struct expression *expr) static struct symbol *evaluate_comma(struct expression *expr) { - expr->ctype = degenerate(expr->right); + expr->ctype = unqualify_type(degenerate(expr->right)); if (expr->ctype == &null_ctype) expr->ctype = &ptr_ctype; expr->flags &= expr->left->flags & expr->right->flags; diff --git a/validation/eval/unqual-comma.c b/validation/eval/unqual-comma.c index e06586cd..11546d22 100644 --- a/validation/eval/unqual-comma.c +++ b/validation/eval/unqual-comma.c @@ -9,5 +9,4 @@ int *foo(volatile int x) /* * check-name: unqual-comma - * check-known-to-fail */ |