From e55a1051eaee1833f60e8da317075e2654070057 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 21 May 2018 19:53:52 +0200 Subject: [PATCH] fixes yet another index out of bounds issue in renderer.nim --- compiler/renderer.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 75c19a1638..53e16edd20 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