aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/checkptr.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-07-27 22:27:54 -0700
committerIan Lance Taylor <iant@golang.org>2020-08-01 11:21:40 -0700
commitf75af8c1464e948b5e166cf5ab09ebf0d82fc253 (patch)
tree3ba3299859b504bdeb477727471216bd094a0191 /libgo/go/runtime/checkptr.go
parent75a23e59031fe673fc3b2e60fd1fe5f4c70ecb85 (diff)
downloadgcc-f75af8c1464e948b5e166cf5ab09ebf0d82fc253.zip
gcc-f75af8c1464e948b5e166cf5ab09ebf0d82fc253.tar.gz
gcc-f75af8c1464e948b5e166cf5ab09ebf0d82fc253.tar.bz2
libgo: update to go1.15rc1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/245157
Diffstat (limited to 'libgo/go/runtime/checkptr.go')
-rw-r--r--libgo/go/runtime/checkptr.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/libgo/go/runtime/checkptr.go b/libgo/go/runtime/checkptr.go
index d5f116c..e52f7df 100644
--- a/libgo/go/runtime/checkptr.go
+++ b/libgo/go/runtime/checkptr.go
@@ -14,18 +14,18 @@ func checkptrAlignment(p unsafe.Pointer, elem *_type, n uintptr) {
// no pointers themselves. See issue 37298.
// TODO(mdempsky): What about fieldAlign?
if elem.ptrdata != 0 && uintptr(p)&(uintptr(elem.align)-1) != 0 {
- throw("checkptr: unsafe pointer conversion")
+ throw("checkptr: misaligned pointer conversion")
}
// Check that (*[n]elem)(p) doesn't straddle multiple heap objects.
if size := n * elem.size; size > 1 && checkptrBase(p) != checkptrBase(add(p, size-1)) {
- throw("checkptr: unsafe pointer conversion")
+ throw("checkptr: converted pointer straddles multiple allocations")
}
}
func checkptrArithmetic(p unsafe.Pointer, originals []unsafe.Pointer) {
if 0 < uintptr(p) && uintptr(p) < minLegalPointer {
- throw("checkptr: unsafe pointer arithmetic")
+ throw("checkptr: pointer arithmetic computed bad pointer value")
}
// Check that if the computed pointer p points into a heap
@@ -42,7 +42,7 @@ func checkptrArithmetic(p unsafe.Pointer, originals []unsafe.Pointer) {
}
}
- throw("checkptr: unsafe pointer arithmetic")
+ throw("checkptr: pointer arithmetic result points to invalid allocation")
}
// checkptrBase returns the base address for the allocation containing