aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/alg.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2022-06-14 13:38:02 -0700
committerKeith Randall <khr@google.com>2022-06-14 23:22:11 +0000
commite1e66a03a6bb3210034b640923fa253d7def1a26 (patch)
tree03dea7b25888433788a5ec80d8cd3cd083a6d96a /src/runtime/alg.go
parentcb9bf93078c54187f5be9d8a65c81c249d12d3c5 (diff)
downloadgo-e1e66a03a6bb3210034b640923fa253d7def1a26.tar.xz
cmd/compile,runtime,reflect: move embedded bit from offset to name
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>
Diffstat (limited to 'src/runtime/alg.go')
-rw-r--r--src/runtime/alg.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/alg.go b/src/runtime/alg.go
index 5d7d1c77f4..2a413eeef3 100644
--- a/src/runtime/alg.go
+++ b/src/runtime/alg.go
@@ -182,7 +182,7 @@ func typehash(t *_type, p unsafe.Pointer, h uintptr) uintptr {
if f.name.isBlank() {
continue
}
- h = typehash(f.typ, add(p, f.offset()), h)
+ h = typehash(f.typ, add(p, f.offset), h)
}
return h
default: