diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 41078716b1..3a6d0ae650 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -864,7 +864,7 @@ proc gproc(g: var TSrcGen, n: PNode) = if renderNoPragmas notin g.flags: gsub(g, n[pragmasPos]) if renderNoBody notin g.flags: - if n[bodyPos].kind != nkEmpty: + if n.len > bodyPos and n[bodyPos].kind != nkEmpty: put(g, tkSpaces, Space) putWithSpace(g, tkEquals, "=") indentNL(g)