Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
b49561d8
Commit
b49561d8
authored
Jul 26, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: graceful exit on seg fault
R=ken2 CC=golang-dev
https://golang.org/cl/1882043
parent
a59e113f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
lex.c
src/cmd/gc/lex.c
+15
-0
No files found.
src/cmd/gc/lex.c
View file @
b49561d8
...
...
@@ -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
=
"
\"\"
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment