diff options
| author | Keith Randall <khr@golang.org> | 2023-02-13 23:27:51 -0800 |
|---|---|---|
| committer | Keith Randall <khr@google.com> | 2023-03-03 16:35:00 +0000 |
| commit | cbb9cd03f80c0487cee0adcfef9a2a5de9fe2cc1 (patch) | |
| tree | 2a9a4bba25b6dbc33ce4fe9a85a06e9aa76666b4 /src | |
| parent | 5e74bc1a08f43dc98780d02785cfc9c75103c403 (diff) | |
| download | go-cbb9cd03f80c0487cee0adcfef9a2a5de9fe2cc1.tar.xz | |
cmd/compile: ensure FuncForPC works on closures that start with NOPs
A 0-sized no-op shouldn't prevent us from detecting that the first
instruction is from an inlined callee.
Update #58300
Change-Id: Ic5f6ed108c54a32c05e9b2264b516f2cc17e4619
Reviewed-on: https://go-review.googlesource.com/c/go/+/467977
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/ssagen/ssa.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssagen/ssa.go b/src/cmd/compile/internal/ssagen/ssa.go index 004806b029..6831da6908 100644 --- a/src/cmd/compile/internal/ssagen/ssa.go +++ b/src/cmd/compile/internal/ssagen/ssa.go @@ -7171,7 +7171,7 @@ func genssa(f *ssa.Func, pp *objw.Progs) { // This ensures that runtime.FuncForPC(uintptr(reflect.ValueOf(fn).Pointer())).Name() // returns the right answer. See issue 58300. for p := pp.Text; p != nil; p = p.Link { - if p.As == obj.AFUNCDATA || p.As == obj.APCDATA || p.As == obj.ATEXT { + if p.As == obj.AFUNCDATA || p.As == obj.APCDATA || p.As == obj.ATEXT || p.As == obj.ANOP { continue } if base.Ctxt.PosTable.Pos(p.Pos).Base().InliningIndex() >= 0 { |
