Skip to content

Commit

Permalink
Fixed codegen for constant cstring with --gc:arc, fixes nim-lang#13321
Browse files Browse the repository at this point in the history
  • Loading branch information
zevv committed Feb 4, 2020
1 parent 1ab37cc commit f24f5a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/ccgexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f24f5a3

Please sign in to comment.