From 2d19c2d8f2a9d759ecfa73d07ed1bab66f8ac24f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 8 Apr 2010 18:15:30 -0700 Subject: 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 --- src/pkg/runtime/freebsd/signals.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/pkg/runtime/freebsd/signals.h') 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 -- cgit v1.2.3