diff options
| author | Christopher Li <sparse@chrisli.org> | 2014-07-15 23:20:09 -0700 |
|---|---|---|
| committer | Christopher Li <sparse@chrisli.org> | 2014-07-17 08:58:28 -0700 |
| commit | 09e7a493cf3d92a6ccd7611b69bd41cb5727f765 (patch) | |
| tree | a8e8f1e972bb06bbea3ee5d44ddb6ae38d99fb1f /evaluate.c | |
| parent | b3e9d87c6a98bde0c95bc8badfde75c06661738b (diff) | |
| download | sparse-dev-09e7a493cf3d92a6ccd7611b69bd41cb5727f765.tar.gz | |
round up the array element size to byte align
When layout the array element, the element size should
round up to byte align.
Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'evaluate.c')
| -rw-r--r-- | evaluate.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2302,7 +2302,7 @@ static struct expression *check_designators(struct expression *e, } type = ctype->ctype.base_type; if (ctype->bit_size >= 0 && type->bit_size >= 0) { - unsigned offset = e->idx_to * type->bit_size; + unsigned offset = array_element_offset(type->bit_size, e->idx_to); if (offset >= ctype->bit_size) { err = "index out of bounds in"; break; |
