gotypes: fix argument size for signatures without return types (#212)

This fixes a bug in argument size calculation in the case where the function
has no return values. Previously it was padding the argument struct to max
alignment, but this only happens if there are return values following.

Updates #191
This commit is contained in:
Michael McLoughlin
2021-10-30 13:32:25 -07:00
committed by GitHub
parent e70c62b254
commit 7de02518a2
7 changed files with 61 additions and 5 deletions

View File

@@ -159,6 +159,7 @@ func TestSignatureSizes(t *testing.T) {
{"func(uint64) uint64", 16},
{"func([7]byte) byte", 9},
{"func(uint64, uint64) (uint64, uint64)", 32},
{"func(uint16)", 2},
}
for _, c := range cases {
s, err := ParseSignature(c.Expr)