summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/vmgen.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index 85416f7bc..434cb0932 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -1034,6 +1034,7 @@ proc genAsgn(c: PCtx; dest: TDest; ri: PNode; requiresCopy: bool) =
 proc setSlot(c: PCtx; v: PSym) =
   # XXX generate type initialization here?
   if v.position == 0:
+    if c.prc.maxSlots == 0: c.prc.maxSlots = 1
     v.position = c.prc.maxSlots
     c.prc.slots[v.position] = (inUse: true,
         kind: if v.kind == skLet: slotFixedLet else: slotFixedVar)