Fixed #1090
This commit is contained in:
parent
ca1c516295
commit
912ad820ee
1 changed files with 7 additions and 8 deletions
|
|
@ -1118,6 +1118,11 @@ proc typeAllowed(t: PType, kind: TSymKind): bool =
|
||||||
proc align(address, alignment: BiggestInt): BiggestInt =
|
proc align(address, alignment: BiggestInt): BiggestInt =
|
||||||
result = (address + (alignment - 1)) and not (alignment - 1)
|
result = (address + (alignment - 1)) and not (alignment - 1)
|
||||||
|
|
||||||
|
const
|
||||||
|
szNonConcreteType* = -3
|
||||||
|
szIllegalRecursion* = -2
|
||||||
|
szUnknownSize* = -1
|
||||||
|
|
||||||
proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt
|
proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt
|
||||||
proc computeRecSizeAux(n: PNode, a, currOffset: var BiggestInt): BiggestInt =
|
proc computeRecSizeAux(n: PNode, a, currOffset: var BiggestInt): BiggestInt =
|
||||||
var maxAlign, maxSize, b, res: BiggestInt
|
var maxAlign, maxSize, b, res: BiggestInt
|
||||||
|
|
@ -1152,14 +1157,8 @@ proc computeRecSizeAux(n: PNode, a, currOffset: var BiggestInt): BiggestInt =
|
||||||
result = computeSizeAux(n.sym.typ, a)
|
result = computeSizeAux(n.sym.typ, a)
|
||||||
n.sym.offset = int(currOffset)
|
n.sym.offset = int(currOffset)
|
||||||
else:
|
else:
|
||||||
# internalError("computeRecSizeAux()")
|
|
||||||
n.debug
|
|
||||||
a = 1
|
a = 1
|
||||||
result = - 2
|
result = szNonConcreteType
|
||||||
|
|
||||||
const
|
|
||||||
szIllegalRecursion* = -2
|
|
||||||
szUnknownSize* = -1
|
|
||||||
|
|
||||||
proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt =
|
proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt =
|
||||||
var res, maxAlign, length, currOffset: BiggestInt
|
var res, maxAlign, length, currOffset: BiggestInt
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue