summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndy Davidoff <disruptek@users.noreply.github.com>2020-01-08 16:25:25 -0500
committerAndreas Rumpf <rumpf_a@web.de>2020-01-08 22:25:25 +0100
commit56fb9096761ad401675a2367ae3681c50b7ce485 (patch)
tree1f40cad406e41b253b4c869ca8080dbf058f5144
parent5e9ebe9ec1d1df62e3b1347bb7b8c9c8a08a3cc5 (diff)
downloadNim-56fb9096761ad401675a2367ae3681c50b7ce485.tar.gz
fix crash due to errant symbols in nim.cfg (#13073) [backport]
-rw-r--r--compiler/nimconf.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim
index 0818ddd0d..93cc21573 100644
--- a/compiler/nimconf.nim
+++ b/compiler/nimconf.nim
@@ -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