]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/gc: fix Offsetof computation.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Fri, 5 Apr 2013 19:24:07 +0000 (21:24 +0200)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Fri, 5 Apr 2013 19:24:07 +0000 (21:24 +0200)
commit2d3216f4a860c74eb1973ad08c782cf30363b88b
tree26bcc868b5cfbeb8c2150f98dc61852f6e4aebab
parent03048ae454131e5274161c6dbe044a5f30a263db
cmd/gc: fix Offsetof computation.

The offset of an embedded field s.X must be relative to s
and not to the implicit s.Field of which X is a direct field.
Moreover, no indirections may happen on the path.

Fixes #4909.

R=nigeltao, ality, daniel.morsing, iant, gri, r
CC=golang-dev
https://golang.org/cl/8287043
src/cmd/gc/unsafe.c
test/fixedbugs/issue4909a.go [new file with mode: 0644]
test/fixedbugs/issue4909b.go [new file with mode: 0644]
test/sizeof.go