bugfix: 'T = ref T' is an illegal recursive type
This commit is contained in:
parent
62ccf13529
commit
279e897eab
5 changed files with 9 additions and 3 deletions
|
|
@ -1208,8 +1208,9 @@ proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt =
|
|||
else: result = ptrSize
|
||||
a = ptrSize
|
||||
of tyNil, tyCString, tyString, tySequence, tyPtr, tyRef, tyVar, tyOpenArray,
|
||||
tyBigNum:
|
||||
result = ptrSize
|
||||
tyBigNum:
|
||||
if typ.lastSon == typ: result = szIllegalRecursion
|
||||
else: result = ptrSize
|
||||
a = result
|
||||
of tyArray, tyArrayConstr:
|
||||
let elemSize = computeSizeAux(typ.sons[1], a)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue