aboutsummaryrefslogtreecommitdiff
path: root/qbe.c
diff options
context:
space:
mode:
Diffstat (limited to 'qbe.c')
-rw-r--r--qbe.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/qbe.c b/qbe.c
index 4332b9c..4ff9c28 100644
--- a/qbe.c
+++ b/qbe.c
@@ -886,12 +886,13 @@ funcinit(struct function *func, struct declaration *d, struct initializer *init)
dst = funcinst(func, IADD, &iptr, (struct value *[]){d->value, mkintconst(&iptr, init->start + i)});
funcinst(func, ISTOREB, NULL, (struct value *[]){mkintconst(&i8, init->expr->string.data[i]), dst});
}
+ offset += i;
} else {
dst = funcinst(func, IADD, &iptr, (struct value *[]){d->value, mkintconst(&iptr, init->start)});
src = funcexpr(func, init->expr);
funcstore(func, init->expr->type, dst, src);
+ offset = init->end;
}
- offset = init->end;
}
zero(func, d->value, d->type->align, offset, d->type->size);
}