public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* libgo patch committed: Rename _defer struct _panic field to panicStack
@ 2017-06-22 14:31 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2017-06-22 14:31 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 326 bytes --]

In the gc version of the Go library the _defer struct has a _panic
field with a completely different meaning, that we are going to want
to adopt into libgo.  This trivial patch renames libgo's _panic field
to panicStack to clear the way.  Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2149 bytes --]

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 249557)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -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.
Index: libgo/go/runtime/panic.go
===================================================================
--- libgo/go/runtime/panic.go	(revision 249205)
+++ libgo/go/runtime/panic.go	(working copy)
@@ -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()
Index: libgo/go/runtime/runtime2.go
===================================================================
--- libgo/go/runtime/runtime2.go	(revision 249205)
+++ libgo/go/runtime/runtime2.go	(working copy)
@@ -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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-22 14:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-22 14:31 libgo patch committed: Rename _defer struct _panic field to panicStack Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).