Fixed codegen for constant cstring with --gc:arc (#13326)
* Fixed codegen for constant cstring with --gc:arc, fixes #13321 * Added test for #13321
This commit is contained in:
parent
7cc03b43f8
commit
bfe96e069b
2 changed files with 17 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue