You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% ssadump -build=FSL a.go
build package p
build global initializer [var _ map[*p.S]bool] @ a.go:5:9
build package p end
panic: in p.init: cannot convert *t0 (p.S) to *p.S
go/ssa: fix crash when building map[*struct{}]bool{{}: true}
Since Go 1.5, if a key expression in a map literal is itself a composite
literal, the type may be omitted. An & operation may be implied,
but was not generated, resulting in a type mismatch crash.
Added regression test.
Also, added missing intrinsic math.hasSSE4 to interpreter.
Fixes issue 13341
Change-Id: I6a5e560460cdcac295a500a3fc3738cbe8aa5853
Reviewed-on: https://go-review.googlesource.com/17123
Reviewed-by: Robert Griesemer <gri@golang.org>
% cat a.go
package p
type S struct{}
var _ = map[*S]bool{{}: true}
% ssadump -build=FSL a.go
build package p
build global initializer [var _ map[*p.S]bool] @ a.go:5:9
build package p end
panic: in p.init: cannot convert *t0 (p.S) to *p.S
goroutine 1 [running]:
golang.org/x/tools/go/ssa.emitConv(0xc8200e6000, 0x7f481dde8920, 0xc8200ce360, 0x7f481dde84a8, 0xc8200be280, 0x0, 0x0)
golang.org/x/tools/go/ssa/emit.go:243 +0xc6d
golang.org/x/tools/go/ssa.(_builder).compLit(0xc8200e3627, 0xc8200e6000, 0x7f481dde8c80, 0xc8200ce2a0, 0xc8200ba280, 0xc8200d0601, 0xc8200e2bf8)
golang.org/x/tools/go/ssa/builder.go:1199 +0x1d96
golang.org/x/tools/go/ssa.(_builder).addr(0xc8200e3627, 0xc8200e6000, 0x7f481dde8270, 0xc8200ba280, 0x78a000, 0x0, 0x0)
golang.org/x/tools/go/ssa/builder.go:361 +0x67f
golang.org/x/tools/go/ssa.(_builder).expr0(0xc8200e3627, 0xc8200e6000, 0x7f481dde8270, 0xc8200ba280, 0x411107, 0x7f481dde8478, 0xc8200c4260, 0x0, 0x0, 0x0, ...)
golang.org/x/tools/go/ssa/builder.go:782 +0x772
golang.org/x/tools/go/ssa.(_builder).expr(0xc8200e3627, 0xc8200e6000, 0x7f481dde8270, 0xc8200ba280, 0x0, 0x0)
golang.org/x/tools/go/ssa/builder.go:531 +0x3b8
golang.org/x/tools/go/ssa.(_builder).assign(0xc8200e3627, 0xc8200e6000, 0x7f481dde8bf0, 0x97d1c8, 0x7f481dde8270, 0xc8200ba280, 0x97d101, 0x0)
golang.org/x/tools/go/ssa/builder.go:503 +0x442
golang.org/x/tools/go/ssa.(_Package).build(0xc8200ce120)
golang.org/x/tools/go/ssa/builder.go:2310 +0x133c
golang.org/x/tools/go/ssa.(_Package).(golang.org/x/tools/go/ssa.build)-fm()
golang.org/x/tools/go/ssa/builder.go:2244 +0x20
sync.(_Once).Do(0xc8200ce14c, 0xc8200e3b38)
/usr/local/google/home/adonovan/go/src/sync/once.go:44 +0xe4
golang.org/x/tools/go/ssa.(*Package).Build(0xc8200ce120)
golang.org/x/tools/go/ssa/builder.go:2244 +0x45
main.doMain(0x0, 0x0)
golang.org/x/tools/cmd/ssadump/main.go:145 +0x965
main.main()
golang.org/x/tools/cmd/ssadump/main.go:71 +0x24
The text was updated successfully, but these errors were encountered: