aboutsummaryrefslogtreecommitdiff
path: root/decl.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-15 23:19:41 -0700
committerMichael Forney <mforney@mforney.org>2019-04-15 23:19:41 -0700
commitafec5b75259f1a1110ef4a0df6c697f9b999d265 (patch)
tree576009632dc555fcb90999778d93e736ea17d448 /decl.c
parent098957b65500aa13005c540cf33a6e28c71cb153 (diff)
Silence gcc warning
Diffstat (limited to 'decl.c')
-rw-r--r--decl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/decl.c b/decl.c
index 0483a59..f137533 100644
--- a/decl.c
+++ b/decl.c
@@ -656,6 +656,8 @@ addmember(struct structbuilder *b, struct qualtype mt, char *name, int align, ui
m->next = NULL;
*b->last = m;
b->last = &m->next;
+ } else {
+ m = NULL;
}
if (width == -1) {
m->bits.before = 0;
@@ -687,7 +689,7 @@ addmember(struct structbuilder *b, struct qualtype mt, char *name, int align, ui
t->size = end;
b->bits = 0;
}
- if (name) {
+ if (m) {
m->offset = ALIGNDOWN(t->size - !!b->bits, mt.type->size);
m->bits.before = (t->size - m->offset) * 8 - b->bits;
m->bits.after = mt.type->size * 8 - width - m->bits.before;