From 92255bcdc3e2713d15833dffa008acaf7c35c6bc Mon Sep 17 00:00:00 2001 From: Arkshine Date: Thu, 14 Aug 2014 17:39:54 +0200 Subject: [PATCH] Compiler: Fix crash when using tagof(tagname:) Imported from SA-MP: https://github.com/Zeex/pawn/commit/53ef10ffc787545672af4118355ba340dd6b5e7c --- compiler/libpc300/sc3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/libpc300/sc3.c b/compiler/libpc300/sc3.c index a0ea94c3..bbd3e6fa 100755 --- a/compiler/libpc300/sc3.c +++ b/compiler/libpc300/sc3.c @@ -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++) {