summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-08-04 16:56:35 +0200
committerAraq <rumpf_a@web.de>2018-08-04 16:56:35 +0200
commitf131867de79a2cdf8fe7e5cd5106dbcc86aa3284 (patch)
tree7bb039ad0b923a271f74496633055e2e9815322d /compiler
parent9235f7a3b39704a1a2e93602971e38bd93d80f3e (diff)
downloadNim-f131867de79a2cdf8fe7e5cd5106dbcc86aa3284.tar.gz
emit the write barrier also for addChar
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 4fa7dc2ca..3bcf2c29b 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1858,7 +1858,13 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
         getTypeDesc(p.module, ranged), res])
 
   of mConStrStr: genStrConcat(p, e, d)
-  of mAppendStrCh: binaryStmt(p, e, d, "$1 = #addChar($1, $2);$n")
+  of mAppendStrCh:
+    var dest, b, call: TLoc
+    initLoc(call, locCall, e, OnHeap)
+    initLocExpr(p, e.sons[1], dest)
+    initLocExpr(p, e.sons[2], b)
+    call.r = ropecg(p.module, "#addChar($1, $2)", [rdLoc(dest), rdLoc(b)])
+    genAssignment(p, dest, call, {})
   of mAppendStrStr: genStrAppend(p, e, d)
   of mAppendSeqElem: genSeqElemAppend(p, e, d)
   of mEqStr: genStrEquals(p, e, d)