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

(cherry picked from commit 56fb909676)
This commit is contained in:
Andy Davidoff
2020-01-08 16:25:25 -05:00
committed by narimiran
parent 4028514eeb
commit e636b47429

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