diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-06-22 14:31:16 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-06-22 14:31:16 +0000 |
commit | b92e4dff0a767a4e39dac6a012e381816ee5937a (patch) | |
tree | 4d196a18318efdb9dab742f2e751c6afe428ed4c | |
parent | ed99905e1d89e84b74a07a55a46270d1f9f27991 (diff) | |
download | gcc-b92e4dff0a767a4e39dac6a012e381816ee5937a.zip gcc-b92e4dff0a767a4e39dac6a012e381816ee5937a.tar.gz gcc-b92e4dff0a767a4e39dac6a012e381816ee5937a.tar.bz2 |
runtime: rename _defer struct _panic field to panicStack
The gc version of the _defer struct has a _panic field that has a
completely different meaning. We are going to want that bring that new
meaning into the gofrontend to improve panic reports with nested
panic calls. Simplify that by first renaming the existing _panic field.
Reviewed-on: https://go-review.googlesource.com/46454
From-SVN: r249558
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | libgo/go/runtime/panic.go | 18 | ||||
-rw-r--r-- | libgo/go/runtime/runtime2.go | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index cb902243..8ce4017 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -a81079a81b63714221674f07d13bedc768092f27 +a459f1fdfe0bd365bf2def730e1529052c6487fd The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/runtime/panic.go b/libgo/go/runtime/panic.go index aa196ae..bbd34b4 100644 --- a/libgo/go/runtime/panic.go +++ b/libgo/go/runtime/panic.go @@ -90,13 +90,13 @@ func throwinit() { // pfn is a C function pointer. // arg is a value to pass to pfn. func deferproc(frame *bool, pfn uintptr, arg unsafe.Pointer) { - n := newdefer() - n.frame = frame - n._panic = getg()._panic - n.pfn = pfn - n.arg = arg - n.retaddr = 0 - n.makefunccanrecover = false + d := newdefer() + d.frame = frame + d.panicStack = getg()._panic + d.pfn = pfn + d.arg = arg + d.retaddr = 0 + d.makefunccanrecover = false } // Allocate a Defer, usually using per-P pool. @@ -502,7 +502,7 @@ func currentDefer() *_defer { // the panic stack. We do not want to recover it if that panic // was on the top of the panic stack when this function was // deferred. - if d._panic == gp._panic { + if d.panicStack == gp._panic { return nil } @@ -731,7 +731,7 @@ func gorecover() interface{} { // function like recover. func deferredrecover() interface{} { gp := getg() - if gp._defer == nil || gp._defer._panic != gp._panic { + if gp._defer == nil || gp._defer.panicStack != gp._panic { return nil } return gorecover() diff --git a/libgo/go/runtime/runtime2.go b/libgo/go/runtime/runtime2.go index 8bfdcbc..f532a3b 100644 --- a/libgo/go/runtime/runtime2.go +++ b/libgo/go/runtime/runtime2.go @@ -698,7 +698,7 @@ type _defer struct { // deferred. This function can not recover this value from // the panic stack. This can happen if a deferred function // has a defer statement itself. - _panic *_panic + panicStack *_panic // The function to call. pfn uintptr |