From b698584443f17b8d0cfd88e0afe037ce351e0ee6 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 7 Feb 2017 23:03:38 -0500 Subject: update minic for new vararg support We conservatively assume all functions have variable argument lists. --- minic/minic.y | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'minic') diff --git a/minic/minic.y b/minic/minic.y index 6b4150d..eeef900 100644 --- a/minic/minic.y +++ b/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 -- cgit 1.4.1