fix crash due to errant symbols in nim.cfg (#13073) [backport]

This commit is contained in:
Andy Davidoff 2020-01-08 16:25:25 -05:00 • committed by Andreas Rumpf
commit 56fb909676

View file

@ -160,8 +160,9 @@ proc checkSymbol(L: TLexer, tok: TToken) =
proc parseAssignment(L: var TLexer, tok: var TToken;
config: ConfigRef; condStack: var seq[bool]) =
if tok.ident.s == "-" or tok.ident.s == "--":
confTok(L, tok, config, condStack) # skip unnecessary prefix
if tok.ident != nil:
if tok.ident.s == "-" or tok.ident.s == "--":
confTok(L, tok, config, condStack) # skip unnecessary prefix
var info = getLineInfo(L, tok) # save for later in case of an error
checkSymbol(L, tok)
var s = $tok