Compiler: Fix crash when using tagof(tagname:)

Imported from SA-MP: 53ef10ffc7
This commit is contained in:
Arkshine 2014-08-14 17:39:54 +02:00
parent b2442a2268
commit 92255bcdc3

View File

@ -1129,6 +1129,7 @@ static int hier2(value *lval)
symbol *sym=NULL;
int saveresult;
sym = NULL;
tok=lex(&val,&st);
switch (tok) {
case tINC: /* ++lval */
@ -1293,7 +1294,7 @@ static int hier2(value *lval)
return error(17,st); /* undefined symbol (symbol is in the table, but it is "used" only) */
tag=sym->tag;
} /* if */
if (sym->ident==iARRAY || sym->ident==iREFARRAY) {
if (sym!=NULL && (sym->ident==iARRAY || sym->ident==iREFARRAY)) {
int level;
symbol *idxsym=NULL;
for (level=0; matchtoken('['); level++) {