ssadump doesn't set NeedModule, which causes go/types.Config.GoVersion to not be set, which means go/ssa won't respect the Go version set in go.mod, which is relevant for the scope of range loop variables.
Related: https://github.com/golang/go/issues/48226#issuecomment-1954523281
/cc @adonovan @timothy-king
Comment From: adonovan
@timothy-king Presumably this is an issue for all our tools that use either go/types or go/ssa: they all need to set NeedModules in order that they process source files using the module's appropriate language version.
If so, this seems to warrant a more general fix than just to cmd/ssadump.
Comment From: gopherbot
Change https://go.dev/cl/597875 mentions this issue: go/packages: NeedTypes implies NeedModule