Skip to content
This repository was archived by the owner on Dec 26, 2025. It is now read-only.
This repository was archived by the owner on Dec 26, 2025. It is now read-only.

panic in checkUnaryExpr #3

@choleraehyq

Description

@choleraehyq
➜  exportloopref ./...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x10eb0a9]

goroutine 6091 [running]:
go/ast.(*Object).Pos(0x0, 0xc002801aa0)
        /Users/cholerae/Documents/gopath/go1.15beta1/src/go/ast/scope.go:93 +0x29
github.com/kyoh86/exportloopref.(*Searcher).checkUnaryExpr(0xc008910bf8, 0xc002801ac0, 0xc0056ec500, 0xd, 0x10, 0x0, 0x12c4a01)
        /Users/cholerae/Documents/gocode/exportloopref/exportloopref.go:172 +0xbf
github.com/kyoh86/exportloopref.(*Searcher).Check(0xc008910bf8, 0x136b840, 0xc002801ac0, 0xc0056ec500, 0xd, 0x10, 0x0, 0x1)
        /Users/cholerae/Documents/gocode/exportloopref/exportloopref.go:71 +0xd1
github.com/kyoh86/exportloopref.run.func1(0x136b840, 0xc002801ac0, 0x1, 0xc0056ec500, 0xd, 0x10, 0x1)
        /Users/cholerae/Documents/gocode/exportloopref/exportloopref.go:43 +0x75
golang.org/x/tools/go/ast/inspector.(*Inspector).WithStack(0xc00891c380, 0xc008910c80, 0x5, 0x5, 0xc008910c08)
        /Users/cholerae/Documents/gopath/pkg/mod/golang.org/x/[email protected]/go/ast/inspector/inspector.go:126 +0x142
github.com/kyoh86/exportloopref.run(0xc00891a5a0, 0xc0089164e0, 0x14d1cc0, 0xc008942388, 0xc0012d1dc0)
        /Users/cholerae/Documents/gocode/exportloopref/exportloopref.go:42 +0x273
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0035defa0)
        /Users/cholerae/Documents/gopath/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:658 +0x75f
sync.(*Once).doSlow(0xc0035defa0, 0xc0012d1f90)
        /Users/cholerae/Documents/gopath/go1.15beta1/src/sync/once.go:66 +0xec
sync.(*Once).Do(...)
        /Users/cholerae/Documents/gopath/go1.15beta1/src/sync/once.go:57
golang.org/x/tools/go/analysis/internal/checker.(*action).exec(0xc0035defa0)
        /Users/cholerae/Documents/gopath/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:577 +0x65
golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0xc0035defa0)
        /Users/cholerae/Documents/gopath/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:565 +0x34
created by golang.org/x/tools/go/analysis/internal/checker.execAll
        /Users/cholerae/Documents/gopath/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:571 +0x125
➜  exportloopref -V     
exportloopref: unsupported flag value: -V=true

I'm using 619c505 this version. My code itself can be compiled successfully but exportloopref panic. I'm trying to extract a minimal production.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions