Fixes multiple bugs with sink arguments (#9802)

* fixes #9781

* fix spacing
This commit is contained in:
cooldome 2018-11-26 08:45:45 +00:00 • committed by Andreas Rumpf
commit 2ac7f52388
4 changed files with 59 additions and 11 deletions

View file

@ -237,9 +237,9 @@ proc computeSizeAlign(conf: ConfigRef; typ: PType) =
# recursive tuplers are not allowed and should be detected in the frontend
if base.kind == tyTuple:
computeSizeAlign(conf, base)
if base.size == szIllegalRecursion:
typ.size = szIllegalRecursion
typ.align = szIllegalRecursion
if base.size < 0:
typ.size = base.size
typ.align = base.align
return
typ.align = int16(conf.target.ptrSize)
@ -379,7 +379,7 @@ proc computeSizeAlign(conf: ConfigRef; typ: PType) =
typ.size = typ.lastSon.size
typ.align = typ.lastSon.align
of tyGenericInst, tyDistinct, tyGenericBody, tyAlias:
of tyGenericInst, tyDistinct, tyGenericBody, tyAlias, tySink:
computeSizeAlign(conf, typ.lastSon)
typ.size = typ.lastSon.size
typ.align = typ.lastSon.align