diff options
| author | Russ Cox <rsc@golang.org> | 2014-09-01 10:05:16 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-09-01 10:05:16 -0400 |
| commit | 3de7ba1873b3efb0004d61147cc049dd42d8725d (patch) | |
| tree | 37b004eabb1714149435d37ab319f85efb31d351 /src/pkg/runtime/panic.c | |
| parent | f16729781bc7bfe561658f520dcbffa5f81790c2 (diff) | |
| download | go-3de7ba1873b3efb0004d61147cc049dd42d8725d.tar.xz | |
runtime: change PC, SP values in Stkframe, Panic, Defer from byte* to uintptr
uintptr is better when translating to Go,
and in a few places it's better in C too.
LGTM=r
R=golang-codereviews, r
CC=golang-codereviews, iant, khr
https://golang.org/cl/138980043
Diffstat (limited to 'src/pkg/runtime/panic.c')
| -rw-r--r-- | src/pkg/runtime/panic.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pkg/runtime/panic.c b/src/pkg/runtime/panic.c index 39027a77c2..ecf4111337 100644 --- a/src/pkg/runtime/panic.c +++ b/src/pkg/runtime/panic.c @@ -85,12 +85,12 @@ runtime·deferproc(int32 siz, FuncVal *fn, ...) d = newdefer(siz); d->fn = fn; - d->pc = runtime·getcallerpc(&siz); + d->pc = (uintptr)runtime·getcallerpc(&siz); if(thechar == '5') - d->argp = (byte*)(&fn+2); // skip caller's saved link register + d->argp = (uintptr)(&fn+2); // skip caller's saved link register else - d->argp = (byte*)(&fn+1); - runtime·memmove(d->args, d->argp, d->siz); + d->argp = (uintptr)(&fn+1); + runtime·memmove(d->args, (byte*)d->argp, d->siz); // deferproc returns 0 normally. // a deferred func that stops a panic @@ -119,13 +119,13 @@ void runtime·deferreturn(uintptr arg0) { Defer *d; - byte *argp; + uintptr argp; FuncVal *fn; d = g->defer; if(d == nil) return; - argp = (byte*)&arg0; + argp = (uintptr)&arg0; if(d->argp != argp) return; @@ -134,7 +134,7 @@ runtime·deferreturn(uintptr arg0) // won't know the form of the arguments until the jmpdefer can // flip the PC over to fn. g->m->locks++; - runtime·memmove(argp, d->args, d->siz); + runtime·memmove((byte*)argp, d->args, d->siz); fn = d->fn; g->defer = d->link; freedefer(d); @@ -213,7 +213,7 @@ runtime·panic(Eface e) { Defer *d, dabort; Panic p; - void *pc, *argp; + uintptr pc, argp; runtime·memclr((byte*)&p, sizeof p); p.arg = e; |
