fixes #10845
This commit is contained in:
parent
16355de5eb
commit
8e5c1436ad
1 changed files with 20 additions and 15 deletions
|
|
@ -116,6 +116,11 @@ proc newOwnedString(src: NimString; n: int): NimString =
|
||||||
|
|
||||||
proc copyStringRC1(src: NimString): NimString {.compilerRtl.} =
|
proc copyStringRC1(src: NimString): NimString {.compilerRtl.} =
|
||||||
if src != nil:
|
if src != nil:
|
||||||
|
if (src.reserved and seqShallowFlag) != 0:
|
||||||
|
result = src
|
||||||
|
when declared(incRef):
|
||||||
|
incRef(usrToCell(result))
|
||||||
|
else:
|
||||||
when declared(newObjRC1) and not defined(gcRegions):
|
when declared(newObjRC1) and not defined(gcRegions):
|
||||||
var s = src.len
|
var s = src.len
|
||||||
if s < 7: s = 7
|
if s < 7: s = 7
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue