x/tools/go/ssa: ssa.EnclosingFunction panic #59428
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Source Code:
parser.go: https://go.dev/play/p/P-kZ6j7Eq7R
async_pool.go: https://go.dev/play/p/hVneLr-mMLI
Build parser.go and run, program will read async_pool.go, and crashes occasionally.
I think the problem is here:
https://github.com/golang/tools/blob/d5076cc64d484da83963b1ae098aef830c21c448/go/ssa/source.go#L112-L128
Here, the iteration order of the map may be inconsistent. If the outer struct(
AsyncPoolProcessor
) is iterated first, a new *types.Func will be generated, and its address is different.What did you expect to see?
No panic.
What did you see instead?
Panic
The text was updated successfully, but these errors were encountered: