]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add memory argument to GetCallerSP
authorKeith Randall <khr@golang.org>
Sat, 26 Nov 2022 23:03:51 +0000 (15:03 -0800)
committerKeith Randall <khr@google.com>
Thu, 19 Jan 2023 22:43:22 +0000 (22:43 +0000)
commit45dc81d8565adb7d0a62502d039f4930e73d75e0
tree094102155310347ed725d09b3129808d3b855ea9
parent440ef8c4d24861cbfb01758e7e03fa3b4164f55a
cmd/compile: add memory argument to GetCallerSP

We need to make sure that when we get the stack pointer, we get it
at the right time.

V = GetCallerSP
Call()
W = GetCallerSP

If Call causes a stack growth, then we will be in a situation
where V != W. So it matters when GetCallerSP operations get scheduled.
Add a memory argument to GetCallerSP so it can't be reordered with
things like calls.

Change-Id: I6cc801134c38e358c5a1ec0c09d38379a16a4184
Reviewed-on: https://go-review.googlesource.com/c/go/+/453515
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Martin Möhrmann <martin@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
15 files changed:
src/cmd/compile/internal/ssa/_gen/386Ops.go
src/cmd/compile/internal/ssa/_gen/AMD64Ops.go
src/cmd/compile/internal/ssa/_gen/ARM64Ops.go
src/cmd/compile/internal/ssa/_gen/ARMOps.go
src/cmd/compile/internal/ssa/_gen/LOONG64Ops.go
src/cmd/compile/internal/ssa/_gen/MIPS64Ops.go
src/cmd/compile/internal/ssa/_gen/MIPSOps.go
src/cmd/compile/internal/ssa/_gen/PPC64Ops.go
src/cmd/compile/internal/ssa/_gen/RISCV64Ops.go
src/cmd/compile/internal/ssa/_gen/S390XOps.go
src/cmd/compile/internal/ssa/_gen/WasmOps.go
src/cmd/compile/internal/ssa/_gen/genericOps.go
src/cmd/compile/internal/ssa/expand_calls.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssagen/ssa.go