aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/stack.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-06-12 16:34:36 -0400
committerRuss Cox <rsc@golang.org>2014-06-12 16:34:36 -0400
commit36207a91d3c97a9c64984572af89727495310469 (patch)
treee0770de4a2cca28b777dd376cd4c53e8f7927dad /src/pkg/runtime/stack.c
parent83c814066237bf6e8490d83643ba76513082a158 (diff)
downloadgo-36207a91d3c97a9c64984572af89727495310469.tar.xz
runtime: fix defer of nil func
Fixes #8047. LGTM=r, iant R=golang-codereviews, r, iant CC=dvyukov, golang-codereviews, khr https://golang.org/cl/105140044
Diffstat (limited to 'src/pkg/runtime/stack.c')
-rw-r--r--src/pkg/runtime/stack.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pkg/runtime/stack.c b/src/pkg/runtime/stack.c
index 4b66e7dbaa..1f7c2eaada 100644
--- a/src/pkg/runtime/stack.c
+++ b/src/pkg/runtime/stack.c
@@ -856,7 +856,12 @@ runtime·newstack(void)
void
runtime·gostartcallfn(Gobuf *gobuf, FuncVal *fv)
{
- runtime·gostartcall(gobuf, fv->fn, fv);
+ void *fn;
+
+ fn = nil;
+ if(fv != nil)
+ fn = fv->fn;
+ runtime·gostartcall(gobuf, fn, fv);
}
// Maybe shrink the stack being used by gp.