mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime/debug: provide Addr method for errors from SetPanicOnFault
When we're building a panic that's triggered by a memory fault when SetPanicOnFault has been called, include an Addr method. This method reports the address at which the fault occurred. Fixes #37023 RELNOTE=yes Change-Id: Idff144587d6b75070fdc861a36efec76f4ec7384 Reviewed-on: https://go-review.googlesource.com/c/go/+/249677 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Keith Randall <khr@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
65dfe4a772
commit
d91d0762c7
7 changed files with 86 additions and 4 deletions
|
|
@ -212,6 +212,11 @@ func panicmem() {
|
|||
panic(memoryError)
|
||||
}
|
||||
|
||||
func panicmemAddr(addr uintptr) {
|
||||
panicCheck2("invalid memory address or nil pointer dereference")
|
||||
panic(errorAddressString{msg: "invalid memory address or nil pointer dereference", addr: addr})
|
||||
}
|
||||
|
||||
// Create a new deferred function fn with siz bytes of arguments.
|
||||
// The compiler turns a defer statement into a call to this.
|
||||
//go:nosplit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue