aboutsummaryrefslogtreecommitdiff
path: root/type.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-03 23:22:51 -0700
committerMichael Forney <mforney@mforney.org>2019-04-03 23:22:51 -0700
commit2d036a019aa2879b092a17b740de3009d7352f74 (patch)
treeab89f5a3af54a635d132099ebf663b157f408bce /type.c
parent385d7b257acf087e02114c619beee07f2b49cb41 (diff)
Error on bit-field access for now
Diffstat (limited to 'type.c')
-rw-r--r--type.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/type.c b/type.c
index 8189ca1..43c74cd 100644
--- a/type.c
+++ b/type.c
@@ -296,23 +296,23 @@ typecommonreal(struct type *t1, struct type *t2)
fatal("internal error; could not find common real type");
}
-struct type *
+struct member *
typemember(struct type *t, const char *name, uint64_t *offset)
{
- struct member *m;
+ struct member *m, *sub;
assert(t->kind == TYPESTRUCT || t->kind == TYPEUNION);
for (m = t->structunion.members; m; m = m->next) {
if (m->name) {
if (strcmp(m->name, name) == 0) {
*offset += m->offset;
- return m->type;
+ return m;
}
} else {
- t = typemember(m->type, name, offset);
- if (t) {
+ sub = typemember(m->type, name, offset);
+ if (sub) {
*offset += m->offset;
- return t;
+ return sub;
}
}
}