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
https://golang.org/cl/906041
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h
index 26ce4b6..f3297e7 100644
--- a/src/pkg/runtime/runtime.h
+++ b/src/pkg/runtime/runtime.h
@@ -198,6 +198,9 @@
M* lockedm;
void (*cgofn)(void*); // for cgo/ffi
void *cgoarg;
+ int32 sig;
+ uintptr sigcode0;
+ uintptr sigcode1;
};
struct M
{
@@ -268,6 +271,7 @@
SigIgnore = 1<<1,
SigRestart = 1<<2,
SigQueue = 1<<3,
+ SigPanic = 1<<4,
};
// NOTE(rsc): keep in sync with extern.go:/type.Func.