src/pkg/runtime/stack.c | 11 ++++++++++- diff --git a/src/pkg/runtime/stack.c b/src/pkg/runtime/stack.c index 1f7c2eaadabe31c34d1db4220000daf79f478378..1680f004eb4a5009b15c35c7185dd1520c748b1d 100644 --- a/src/pkg/runtime/stack.c +++ b/src/pkg/runtime/stack.c @@ -9,6 +9,7 @@ #include "stack.h" #include "funcdata.h" #include "typekind.h" #include "type.h" +#include "../../cmd/ld/textflag.h" enum { @@ -851,6 +852,13 @@ *(int32*)345 = 123; // never return } +#pragma textflag NOSPLIT +void +runtime·nilfunc(void) +{ + *(byte*)0 = 0; +} + // adjust Gobuf as if it executed a call to fn // and then did an immediate gosave. void @@ -858,9 +866,10 @@ runtime·gostartcallfn(Gobuf *gobuf, FuncVal *fv) { void *fn; - fn = nil; if(fv != nil) fn = fv->fn; + else + fn = runtime·nilfunc; runtime·gostartcall(gobuf, fn, fv); }