Commit b49561d8 authored by Russ Cox's avatar Russ Cox

gc: graceful exit on seg fault

R=ken2
CC=golang-dev
https://golang.org/cl/1882043
parent a59e113f
......@@ -90,12 +90,27 @@ usage(void)
exit(0);
}
void
fault(int s)
{
// If we've already complained about things
// in the program, don't bother complaining
// about the seg fault too; let the user clean up
// the code and try again.
if(nerrors > 0)
errorexit();
fatal("fault");
}
int
main(int argc, char *argv[])
{
int i, c;
NodeList *l;
char *p;
signal(SIGBUS, fault);
signal(SIGSEGV, fault);
localpkg = mkpkg(strlit(""));
localpkg->prefix = "\"\"";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment