From 65587f726e39af1c8e84c927db8ac26403f02d27 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 14 Aug 2014 03:02:36 +0200 Subject: [PATCH] fixes #1433 --- compiler/vmgen.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index fd0c3fc69..adbca8cca 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -1093,6 +1093,8 @@ proc setSlot(c: PCtx; v: PSym) = # XXX generate type initialization here? if v.position == 0: if c.prc.maxSlots == 0: c.prc.maxSlots = 1 + if c.prc.maxSlots >= high(TRegister): + internalError(v.info, "cannot generate code; too many registers required") v.position = c.prc.maxSlots c.prc.slots[v.position] = (inUse: true, kind: if v.kind == skLet: slotFixedLet else: slotFixedVar)