aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/panic.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-08-28 23:26:40 -0400
committerRuss Cox <rsc@golang.org>2014-08-28 23:26:40 -0400
commit597b266eafe7d63e9be8da1c1b4813bd2998a11c (patch)
treef69c69d422577069105676724f78c582ae582650 /src/pkg/runtime/panic.c
parentde7fea0d6161c876fca0b0293be3ac6f3e29a759 (diff)
downloadgo-597b266eafe7d63e9be8da1c1b4813bd2998a11c.tar.xz
runtime: convert print.c to Go
LGTM=iant R=golang-codereviews, iant CC=dvyukov, golang-codereviews, khr, r https://golang.org/cl/135930043
Diffstat (limited to 'src/pkg/runtime/panic.c')
-rw-r--r--src/pkg/runtime/panic.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pkg/runtime/panic.c b/src/pkg/runtime/panic.c
index 00c780bf55..39027a77c2 100644
--- a/src/pkg/runtime/panic.c
+++ b/src/pkg/runtime/panic.c
@@ -390,8 +390,11 @@ runtime·startpanic(void)
switch(g->m->dying) {
case 0:
g->m->dying = 1;
- if(g != nil)
- g->writebuf = nil;
+ if(g != nil) {
+ g->writebuf.array = nil;
+ g->writebuf.len = 0;
+ g->writebuf.cap = 0;
+ }
runtime·xadd(&runtime·panicking, 1);
runtime·lock(&paniclk);
if(runtime·debug.schedtrace > 0 || runtime·debug.scheddetail > 0)