From 919e859a6de590955b70efe35d7419bfad0fc981 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 10 Jul 2014 23:18:07 -0700 Subject: [PATCH] Fix "static stock" not working (bug 6174). --- sourcepawn/compiler/sc1.c | 3 +++ sourcepawn/compiler/tests/ok-static-stock.sp | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 sourcepawn/compiler/tests/ok-static-stock.sp diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index 5ff514de..2a90ee79 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -1488,6 +1488,9 @@ static void dodecl(const token_t *tok) int fstock = (tok->id == tSTOCK); int fstatic = (tok->id == tSTATIC); + if (fstatic && matchtoken(tSTOCK)) + fstock = TRUE; + int flags = DECLFLAG_MAYBE_FUNCTION | DECLFLAG_VARIABLE | DECLFLAG_ENUMROOT; if (tok->id == tNEW) flags |= DECLFLAG_OLD; diff --git a/sourcepawn/compiler/tests/ok-static-stock.sp b/sourcepawn/compiler/tests/ok-static-stock.sp new file mode 100644 index 00000000..73516697 --- /dev/null +++ b/sourcepawn/compiler/tests/ok-static-stock.sp @@ -0,0 +1,13 @@ +static stock Blah() +{ +} + +static stock void Blah2() +{ +} + +public main() +{ + Blah(); + Blah2(); +}