diff options
| author | Keith Randall <khr@golang.org> | 2014-10-07 15:21:00 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2014-10-07 15:21:00 -0700 |
| commit | dcc4a674d85fc2b0a434d71c1a504ebc559118bf (patch) | |
| tree | c5ce6af1452c5defd06dded78725546e857f0e8d /src/runtime/panic.c | |
| parent | 6ea3746adfd924ef5a389165c22c0eaddd35ddf2 (diff) | |
| download | go-dcc4a674d85fc2b0a434d71c1a504ebc559118bf.tar.xz | |
runtime: zero pointer-looking scalararg values
I have a CL which at every gc looks through data and bss
sections for nonpointer data (according to gc maps) that
looks like a pointer. These are potential missing roots.
The only thing it finds are begnign, storing stack pointers
into m0.scalararg[1] and never cleaning them up. Let's
clean them up now so the test CL passes all.bash cleanly.
The test CL can't be checked in because we might store
pointer-looking things in nonpointer data by accident.
LGTM=iant
R=golang-codereviews, iant, khr
CC=golang-codereviews
https://golang.org/cl/153210043
Diffstat (limited to 'src/runtime/panic.c')
| -rw-r--r-- | src/runtime/panic.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/panic.c b/src/runtime/panic.c index 1cd0aa8654..55ad80e9bc 100644 --- a/src/runtime/panic.c +++ b/src/runtime/panic.c @@ -31,6 +31,7 @@ runtime·deferproc_m(void) argp = g->m->scalararg[1]; callerpc = g->m->scalararg[2]; g->m->ptrarg[0] = nil; + g->m->scalararg[1] = 0; d = runtime·newdefer(siz); d->fn = fn; @@ -131,6 +132,7 @@ runtime·dopanic_m(void) g->m->ptrarg[0] = nil; pc = g->m->scalararg[0]; sp = g->m->scalararg[1]; + g->m->scalararg[1] = 0; if(gp->sig != 0) runtime·printf("[signal %x code=%p addr=%p pc=%p]\n", gp->sig, gp->sigcode0, gp->sigcode1, gp->sigpc); |
