From 81b2ae747e307f4ab171d3b62a0e6ea8b6a81d3d Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Mon, 9 Oct 2023 21:36:56 +0800 Subject: fixes #8893; guard against array access in renderer (#22807) fixes #8893 --- compiler/renderer.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 41078716b..3a6d0ae65 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) -- cgit 1.4.1-2-gfad0