diff options
| author | Russ Cox <rsc@golang.org> | 2010-04-08 18:15:30 -0700 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-04-08 18:15:30 -0700 |
| commit | 2d19c2d8f2a9d759ecfa73d07ed1bab66f8ac24f (patch) | |
| tree | 9042a434db46b9ee490ca915723872f355fd60f2 /src/pkg/runtime/freebsd/signals.h | |
| parent | 1fa9a0c209f50aa6b8eac0755ce6ccd00ff2cf02 (diff) | |
| download | golang-2d19c2d8f2a9d759ecfa73d07ed1bab66f8ac24f.tar.gz | |
runtime: turn divide by zero, nil dereference into panics
tested on linux/amd64, linux/386, linux/arm, darwin/amd64, darwin/386.
freebsd untested; will finish in a separate CL.
for now all the panics are errorStrings.
richer structures can be added as necessary
once the mechanism is shaked out.
R=r
CC=golang-dev
http://codereview.appspot.com/906041
Diffstat (limited to 'src/pkg/runtime/freebsd/signals.h')
| -rw-r--r-- | src/pkg/runtime/freebsd/signals.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pkg/runtime/freebsd/signals.h b/src/pkg/runtime/freebsd/signals.h index 93ff7eb98..0c41daf84 100644 --- a/src/pkg/runtime/freebsd/signals.h +++ b/src/pkg/runtime/freebsd/signals.h @@ -6,8 +6,9 @@ #define I SigIgnore #define R SigRestart #define Q SigQueue +#define P SigPanic -static SigTab sigtab[] = { +SigTab sigtab[] = { /* 0 */ 0, "SIGNONE: no trap", /* 1 */ Q+R, "SIGHUP: terminal line hangup", /* 2 */ Q+R, "SIGINT: interrupt", @@ -16,10 +17,10 @@ static SigTab sigtab[] = { /* 5 */ C, "SIGTRAP: trace trap", /* 6 */ C, "SIGABRT: abort", /* 7 */ C, "SIGEMT: EMT instruction", - /* 8 */ C, "SIGFPE: floating-point exception", + /* 8 */ C+P, "SIGFPE: floating-point exception", /* 9 */ 0, "SIGKILL: kill", - /* 10 */ C, "SIGBUS: bus error", - /* 11 */ C, "SIGSEGV: segmentation violation", + /* 10 */ C+P, "SIGBUS: bus error", + /* 11 */ C+P, "SIGSEGV: segmentation violation", /* 12 */ C, "SIGSYS: bad system call", /* 13 */ I, "SIGPIPE: write to broken pipe", /* 14 */ Q+I+R, "SIGALRM: alarm clock", @@ -46,5 +47,6 @@ static SigTab sigtab[] = { #undef I #undef R #undef Q +#undef P #define NSIG 33 |
