aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-08-09 02:13:29 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-08-09 02:13:29 +0200
commit2f2539bc481a1d3d4a79f7fc37d3b047ccbfb250 (patch)
tree12bf81d9b3dd2818841538a38b3916f819a8a60e
parent1bffdc1843a5a95bdc23f266dc17839cbf9d4916 (diff)
parent3bc32d46494c404df7905fceaca9156830ff97f1 (diff)
downloadsparse-2f2539bc481a1d3d4a79f7fc37d3b047ccbfb250.tar.gz
Merge branch 'check-void' into tip
* fix checking if type is void
-rw-r--r--evaluate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/evaluate.c b/evaluate.c
index 691435f3..63a9390b 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -3557,7 +3557,7 @@ static struct symbol *evaluate_return_expression(struct statement *stmt)
fntype = current_fn->ctype.base_type;
rettype = fntype->ctype.base_type;
if (!rettype || rettype == &void_ctype) {
- if (expr && expr->ctype != &void_ctype)
+ if (expr && !is_void_type(expr->ctype))
expression_error(expr, "return expression in %s function", rettype?"void":"typeless");
if (expr && Wreturn_void)
warning(stmt->pos, "returning void-valued expression");