aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/signal_darwin_amd64.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2015-03-26 12:14:26 -0400
committerAustin Clements <austin@google.com>2015-03-26 16:20:32 +0000
commitec2c7e6659c1ab3a10dc74df2c1303b749fbc364 (patch)
treec08e0b11140f2f4847d72936b52359b97fa72d6b /src/runtime/signal_darwin_amd64.go
parent9b0ea6aa271c811abc180eb46a4d114890870ec5 (diff)
downloadgo-ec2c7e6659c1ab3a10dc74df2c1303b749fbc364.tar.gz
go-ec2c7e6659c1ab3a10dc74df2c1303b749fbc364.zip
runtime: use uintXX instead of *byte for si_addr on Darwin
Currently, Darwin's siginfo type uses *byte for the si_addr field. This results in unwanted write barriers in set_sigaddr. It's also pointless since it never points to anything real and the get/set methods return/take uintXX and cast it from/to the pointer. All other arches use a uint type for this field. Change Darwin to match. This simplifies the get/set methods and eliminates the unwanted write barriers. Change-Id: Ifdb5646d35e1f2f6808b87a3d59745ec9718add1 Reviewed-on: https://go-review.googlesource.com/8086 Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/signal_darwin_amd64.go')
-rw-r--r--src/runtime/signal_darwin_amd64.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/signal_darwin_amd64.go b/src/runtime/signal_darwin_amd64.go
index 409bc6d575..dbf044814c 100644
--- a/src/runtime/signal_darwin_amd64.go
+++ b/src/runtime/signal_darwin_amd64.go
@@ -34,9 +34,9 @@ func (c *sigctxt) cs() uint64 { return c.regs().cs }
func (c *sigctxt) fs() uint64 { return c.regs().fs }
func (c *sigctxt) gs() uint64 { return c.regs().gs }
func (c *sigctxt) sigcode() uint64 { return uint64(c.info.si_code) }
-func (c *sigctxt) sigaddr() uint64 { return uint64(uintptr(unsafe.Pointer(c.info.si_addr))) }
+func (c *sigctxt) sigaddr() uint64 { return c.info.si_addr }
func (c *sigctxt) set_rip(x uint64) { c.regs().rip = x }
func (c *sigctxt) set_rsp(x uint64) { c.regs().rsp = x }
func (c *sigctxt) set_sigcode(x uint64) { c.info.si_code = int32(x) }
-func (c *sigctxt) set_sigaddr(x uint64) { c.info.si_addr = (*byte)(unsafe.Pointer(uintptr(x))) }
+func (c *sigctxt) set_sigaddr(x uint64) { c.info.si_addr = x }