bugfix: 'T = ref T' is an illegal recursive type

This commit is contained in:
Araq 2014-10-02 16:15:16 +02:00
commit 279e897eab
5 changed files with 9 additions and 3 deletions

View file

@ -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)