From dbee1bcd0839230aebceb94d36265de7ef7b3d58 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 8 Nov 2014 03:07:34 -0800 Subject: [PATCH] Add an error check after calling doexpr2(). --- sourcepawn/compiler/sc1.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sourcepawn/compiler/sc1.cpp b/sourcepawn/compiler/sc1.cpp index 13485f97..a4b9c279 100644 --- a/sourcepawn/compiler/sc1.cpp +++ b/sourcepawn/compiler/sc1.cpp @@ -2206,6 +2206,17 @@ static void declloc(int tokid) &type->idxtag[i], &child, 0, &val); pushreg(sPRI); + + switch (ident) { + case iVARIABLE: + case iEXPRESSION: + case iARRAYCELL: + case iCONSTEXPR: + break; + default: + error(29); + break; + } if (!needtoken(']')) break;