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
What steps will reproduce the problem?
1.
create x.go
package main
func main() {
_ := new(int)
}
2.
run gofmt -r 'new(a) -> make(*a)'
What is the expected output? What do you see instead?
It should do the rewrite; instead it crashes
panic: runtime error: invalid memory address or nil pointer dereference
panic PC=0x313718
runtime.panic+0xb2 /Users/r/go/src/pkg/runtime/proc.c:1015
runtime.panic(0x0, 0x3006a8)
panicstring+0x69 /Users/r/go/src/pkg/runtime/runtime.c:83
panicstring(0x8eeb0, 0x332090)
sigpanic+0x148 /Users/r/go/src/pkg/runtime/darwin/thread.c:460
sigpanic()
reflect.*PtrValue·PointTo+0x27 /Users/r/go/src/pkg/reflect/value.go:1062
reflect.*PtrValue·PointTo(0x0, 0x4fd74, 0x32c5e0, 0xb7e01)
main.subst+0x338 /Users/r/go/src/cmd/gofmt/rewrite.go:227
main.subst(0x32c600, 0x0, 0x0, 0x3249c0, 0x32c3e0, ...)
...
Please use labels and text to provide additional information.
This is at head.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: