You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On my machine, size is 0xfffffffffffffffc and ft.align is 8 for field B. 0xfffffffffffffffc + 0x7 is 0x10000000000000003 aka 0x0000000000000003 due to truncation / overflow.
The text was updated successfully, but these errors were encountered:
Previously we stole a bit from the field offset to encode whether
a struct field was embedded.
Instead, encode that bit in the name field, where we already have
some unused bits to play with. The bit associates naturally with
the name in any case.
This leaves a full uintptr to specify field offsets. This will make
the fix for #52740 cleaner.
Change-Id: I0bfb85564dc26e8c18101bc8b432f332176d7836
Reviewed-on: https://go-review.googlesource.com/c/go/+/412138
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?Darwin / amd64.
What did you do?
What did you expect to see?
I'd expect offsets to be correct or
StructOf
to panic.What did you see instead?
I think the problem lies in this call to align:
go/src/reflect/type.go
Line 2630 in f87e28d
On my machine,
size
is0xfffffffffffffffc
andft.align
is8
for fieldB
.0xfffffffffffffffc + 0x7
is0x10000000000000003
aka0x0000000000000003
due to truncation / overflow.The text was updated successfully, but these errors were encountered: