aboutsummaryrefslogtreecommitdiff
path: root/type.c
diff options
context:
space:
mode:
Diffstat (limited to 'type.c')
-rw-r--r--type.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/type.c b/type.c
index db65088..89f4d0d 100644
--- a/type.c
+++ b/type.c
@@ -53,9 +53,11 @@ mkqualifiedtype(struct type *t, enum typequalifier tq)
if (tq) {
t = mktype(TYPEQUALIFIED, t);
t->qualified.kind = tq;
- t->size = t->base->size;
- t->align = t->base->align;
- t->repr = t->base->repr;
+ if (t->base) {
+ t->size = t->base->size;
+ t->align = t->base->align;
+ t->repr = t->base->repr;
+ }
// XXX: incomplete?
}
return t;