]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: make the stack allocator more careful about register args.
authorDavid Chase <drchase@google.com>
Sat, 24 Apr 2021 01:49:08 +0000 (21:49 -0400)
committerDavid Chase <drchase@google.com>
Mon, 3 May 2021 17:46:12 +0000 (17:46 +0000)
commit90ec25773523ac2c5e075f1e5d7519ee08201b8c
tree769352c6a7649417f79259c29b2aef5bc1769ea0
parentb5842308892e0c4f9e772a42d5826f6f62f57be3
cmd/compile: make the stack allocator more careful about register args.

Assignment between input parameters causes them to have more than
one "Name", and running this backwards from names to values can end
up confusing (conflating) parameter spill slots.

Around 105a6e9518, this cases a stack overflow running
go test -race encoding/pem
because two slice parameters spill (incorrectly) into the same
stack slots (in the AB?I-defined parameter spill area).

This also tickles a failure in cue, which turned out to be
easier to isolate.

Fixes #45851.
Updates #40724.

Change-Id: I39c56815bd6abb652f1ccbe83c47f4f373a125c3
Reviewed-on: https://go-review.googlesource.com/c/go/+/313212
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/ssa/expand_calls.go
src/cmd/compile/internal/ssa/stackalloc.go
test/fixedbugs/issue45851.go [new file with mode: 0644]