aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/signal_linux_386.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_386.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_386.go')
-rw-r--r--src/runtime/signal_linux_386.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/signal_linux_386.go b/src/runtime/signal_linux_386.go
index 41eae80ea2..085f66e898 100644
--- a/src/runtime/signal_linux_386.go
+++ b/src/runtime/signal_linux_386.go
@@ -26,7 +26,7 @@ func (c *sigctxt) cs() uint32 { return uint32(c.regs().cs) }
func (c *sigctxt) fs() uint32 { return uint32(c.regs().fs) }
func (c *sigctxt) gs() uint32 { return uint32(c.regs().gs) }
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_eip(x uint32) { c.regs().eip = x }
func (c *sigctxt) set_esp(x uint32) { c.regs().esp = x }