fixes yet another index out of bounds issue in renderer.nim

This commit is contained in:
Andreas Rumpf
2018-05-21 19:53:52 +02:00
parent cb6a4ffa86
commit e55a1051ea

View File

@@ -811,8 +811,8 @@ proc gident(g: var TSrcGen, n: PNode) =
var t: TTokType
var s = atom(g, n)
if (s[0] in lexer.SymChars):
if (n.kind == nkIdent):
if s.len > 0 and s[0] in lexer.SymChars:
if n.kind == nkIdent:
if (n.ident.id < ord(tokKeywordLow) - ord(tkSymbol)) or
(n.ident.id > ord(tokKeywordHigh) - ord(tkSymbol)):
t = tkSymbol