diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2014-04-15 13:53:02 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2014-04-15 13:53:02 +0100 |
commit | 9e7c0fd2b03285636ad4faf35dadb1f289aeeeff (patch) | |
tree | 45504b0ada0089c5ede70ebc5304e66aa01f2ef9 /compiler/ccgexprs.nim | |
parent | 21d0cc8cdf432b0eaf0bd6ea16d00070ab9dab89 (diff) | |
download | Nim-9e7c0fd2b03285636ad4faf35dadb1f289aeeeff.tar.gz |
Fixes #1005
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r-- | compiler/ccgexprs.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index e346e1b53..7c4cc2b80 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -1060,6 +1060,8 @@ proc genObjConstr(p: BProc, e: PNode, d: var TLoc) = t = t.sons[0].skipTypes(abstractInst) r = ropef("(*$1)", r) gcUsage(e) + else: + constructLoc(p, tmp) discard getTypeDesc(p.module, t) for i in 1 .. <e.len: let it = e.sons[i] @@ -1082,6 +1084,7 @@ proc genObjConstr(p: BProc, e: PNode, d: var TLoc) = tmp2.s = if isRef: OnHeap else: OnStack tmp2.heapRoot = tmp.r expr(p, it.sons[1], tmp2) + if d.k == locNone: d = tmp else: |