Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(973)

Delta Between Two Patch Sets: src/pkg/runtime/linux/amd64/signal.c

Issue 906041: code review 906041: runtime: turn divide by zero, nil dereference into panics (Closed)
Left Patch Set: code review 906041: runtime: turn divide by zero, nil dereference into panics Created 14 years, 12 months ago
Right Patch Set: code review 906041: runtime: turn divide by zero, nil dereference into panics Created 14 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/runtime/linux/amd64/defs.h ('k') | src/pkg/runtime/linux/arm/defs.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 #include "runtime.h" 5 #include "runtime.h"
6 #include "defs.h" 6 #include "defs.h"
7 #include "signals.h" 7 #include "signals.h"
8 #include "os.h" 8 #include "os.h"
9 9
10 void 10 void
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // Have to pass arguments out of band since 67 // Have to pass arguments out of band since
68 // augmenting the stack frame would break 68 // augmenting the stack frame would break
69 // the unwinding code. 69 // the unwinding code.
70 gp->sig = sig; 70 gp->sig = sig;
71 gp->sigcode0 = info->si_code; 71 gp->sigcode0 = info->si_code;
72 gp->sigcode1 = ((uintptr*)info)[2]; 72 gp->sigcode1 = ((uintptr*)info)[2];
73 73
74 sp = (uintptr*)r->rsp; 74 sp = (uintptr*)r->rsp;
75 *--sp = r->rip; 75 *--sp = r->rip;
76 r->rip = (uintptr)sigpanic; 76 r->rip = (uintptr)sigpanic;
77 r->rsp = (uintptr)sp;
77 return; 78 return;
78 } 79 }
79 80
80 if(sigtab[sig].flags & SigQueue) { 81 if(sigtab[sig].flags & SigQueue) {
81 if(sigsend(sig) || (sigtab[sig].flags & SigIgnore)) 82 if(sigsend(sig) || (sigtab[sig].flags & SigIgnore))
82 return; 83 return;
83 exit(2); // SIGINT, SIGTERM, etc 84 exit(2); // SIGINT, SIGTERM, etc
84 } 85 }
85 86
86 if(panicking) // traceback already printed 87 if(panicking) // traceback already printed
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 else 135 else
135 sa.sa_handler = (void*)sigignore; 136 sa.sa_handler = (void*)sigignore;
136 if(sigtab[i].flags & SigRestart) 137 if(sigtab[i].flags & SigRestart)
137 sa.sa_flags |= SA_RESTART; 138 sa.sa_flags |= SA_RESTART;
138 else 139 else
139 sa.sa_flags &= ~SA_RESTART; 140 sa.sa_flags &= ~SA_RESTART;
140 rt_sigaction(i, &sa, nil, 8); 141 rt_sigaction(i, &sa, nil, 8);
141 } 142 }
142 } 143 }
143 } 144 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b