aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/signal_linux_arm.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2014-11-19 14:56:49 -0500
committerAustin Clements <austin@google.com>2014-11-19 14:56:49 -0500
commitf4a525452e1442c08e2a973a5871445258ed0054 (patch)
tree821d640aceb3688bf4277f0fd6eaad6b3e33deaf /src/runtime/signal_linux_arm.go
parentd11a42595940df79bbd73bfe54469f840952ab79 (diff)
downloadgo-f4a525452e1442c08e2a973a5871445258ed0054.tar.gz
go-f4a525452e1442c08e2a973a5871445258ed0054.zip
[dev.cc] runtime: add explicit siginfo.si_addr field
struct siginfo_t's si_addr field is part of a union. Previously, we represented this union in Go using an opaque byte array and accessed the si_addr field using unsafe (and wrong on 386 and arm!) pointer arithmetic. Since si_addr is the only field we use from this union, this replaces the opaque byte array with an explicit declaration of the si_addr field and accesses it directly. LGTM=minux, rsc R=rsc, minux CC=golang-codereviews https://golang.org/cl/179970044
Diffstat (limited to 'src/runtime/signal_linux_arm.go')
-rw-r--r--src/runtime/signal_linux_arm.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/signal_linux_arm.go b/src/runtime/signal_linux_arm.go
index 4a5670e740..bdb4314fa8 100644
--- a/src/runtime/signal_linux_arm.go
+++ b/src/runtime/signal_linux_arm.go
@@ -35,7 +35,7 @@ func (c *sigctxt) error() uint32 { return c.regs().error_code }
func (c *sigctxt) oldmask() uint32 { return c.regs().oldmask }
func (c *sigctxt) sigcode() uint32 { return uint32(c.info.si_code) }
-func (c *sigctxt) sigaddr() uint32 { return uint32(*(*uintptr)(add(unsafe.Pointer(c.info), 2*ptrSize))) }
+func (c *sigctxt) sigaddr() uint32 { return c.info.si_addr }
func (c *sigctxt) set_pc(x uint32) { c.regs().pc = x }
func (c *sigctxt) set_sp(x uint32) { c.regs().sp = x }