diff options
Diffstat (limited to 'libgo/go/runtime/checkptr.go')
-rw-r--r-- | libgo/go/runtime/checkptr.go | 8 |
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 |