summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-03-17 20:11:16 +0100
committerAraq <rumpf_a@web.de>2013-03-17 20:11:16 +0100
commit6ed18a8b2488821df057d38fabb1d7cd921d97e7 (patch)
tree31c0036108f1f6b497b2aab3b2cf33ec49704147 /compiler/ccgexprs.nim
parent3703bb929b6214fa9fcafe32d03f7b0c46907e54 (diff)
downloadNim-6ed18a8b2488821df057d38fabb1d7cd921d97e7.tar.gz
fixes #366
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r--compiler/ccgexprs.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index a99654cbd..426f1b813 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1088,7 +1088,10 @@ proc genObjConstr(p: BProc, e: PNode, d: var TLoc) =
     tmp2.s = onHeap
     tmp2.heapRoot = tmp.r
     expr(p, it.sons[1], tmp2)
-  genAssignment(p, d, tmp, {})
+  if d.k == locNone:
+    d = tmp
+  else:
+    genAssignment(p, d, tmp, {})
   
 proc genSeqConstr(p: BProc, t: PNode, d: var TLoc) =
   var arr: TLoc