Browse Source

update minic for new vararg support

We conservatively assume all functions have
variable argument lists.
Quentin Carbonneaux 8 years ago
parent
commit
b698584443
1 changed files with 6 additions and 12 deletions
  1. 6 12
      minic/minic.y

+ 6 - 12
minic/minic.y

@@ -290,18 +290,12 @@ call(Node *n, Symb *sr)
 	fprintf(of, "\t");
 	psymb(*sr);
 	fprintf(of, " =%c call $%s(", irtyp(sr->ctyp), f);
-	a = n->r;
-	if (a)
-		for (;;) {
-			fprintf(of, "%c ", irtyp(a->u.s.ctyp));
-			psymb(a->u.s);
-			a = a->r;
-			if (a)
-				fprintf(of, ", ");
-			else
-				break;
-		}
-	fprintf(of, ")\n");
+	for (a=n->r; a; a=a->r) {
+		fprintf(of, "%c ", irtyp(a->u.s.ctyp));
+		psymb(a->u.s);
+		fprintf(of, ", ");
+	}
+	fprintf(of, "...)\n");
 }
 
 Symb