diff options
author | Araq <rumpf_a@web.de> | 2013-03-17 20:11:16 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-03-17 20:11:16 +0100 |
commit | 6ed18a8b2488821df057d38fabb1d7cd921d97e7 (patch) | |
tree | 31c0036108f1f6b497b2aab3b2cf33ec49704147 /compiler | |
parent | 3703bb929b6214fa9fcafe32d03f7b0c46907e54 (diff) | |
download | Nim-6ed18a8b2488821df057d38fabb1d7cd921d97e7.tar.gz |
fixes #366
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgexprs.nim | 5 |
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 |