1
0
mirror of https://github.com/golang/go synced 2024-10-04 21:21:22 -06:00
go/src/cmd
Tal Shprecher 24967ec122 cmd/compile: make enqueued map keys fail validation on forward types
Map keys are currently validated in multiple locations but share
a common validation routine. The problem is that early validations
should be lenient enough to allow for forward types while the final
validations should not. The final validations should fail on forward
types since they've already settled.

This change also separates the key type checking from the creation
of the map via typMap. Instead of the mapqueue being populated in
copytype() by checking the map line number, it's populated in the
same block that validates the key type. This isolates key validation
logic while type checking.

Fixes #14988

Change-Id: Ia47cf6213585d6c63b3a35249104c0439feae658
Reviewed-on: https://go-review.googlesource.com/21830
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-04-13 08:43:12 +00:00
..
addr2line cmd/addr2line: simplify windows test 2015-06-17 14:23:20 +00:00
api all: delete dead non-test code 2016-03-25 06:28:13 +00:00
asm cmd/internal/obj/s390x: add MULHD instruction 2016-04-11 18:53:36 +00:00
cgo cmd/cgo: fix cgo with gccgo 2016-04-08 23:27:33 +00:00
compile cmd/compile: make enqueued map keys fail validation on forward types 2016-04-13 08:43:12 +00:00
cover all: single space after period. 2016-03-02 00:13:47 +00:00
dist cmd/compile/internal/s390x: add s390x support 2016-04-12 14:38:17 +00:00
doc all: delete dead non-test code 2016-03-25 06:28:13 +00:00
fix all: single space after period. 2016-03-02 00:13:47 +00:00
go cmd/go: fix vcsFromDir returning bad root on Windows 2016-04-12 06:25:45 +00:00
gofmt cmd/gofmt: make gofmt -s simplify slices in presence of dot-imports 2016-04-06 18:19:33 +00:00
internal cmd/internal/obj: remove unused Pciter type 2016-04-12 22:12:42 +00:00
link cmd/link: move function only lsym fields to pcln struct 2016-04-13 00:23:45 +00:00
nm all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
objdump cmd/objdump: skip TestDisasm* on s390x 2016-04-12 18:10:47 +00:00
pack cmd/pack,vet: use go doc instead of godoc in doc 2016-03-17 21:06:40 +00:00
pprof cmd/pprof/internal: move to cmd/internal/pprof 2016-04-12 15:02:28 +00:00
trace internal/trace: support parsing of 1.5 traces 2016-04-11 17:56:44 +00:00
vet cmd/vet: improve documentation for flags, slightly 2016-04-11 22:35:22 +00:00
yacc all: delete dead non-test code 2016-03-25 06:28:13 +00:00