diff options
| author | Russ Cox <rsc@golang.org> | 2014-09-08 21:02:36 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-09-08 21:02:36 -0400 |
| commit | 0f99a91bb56dd01dfd4e5ce4344e6006e3463ade (patch) | |
| tree | ee9114e1fac7f70c0e910fcc425e9a9b4b8e47e7 /src/runtime/panic.go | |
| parent | c93f74d34bf45bcbfa1cfda5ccd198ed5682ddf4 (diff) | |
| download | go-0f99a91bb56dd01dfd4e5ce4344e6006e3463ade.tar.xz | |
runtime: let stack copier update Panic structs for us
It already is updating parts of them; we're just getting lucky
retraversing them and not finding much to do.
Change argp to a pointer so that it will be updated too.
Existing tests break if you apply the change to adjustpanics
without also updating the type of argp.
LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/139380043
Diffstat (limited to 'src/runtime/panic.go')
| -rw-r--r-- | src/runtime/panic.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/panic.go b/src/runtime/panic.go index a5a8fbd6dd..52ab654646 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -287,9 +287,9 @@ func gopanic(e interface{}) { gp._defer = (*_defer)(noescape(unsafe.Pointer(&dabort))) p._defer = d - p.argp = getargp(0) + p.argp = unsafe.Pointer(getargp(0)) reflectcall(unsafe.Pointer(d.fn), unsafe.Pointer(&d.args), uint32(d.siz), uint32(d.siz)) - p.argp = 0 + p.argp = nil // reflectcall did not panic. Remove dabort. if gp._defer != &dabort { @@ -362,7 +362,7 @@ func gorecover(argp uintptr) interface{} { // If they match, the caller is the one who can recover. gp := getg() p := gp._panic - if p != nil && !p.recovered && argp == p.argp { + if p != nil && !p.recovered && argp == uintptr(p.argp) { p.recovered = true return p.arg } |
