]> Cypherpunks repositories - gostls13.git/commit
[dev.regabi] cmd/compile: make ir.OuterValue safer
authorMatthew Dempsky <mdempsky@google.com>
Tue, 5 Jan 2021 11:28:06 +0000 (03:28 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 5 Jan 2021 14:03:51 +0000 (14:03 +0000)
commit9aa950c40789223d9e8df7d1ec657cd313e6c7aa
tree52fc185da6c7a2e831aaef268d4f15d8d01cf946
parenteb626409d152caabac418eccbe86b49d1fc6a6f5
[dev.regabi] cmd/compile: make ir.OuterValue safer

For OINDEX expressions, ir.OuterValue depends on knowing the indexee's
type. Rather than silently acting as though it's not an array, make it
loudly fail.

The only code that needs to be fixed to support this is checkassign
during typechecking, which needs to avoid calling ir.OuterValue now if
typechecking the assigned operand already failed.

Passes toolstash -cmp.

Change-Id: I935cae0dacc837202bc6b63164dc2f0a6fde005c
Reviewed-on: https://go-review.googlesource.com/c/go/+/281539
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/ir/node.go
src/cmd/compile/internal/typecheck/typecheck.go