* Extend the fix for #11018 to strings * Fix testcase
This commit is contained in:
parent
a68c5662f2
commit
2f56dd6b2b
2 changed files with 10 additions and 2 deletions
|
|
@ -1839,7 +1839,7 @@ proc genSomeCast(p: BProc, e: PNode, d: var TLoc) =
|
|||
if srcTyp.kind in {tyPtr, tyPointer} and etyp.kind in IntegralTypes:
|
||||
putIntoDest(p, d, e, "(($1) (ptrdiff_t) ($2))" %
|
||||
[getTypeDesc(p.module, e.typ), rdCharLoc(a)], a.storage)
|
||||
elif p.config.selectedGc == gcDestructors and etyp.kind == tySequence:
|
||||
elif p.config.selectedGc == gcDestructors and etyp.kind in {tySequence, tyString}:
|
||||
putIntoDest(p, d, e, "(*($1*) (&$2))" %
|
||||
[getTypeDesc(p.module, e.typ), rdCharLoc(a)], a.storage)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue