Skip to content

Commit

Permalink
fix crash due to errant symbols in nim.cfg (#13073) [backport]
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek authored and Araq committed Jan 8, 2020
1 parent 5e9ebe9 commit 56fb909
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/nimconf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 56fb909

Please sign in to comment.