diff options
-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 be04cee9e..2492eebae 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2324,7 +2324,10 @@ proc genMove(p: BProc; n: PNode; d: var TLoc) = s = "$1, $1Len_0" % [rdLoc(a)] linefmt(p, cpsStmts, "$1($2);$n", [rdLoc(b), s]) else: - linefmt(p, cpsStmts, "$1($2);$n", [rdLoc(b), byRefLoc(p, a)]) + if p.module.compileToCpp: + linefmt(p, cpsStmts, "$1($2);$n", [rdLoc(b), rdLoc(a)]) + else: + linefmt(p, cpsStmts, "$1($2);$n", [rdLoc(b), byRefLoc(p, a)]) else: let flags = if not canMove(p, n[1], d): {needToCopy} else: {} genAssignment(p, d, a, flags) |