aboutsummaryrefslogtreecommitdiff
path: root/qbe.c
diff options
context:
space:
mode:
Diffstat (limited to 'qbe.c')
-rw-r--r--qbe.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/qbe.c b/qbe.c
index 13643dc..e98e6fe 100644
--- a/qbe.c
+++ b/qbe.c
@@ -1219,8 +1219,11 @@ emitfunc(struct func *f, bool global)
putchar(' ');
emitvalue(v);
}
- if (f->type->u.func.isvararg)
- fputs(", ...", stdout);
+ if (f->type->u.func.isvararg) {
+ if (f->type->u.func.params)
+ fputs(", ", stdout);
+ fputs("...", stdout);
+ }
puts(") {");
for (b = f->start; b; b = b->next) {
emitvalue(&b->label);