From 2a99eecdb68526ea8e28892e9e2d927cfbb403d3 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 21 Jul 2014 23:01:35 -0700 Subject: [PATCH] Fix bug in variadic argument parsing. --- sourcepawn/compiler/sc1.c | 2 +- sourcepawn/compiler/tests/ok-varargs.sp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 sourcepawn/compiler/tests/ok-varargs.sp diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index 67084c39..52b7ee05 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -3395,7 +3395,7 @@ int parse_decl(declinfo_t *decl, int flags) decl->type.size = 1; // Match early varargs as old decl. - if (matchtoken(tELLIPS)) + if (lexpeek(tELLIPS)) return parse_old_decl(decl, flags); // Must attempt to match const first, since it's a common prefix. diff --git a/sourcepawn/compiler/tests/ok-varargs.sp b/sourcepawn/compiler/tests/ok-varargs.sp new file mode 100644 index 00000000..8361c066 --- /dev/null +++ b/sourcepawn/compiler/tests/ok-varargs.sp @@ -0,0 +1,7 @@ +stock MyFormat( const String:formatString[], ... ) +{ +} + +public main() +{ +}