aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/evaluate.c
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-03-22 15:38:49 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-03-22 18:24:41 +0100
commitb5867a33b62c04811784c6fc233c601a4f2b0841 (patch)
tree3aac0baf1179d23128b5b94aff5538a2fe7046b6 /evaluate.c
parent4480ef07d1187395ea8b277174ac2545254b40f0 (diff)
downloadsparse-b5867a33b62c04811784c6fc233c601a4f2b0841.tar.gz
fix evaluation of a function or array symbol in conditionals
Functions and arrays degenerate as pointers in most context but this wasn't done in the case of conditionals. As a result the value of the conditional after linearization was invalid. Fix this by calling degenerate() in evaluate_conditional(). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'evaluate.c')
-rw-r--r--evaluate.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/evaluate.c b/evaluate.c
index f2d95c79..97685791 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -881,6 +881,7 @@ static struct symbol *evaluate_conditional(struct expression *expr, int iterator
ctype = NULL;
}
}
+ ctype = degenerate(expr);
return ctype;
}