diff options
author | Russ Cox <rsc@golang.org> | 2014-11-15 08:00:38 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-11-15 08:00:38 -0500 |
commit | 8b46a22b652d6e7a4a69b9523d57aff12f9dc945 (patch) | |
tree | 8f1c3f2d7e06daa3a9ad5721658a31b63519d748 /src/runtime/sigpanic_unix.go | |
parent | 66fbfa707147ff58e13beed2d4a957a06bede869 (diff) | |
parent | 0b7f128e76956367ddb4f9ddbee4477d3b462e96 (diff) | |
download | go-8b46a22b652d6e7a4a69b9523d57aff12f9dc945.tar.gz |
[dev.garbage] all: merge dev.cc into dev.garbage
The garbage collector is now written in Go.
There is plenty to clean up (just like on dev.cc).
all.bash passes on darwin/amd64, darwin/386, linux/amd64, linux/386.
TBR=rlh
R=austin, rlh, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/173250043
Diffstat (limited to 'src/runtime/sigpanic_unix.go')
-rw-r--r-- | src/runtime/sigpanic_unix.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/runtime/sigpanic_unix.go b/src/runtime/sigpanic_unix.go index 68079859b..7bf2c1540 100644 --- a/src/runtime/sigpanic_unix.go +++ b/src/runtime/sigpanic_unix.go @@ -6,8 +6,6 @@ package runtime -func signame(int32) *byte - func sigpanic() { g := getg() if !canpanic(g) { @@ -36,5 +34,10 @@ func sigpanic() { } panicfloat() } - panic(errorString(gostringnocopy(signame(g.sig)))) + + if g.sig >= uint32(len(sigtable)) { + // can't happen: we looked up g.sig in sigtable to decide to call sigpanic + gothrow("unexpected signal value") + } + panic(errorString(sigtable[g.sig].name)) } |