forward type alignment information to seqs (#12430)
This commit is contained in:
parent
a8f030fea2
commit
4005f0d0e4
25 changed files with 152 additions and 114 deletions
|
|
@ -172,7 +172,7 @@ when not defined(useNimRtl):
|
|||
|
||||
template payloadPtr(x: untyped): untyped = cast[PGenericSeq](x).p
|
||||
else:
|
||||
const payloadOffset = GenericSeqSize
|
||||
const payloadOffset = GenericSeqSize ## the payload offset always depends on the alignment of the member type.
|
||||
template payloadPtr(x: untyped): untyped = x
|
||||
|
||||
proc reprSequence(result: var string, p: pointer, typ: PNimType,
|
||||
|
|
@ -185,7 +185,7 @@ when not defined(useNimRtl):
|
|||
var bs = typ.base.size
|
||||
for i in 0..cast[PGenericSeq](p).len-1:
|
||||
if i > 0: add result, ", "
|
||||
reprAux(result, cast[pointer](cast[ByteAddress](payloadPtr(p)) + payloadOffset + i*bs),
|
||||
reprAux(result, cast[pointer](cast[ByteAddress](payloadPtr(p)) + align(payloadOffset, typ.align) + i*bs),
|
||||
typ.base, cl)
|
||||
add result, "]"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue