]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/pgo: fix RedirectEdges
authorXiangdong Ji <jixiangdong@bytedance.com>
Thu, 9 Feb 2023 09:31:14 +0000 (17:31 +0800)
committerWayne Zuo <wdvxdr@golangcn.org>
Mon, 27 Feb 2023 14:40:29 +0000 (14:40 +0000)
commit5e4e2acc8e53022f57398c4b0f3892f8113687f6
treeb17842b666a475ffaf37558a74f64945959119b3
parent85b55c797d47a34dff63c21d17770f6ce9bd3af2
cmd/compile/internal/pgo: fix RedirectEdges

'RedirectEdges' may range over an out-edge slice under modification, leading to out-of-index
panic, and reuse an IREdge object by mistake if there are multiple inlining call-sites.

Fix by rewriting part of the redirecting operation.

Remove 'redirectEdges' as it's not used now and not working as expected in case of multiple
inlining call-sites.

Fixes #58437.

Change-Id: Ic344d4c262df548529acdc9380636cb50835ca51
Reviewed-on: https://go-review.googlesource.com/c/go/+/466915
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/cmd/compile/internal/pgo/irgraph.go