]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: sanitize before/after expansion OpSelectN references
authorDavid Chase <drchase@google.com>
Thu, 8 Apr 2021 02:21:35 +0000 (22:21 -0400)
committerDavid Chase <drchase@google.com>
Thu, 8 Apr 2021 15:03:31 +0000 (15:03 +0000)
commit283b02063b470a0f5df7ba99c9fc801d020763ab
tree7a1a5f8f4a71b6597d542933ca612057fc269805
parent1be8be4accf8bc9a625ec96e7655d814c3d5bed1
cmd/compile: sanitize before/after expansion OpSelectN references

In expand_calls, OpSelectN occurs both before and after the rewriting.
Attempting to rewrite a post-expansion OpSelectN is bad.
(The only ones rewritten in place are the ones returning mem;
others are synthesized to replace other selection chains with
register references.)

Updates #40724.
Updates #44816#issuecomment-815258897.

Change-Id: I7b6022cfb47f808d3ce6cc796c067245f36047f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/308309
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/ssa/expand_calls.go
test/abi/bad_select_crash.dir/genCaller42/genCaller42.go [new file with mode: 0644]
test/abi/bad_select_crash.dir/genChecker42/genChecker42.go [new file with mode: 0644]
test/abi/bad_select_crash.dir/genMain.go [new file with mode: 0644]
test/abi/bad_select_crash.dir/genUtils/genUtils.go [new file with mode: 0644]
test/abi/bad_select_crash.dir/go.mod [new file with mode: 0644]
test/abi/bad_select_crash.go [new file with mode: 0644]