mirror of
https://github.com/golang/go
synced 2024-10-04 08:31:22 -06:00
runtime: don't use ... formal argument to deferreturn.
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/28860043
This commit is contained in:
parent
3278dc158e
commit
c792bde9ef
@ -168,8 +168,13 @@ compile(Node *fn)
|
|||||||
if(retpc)
|
if(retpc)
|
||||||
patch(retpc, pc);
|
patch(retpc, pc);
|
||||||
ginit();
|
ginit();
|
||||||
if(hasdefer)
|
if(hasdefer) {
|
||||||
ginscall(deferreturn, 0);
|
ginscall(deferreturn, 0);
|
||||||
|
// deferreturn pretends to have one uintptr argument.
|
||||||
|
// Reserve space for it so stack scanner is happy.
|
||||||
|
if(maxarg < widthptr)
|
||||||
|
maxarg = widthptr;
|
||||||
|
}
|
||||||
if(curfn->exit)
|
if(curfn->exit)
|
||||||
genlist(curfn->exit);
|
genlist(curfn->exit);
|
||||||
gclean();
|
gclean();
|
||||||
|
@ -157,14 +157,12 @@ runtime·deferproc(int32 siz, FuncVal *fn, ...)
|
|||||||
// is called again and again until there are no more deferred functions.
|
// is called again and again until there are no more deferred functions.
|
||||||
// Cannot split the stack because we reuse the caller's frame to
|
// Cannot split the stack because we reuse the caller's frame to
|
||||||
// call the deferred function.
|
// call the deferred function.
|
||||||
//
|
|
||||||
// The ... in the prototype keeps the compiler from declaring
|
// The single argument isn't actually used - it just has its address
|
||||||
// an argument frame size. deferreturn is a very special function,
|
// taken so it can be matched against pending defers.
|
||||||
// and if the runtime ever asks for its frame size, that means
|
|
||||||
// the traceback routines are probably broken.
|
|
||||||
#pragma textflag NOSPLIT
|
#pragma textflag NOSPLIT
|
||||||
void
|
void
|
||||||
runtime·deferreturn(uintptr arg0, ...)
|
runtime·deferreturn(uintptr arg0)
|
||||||
{
|
{
|
||||||
Defer *d;
|
Defer *d;
|
||||||
byte *argp;
|
byte *argp;
|
||||||
|
Loading…
Reference in New Issue
Block a user