summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
diff options
context:
space:
mode:
authorIco Doornekamp <ico@pruts.nl>2020-02-04 17:39:27 +0100
committerGitHub <noreply@github.com>2020-02-04 17:39:27 +0100
commitbfe96e069bbdfbbb7ee8979648abeaba233dfe19 (patch)
tree0149cc94797bfba2f94870c2120b075d29aa4c96 /compiler/ccgexprs.nim
parent7cc03b43f86eb521aca8347d267b9adc04db4259 (diff)
downloadNim-bfe96e069bbdfbbb7ee8979648abeaba233dfe19.tar.gz
Fixed codegen for constant cstring with --gc:arc (#13326)
* Fixed codegen for constant cstring with --gc:arc, fixes  #13321

* Added test for #13321
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r--compiler/ccgexprs.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 10b17663e..632e4bb31 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -2974,7 +2974,7 @@ proc genBracedInit(p: BProc, n: PNode; isConst: bool): Rope =
     of tyObject:
       result = genConstObjConstr(p, n, isConst)
     of tyString, tyCString:
-      if optSeqDestructors in p.config.globalOptions and n.kind != nkNilLit:
+      if optSeqDestructors in p.config.globalOptions and n.kind != nkNilLit and ty == tyString:
         result = genStringLiteralV2Const(p.module, n, isConst)
       else:
         var d: TLoc