aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/checkptr.go
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2023-01-20 16:41:57 -0500
committerDavid Chase <drchase@google.com>2023-05-05 14:59:28 +0000
commitbdc6ae579aa86d21183c612c8c37916f397afaa8 (patch)
treecc63ff843ab5a7f3c196c8fa2c74924bfee61d93 /src/runtime/checkptr.go
parentdace96b9a12905b34af609eedaa6b43e30e7cdb1 (diff)
downloadgo-bdc6ae579aa86d21183c612c8c37916f397afaa8.tar.xz
internal/abi: refactor (basic) type struct into one definition
This touches a lot of files, which is bad, but it is also good, since there's N copies of this information commoned into 1. The new files in internal/abi are copied from the end of the stack; ultimately this will all end up being used. Change-Id: Ia252c0055aaa72ca569411ef9f9e96e3d610889e Reviewed-on: https://go-review.googlesource.com/c/go/+/462995 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/checkptr.go')
-rw-r--r--src/runtime/checkptr.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/checkptr.go b/src/runtime/checkptr.go
index 2d4afd5cf6..3c49645a44 100644
--- a/src/runtime/checkptr.go
+++ b/src/runtime/checkptr.go
@@ -16,13 +16,13 @@ func checkptrAlignment(p unsafe.Pointer, elem *_type, n uintptr) {
// Note that we allow unaligned pointers if the types they point to contain
// no pointers themselves. See issue 37298.
// TODO(mdempsky): What about fieldAlign?
- if elem.ptrdata != 0 && uintptr(p)&(uintptr(elem.align)-1) != 0 {
+ if elem.PtrBytes != 0 && uintptr(p)&(uintptr(elem.Align_)-1) != 0 {
throw("checkptr: misaligned pointer conversion")
}
// Check that (*[n]elem)(p) doesn't straddle multiple heap objects.
// TODO(mdempsky): Fix #46938 so we don't need to worry about overflow here.
- if checkptrStraddles(p, n*elem.size) {
+ if checkptrStraddles(p, n*elem.Size_) {
throw("checkptr: converted pointer straddles multiple allocations")
}
}