summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-03-04 13:53:08 -0500
committerRuss Cox <rsc@golang.org>2014-03-04 13:53:08 -0500
commit342e17648d01ae1bca36494a61c19a09592c4d6d (patch)
treee79ee1d7e9465644fba07a3a6fd6f490c0764e8f /include
parent410479feaf8f12c564464a2d4734021d21d54ef9 (diff)
downloadgo-342e17648d01ae1bca36494a61c19a09592c4d6d.tar.gz
cmd/ld: clear unused ctxt before morestack
For non-closure functions, the context register is uninitialized on entry and will not be used, but morestack saves it and then the garbage collector treats it as live. This can be a source of memory leaks if the context register points at otherwise dead memory. Avoid this by introducing a parallel set of morestack functions that clear the context register, and use those for the non-closure functions. I hope this will help with some of the finalizer flakiness, but it probably won't. Fixes issue 7244. LGTM=dvyukov R=khr, dvyukov CC=golang-codereviews https://codereview.appspot.com/71030044
Diffstat (limited to 'include')
-rw-r--r--include/link.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/link.h b/include/link.h
index 53c5c5582..a762424d2 100644
--- a/include/link.h
+++ b/include/link.h
@@ -356,7 +356,7 @@ struct Link
LSym* sym_divu;
LSym* sym_mod;
LSym* sym_modu;
- LSym* symmorestack[10];
+ LSym* symmorestack[20];
LSym* gmsym;
LSym* plan9tos;
Prog* curp;