[dev.typeparams] runtime: don't keep stack uintptr across potential stack move
[dev.typeparams] runtime: don't keep stack uintptr across potential stack move

Currently, deferproc stores the caller SP as a uintptr in a local
variable across a call to newdefer, but newdefer could grow the stack
and invalidate this saved SP, causing deferproc to store a stale SP in
the defer record. This would lead to us later failing to match that
defer to its calling frame, and we wouldn't run the defer at the right
time (or possibly at all).

It turns out this isn't crashing horribly right now only because the
compiler happens to only materialize the result of getcallersp when
this variable is used, *after* the call to newdefer. But this is
clearly on thin ice, so this CL moves the getcallersp() to the place
where we actually need the result.

Change-Id: Iae8ab226e03e4482f16acfb965885f0bd83a13b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/337649
Trust: Austin Clements <7ea35d812706d9213868749011af1ed4fa2f6aa0@google.com>
Run-TryBot: Austin Clements <7ea35d812706d9213868749011af1ed4fa2f6aa0@google.com>
TryBot-Result: Go Bot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Cherry Mui <d62e63aa42ce272d7b6a5055d97e942b33a34679@google.com>

nawawi/go,golang/go,nawawi/go,nawawi/go,golang/go,CAFxX/go,cloudflare/go,cloudflare/go,CAFxX/go,nawawi/go,golang/go,nawawi/go,CAFxX/go,cloudflare/go,nawawi/go,CAFxX/go,golang/go,CAFxX/go,cloudflare/go,golang/go,CAFxX/go,CAFxX/go,cloudflare/go,cloudflare/go,cloudflare/go,cloudflare/go,golang/go,nawawi/go,golang/go,nawawi/go,golang/go,CAFxX/go