diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index 5ff514de..472c28fc 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -6652,6 +6652,10 @@ static void statement(int *lastindent,int allow_decl) } if (is_decl) { + if (!allow_decl) { + error(3); + return; + } lexpush(); autozero = TRUE; lastst = tNEW; diff --git a/sourcepawn/compiler/tests/fail-missing-arg-comma.sp b/sourcepawn/compiler/tests/fail-missing-arg-comma.sp new file mode 100644 index 00000000..9e56d2a3 --- /dev/null +++ b/sourcepawn/compiler/tests/fail-missing-arg-comma.sp @@ -0,0 +1,4 @@ +stock void Function( float array1[ 3 ] float array2[ 3 ] ) +{ + +} diff --git a/sourcepawn/compiler/tests/fail-missing-arg-comma.txt b/sourcepawn/compiler/tests/fail-missing-arg-comma.txt new file mode 100644 index 00000000..418e8963 --- /dev/null +++ b/sourcepawn/compiler/tests/fail-missing-arg-comma.txt @@ -0,0 +1 @@ +(1) : error 001: expected token: ")", but found "-identifier-"