summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-04-04 08:19:02 +0200
committerAraq <rumpf_a@web.de>2014-04-04 08:19:02 +0200
commit6a055990f90ef943cb8f6f0ae73c2a011009f939 (patch)
tree8981b43a02d2cbd757ed7792159851f3dba82cce /compiler
parent160933f9def1467db4449ab078d0f2d662504cc8 (diff)
downloadNim-6a055990f90ef943cb8f6f0ae73c2a011009f939.tar.gz
minor VM bugfix
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)