Merge pull request #3368 from kirbyfan64/set_crash_fix

Fix #3367
This commit is contained in:
Andreas Rumpf 2015-09-24 15:59:30 +02:00
commit 683e1e8faf

View file

@ -1265,6 +1265,9 @@ proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt =
else: result = 8 else: result = 8
a = result a = result
of tySet: of tySet:
if typ.sons[0].kind == tyGenericParam:
result = szUnknownSize
else:
length = lengthOrd(typ.sons[0]) length = lengthOrd(typ.sons[0])
if length <= 8: result = 1 if length <= 8: result = 1
elif length <= 16: result = 2 elif length <= 16: result = 2