* close #11142 * fix #12636 * undo unwanted changes * fix illegal recursion case
This commit is contained in:
parent
3aab6a409d
commit
3af7818af4
2 changed files with 19 additions and 3 deletions
|
|
@ -258,12 +258,16 @@ proc computeSizeAlign(conf: ConfigRef; typ: PType) =
|
|||
|
||||
of tyArray:
|
||||
computeSizeAlign(conf, typ[1])
|
||||
let elemSize = typ[1].size
|
||||
let elemSize = typ[1].size
|
||||
let len = lengthOrd(conf, typ[0])
|
||||
if elemSize < 0:
|
||||
typ.size = elemSize
|
||||
typ.align = int16(elemSize)
|
||||
elif len < 0:
|
||||
typ.size = szUnknownSize
|
||||
typ.align = szUnknownSize
|
||||
else:
|
||||
typ.size = toInt64Checked(lengthOrd(conf, typ[0]) * int32(elemSize), szTooBigSize)
|
||||
typ.size = toInt64Checked(len * int32(elemSize), szTooBigSize)
|
||||
typ.align = typ[1].align
|
||||
|
||||
of tyUncheckedArray:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue