]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix wrong check for b.Controls in isBlockMultiValueExit
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Sat, 28 Aug 2021 07:55:10 +0000 (14:55 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Sat, 28 Aug 2021 16:58:26 +0000 (16:58 +0000)
commit5afa5554289c91706ef6244b24ccf91181123b68
tree982be1af61b9b0cb123f4d2e2abf3a9b1eefd5b0
parentd7a43e89124044f0f468e656ec17a3cc86916b33
cmd/compile: fix wrong check for b.Controls in isBlockMultiValueExit

b.Controls has type [2]*Value, thus len(b.Controls) > 0 is always true.
The right check should be b.Controls[0] != nil, though, this is also
always true, since when we always set control value for BlockRet and
BlockRetJmp when state.exit is called.

Though checkFunc also checks for nil control value of ret/retjmp, but
it happens later after expand_calls pass, so better to be defensive
here, just in case.

Change-Id: Ie4a292a3494dfbf5e6d872cde498703023b84d00
Reviewed-on: https://go-review.googlesource.com/c/go/+/345433
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/expand_calls.go