diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-05-21 19:53:52 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-05-21 19:53:52 +0200 |
commit | e55a1051eaee1833f60e8da317075e2654070057 (patch) | |
tree | 1b003c9010951d8ef002fd40e17efefbf1630034 | |
parent | cb6a4ffa865850b254680e47bf04817727e20558 (diff) | |
download | Nim-e55a1051eaee1833f60e8da317075e2654070057.tar.gz |
fixes yet another index out of bounds issue in renderer.nim
-rw-r--r-- | compiler/renderer.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 75c19a163..53e16edd2 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -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 |