aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorChristopher Li <sparse@chrisli.org>2014-10-25 17:05:52 +0800
committerChristopher Li <sparse@chrisli.org>2014-10-25 17:10:13 +0800
commitc1c3f969fbd0d05ad24ab037defde500e7b3c77a (patch)
treeb238a3844066d19e43ff21de91bdc00836718589
parent71e642abf7129b553521df8dddf4511383016a78 (diff)
downloadsparse-dev-c1c3f969fbd0d05ad24ab037defde500e7b3c77a.tar.gz
teach next_designators() use array_element_offset()
I miss a spot when converting array size caculation using array_element_offet(). "next_designators()" is still using "n*bit_size" to caculate the element offset. It is wrong for the case of bool array. Signed-off-by: Christopher Li <sparse@chrisli.org>
-rw-r--r--evaluate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/evaluate.c b/evaluate.c
index 7bd47e66..035e4487 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -2380,7 +2380,7 @@ static struct expression *next_designators(struct expression *old,
old->ctype, e, v);
if (!copy) {
n = old->idx_to + 1;
- if (n * old->ctype->bit_size == ctype->bit_size) {
+ if (array_element_offset(old->ctype->bit_size, n) == ctype->bit_size) {
convert_index(old);
return NULL;
}