tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

compiler crash on defer inside range-over-func

Open ALTree opened this issue 1 year ago • 0 comments

$ tinygo version
tinygo version 0.33.0 linux/amd64 (using go version go1.23.0 and LLVM version 18.1.2)
package main

func main() {
	for range func(func() bool) {} {
		defer func() {}()
	}
}
$ tinygo build crash.go
panic: *ssa.opaqueType: deferStack

goroutine 10 [running]:
golang.org/x/tools/go/types/typeutil.Hasher.hashFor({0xc000585650?, 0xc000585680?, 0x0?}, {0x6524780?, 0x866af40?})
	/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:375 +0x58c
golang.org/x/tools/go/types/typeutil.Hasher.Hash({0xc000585650?, 0xc000585680?, 0x0?}, {0x6524780, 0x866af40})
	/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:240 +0x75
golang.org/x/tools/go/types/typeutil.Hasher.hashFor({0xc000585650?, 0xc000585680?, 0x0?}, {0x6523da8?, 0x866af30})
	/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:286 +0x165
golang.org/x/tools/go/types/typeutil.Hasher.Hash({0xc000585650?, 0xc000585680?, 0x0?}, {0x6523da8, 0x866af30})

[...]

ALTree avatar Aug 28 '24 11:08 ALTree