sys: fix StrConstType size and alignment

The current code is probably a leftover from times when
StrConstType itself implied an indirection (it was a pointer to the string).
Now strconst it is lowered to PtrType[StrConstType],
so its size is len of the string and align is 1.

It is not possible to test it now, as it is always used with indirection,
so static size and align do not affect struct layout.
This commit is contained in:
Dmitry Vyukov 2016-10-18 21:17:29 +02:00
parent 2569b613c4
commit 4ae183a783

View File

@ -232,11 +232,11 @@ type StrConstType struct {
}
func (t StrConstType) Size() uintptr {
return ptrSize
return uintptr(len(t.Val))
}
func (t StrConstType) Align() uintptr {
return t.Size()
return 1
}
func (t StrConstType) InnerType() Type {