aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--expr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/expr.c b/expr.c
index f8b2c05..186e30e 100644
--- a/expr.c
+++ b/expr.c
@@ -395,7 +395,7 @@ static struct expr *condexpr(struct scope *);
static struct expr *
builtinfunc(struct scope *s, enum builtinkind kind)
{
- struct expr *e;
+ struct expr *e, *param;
struct type *t;
char *name;
uint64_t offset;
@@ -458,7 +458,10 @@ builtinfunc(struct scope *s, enum builtinkind kind)
e->builtin.kind = BUILTINVASTART;
e->builtin.arg = exprconvert(assignexpr(s), &typevalistptr);
expect(TCOMMA, "after va_list");
- free(expect(TIDENT, "after ','"));
+ param = assignexpr(s);
+ if (param->kind != EXPRIDENT)
+ error(&tok.loc, "expected parameter identifier");
+ delexpr(param);
// XXX: check that this was actually a parameter name?
break;
default: