Summary
When running go-mutesting on a Go 1.21+ project, the tool panics with a nil pointer dereference due to an uninitialized Sizes field in go/types.Config.
Steps to Reproduce
- Use Go 1.21 or 1.22
- Install and run
go-mutesting:
panic: runtime error: invalid memory address or nil pointer dereference
go/types.(*StdSizes).Sizeof(0x0, ...)
Root Cause
In analyzer/analyzer.go, the types.Config struct is instantiated without setting the Sizes field:
Suggested Fix
Set the Sizes field using the appropriate call:
Importer: importer,
Sizes: types.SizesFor("gc", build.Default.GOARCH),
}