diff -r d467a6526f8d -r c3f26df2183f sourcepawn/compiler/sc2.c --- a/sourcepawn/compiler/sc2.c Thu Jul 18 15:50:50 2013 -0400 +++ b/sourcepawn/compiler/sc2.c Thu Jul 18 15:50:57 2013 -0400 @@ -416,7 +416,7 @@ #if !defined SC_LIGHT /* collect the comment characters in a string */ if (icomment==2) { - if (skipstar && (*line!='\0' && *line<=' ' || *line=='*')) { + if (skipstar && ((*line!='\0' && *line<=' ') || *line=='*')) { /* ignore leading whitespace and '*' characters */ } else if (commentidxident!=iFUNCTN && sym->ident!=iREFFUNC && (sym->usage & uDEFINE)==0) { + if (sym==NULL || (sym->ident!=iFUNCTN && sym->ident!=iREFFUNC && (sym->usage & uDEFINE)==0)) { error(17,str); /* undefined symbol */ } else { outval(sym->addr,FALSE); @@ -1668,7 +1668,7 @@ if (strncmp((char*)start,"defined",7)==0 && !isalpha((char)*(start+7))) { start+=7; /* skip "defined" */ /* skip white space & parantheses */ - while (*start<=' ' && *start!='\0' || *start=='(') + while ((*start<=' ' && *start!='\0') || *start=='(') start++; /* skip the symbol behind it */ while (alphanum(*start)) @@ -1974,7 +1974,7 @@ error(220); } /* if */ } /* if */ - } else if (*lptr=='\"' || *lptr==sc_ctrlchar && *(lptr+1)=='\"') + } else if (*lptr=='\"' || (*lptr==sc_ctrlchar && *(lptr+1)=='\"')) { /* unpacked string literal */ _lextok=tSTRING; stringflags= (*lptr==sc_ctrlchar) ? RAWMODE : 0; @@ -1988,9 +1988,9 @@ lptr+=1; /* skip final quote */ else error(37); /* invalid (non-terminated) string */ - } else if (*lptr=='!' && *(lptr+1)=='\"' - || *lptr=='!' && *(lptr+1)==sc_ctrlchar && *(lptr+2)=='\"' - || *lptr==sc_ctrlchar && *(lptr+1)=='!' && *(lptr+2)=='\"') + } else if ((*lptr=='!' && *(lptr+1)=='\"') + || (*lptr=='!' && *(lptr+1)==sc_ctrlchar && *(lptr+2)=='\"') + || (*lptr==sc_ctrlchar && *(lptr+1)=='!' && *(lptr+2)=='\"')) { /* packed string literal */ _lextok=tSTRING; stringflags= (*lptr==sc_ctrlchar || *(lptr+1)==sc_ctrlchar) ? RAWMODE : 0; @@ -2081,7 +2081,7 @@ int tok; tok=lex(&val,&str); - if (tok==token || token==tTERM && (tok==';' || tok==tENDEXPR)) { + if (tok==token || (token==tTERM && (tok==';' || tok==tENDEXPR))) { return 1; } else if (!sc_needsemicolon && token==tTERM && (_lexnewline || !freading)) { /* Push "tok" back, because it is the token following the implicit statement @@ -2555,8 +2555,8 @@ { assert(sym->states==NULL || sym->states->next!=NULL); /* first element of the state list is the "root" */ if (sym->ident==iFUNCTN - || automaton<0 && sym->states==NULL - || automaton>=0 && sym->states!=NULL && state_getfsa(sym->states->next->index)==automaton) + || (automaton<0 && sym->states==NULL) + || (automaton>=0 && sym->states!=NULL && state_getfsa(sym->states->next->index)==automaton)) { if (cmptag==NULL) return sym; /* return first match */ @@ -2785,8 +2785,8 @@ * the symbol without states if no symbol with states exists). */ assert(vclass!=sGLOBAL || (sym=findglb(name,sGLOBAL))==NULL || (sym->usage & uDEFINE)==0 - || sym->ident==iFUNCTN && sym==curfunc - || sym->states==NULL && sc_curstates>0); + || (sym->ident==iFUNCTN && sym==curfunc) + || (sym->states==NULL && sc_curstates>0)); if (ident==iARRAY || ident==iREFARRAY) { symbol *parent=NULL,*top;