We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go version
$ go version go version go1.21rc2 darwin/arm64
go env
$ go env GO111MODULE='' GOARCH='arm64' GOBIN='' GOCACHE='/Users/geange/Library/Caches/go-build' GOENV='/Users/geange/Library/Application Support/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='arm64' GOHOSTOS='darwin' GOINSECURE='' GOMODCACHE='/Users/geange/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='darwin' GOPATH='/Users/geange/go' GOPRIVATE='' GOPROXY='https://goproxy.cn,direct' GOROOT='/Users/geange/sdk/go1.21rc2' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/Users/geange/sdk/go1.21rc2/pkg/tool/darwin_arm64' GOVCS='' GOVERSION='go1.21rc2' GCCGO='gccgo' AR='ar' CC='clang' CXX='clang++' CGO_ENABLED='1' GOMOD='/dev/null' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/v6/w_fsm5xx1j14j0mrzs9czbt00000gn/T/go-build2508803663=/tmp/go-build -gno-record-gcc-switches -fno-common'
go1.21rc2 install github.com/geange/lucene-go/example/core/search/query@4adfbe8341bf4ec5a590ebd5564f6b9c2fcbfcf9
the source code like that:
type BooleanQuery struct { minimumNumberShouldMatch int clauses []*BooleanClause clauseSets map[Occur][]Query } func (b *BooleanQuery) Rewrite(reader index.IndexReader) (Query, error) { if len(b.clauses) == 0 { return nil, errors.New("empty BooleanQuery") } .... }
when I change the code like that is ok
func (b *BooleanQuery) Rewrite(reader index.IndexReader) (Query, error) { if b.clauses != nil { return nil, errors.New("empty BooleanQuery") } if len(b.clauses) == 0 { return nil, errors.New("empty BooleanQuery") } .... }
build success
go: downloading github.com/geange/lucene-go v0.0.0-20230625143616-4adfbe8341bf # github.com/geange/lucene-go/core/search go/pkg/mod/github.com/geange/lucene-go@v0.0.0-20230625143616-4adfbe8341bf/core/search/boolean_query.go:42:23: internal compiler error: '(*BooleanQuery).Rewrite': panic during nilcheckelim while compiling (*BooleanQuery).Rewrite: runtime error: invalid memory address or nil pointer dereference goroutine 1824 [running]: cmd/compile/internal/ssa.Compile.func1() cmd/compile/internal/ssa/compile.go:49 +0x6c panic({0x104ad1180?, 0x104ffdf60?}) runtime/panic.go:914 +0x218 cmd/compile/internal/ssa.storeOrder(...) cmd/compile/internal/ssa/schedule.go:387 cmd/compile/internal/ssa.nilcheckelim(0x140048c5040) cmd/compile/internal/ssa/nilcheck.go:114 +0x110c cmd/compile/internal/ssa.Compile(0x140048c5040) cmd/compile/internal/ssa/compile.go:97 +0x898 cmd/compile/internal/ssagen.buildssa(0x14001c15a20, 0x1) cmd/compile/internal/ssagen/ssa.go:568 +0x2390 cmd/compile/internal/ssagen.Compile(0x14001c15a20, 0x14000491be8?) cmd/compile/internal/ssagen/pgen.go:187 +0x34 cmd/compile/internal/gc.compileFunctions.func5.1(0x14002af5c10?) cmd/compile/internal/gc/compile.go:184 +0x3c cmd/compile/internal/gc.compileFunctions.func3.1() cmd/compile/internal/gc/compile.go:166 +0x3c created by cmd/compile/internal/gc.compileFunctions.func3 in goroutine 124 cmd/compile/internal/gc/compile.go:165 +0x1d8 Please file a bug report including a short program that triggers the error. https://go.dev/issue/new
The text was updated successfully, but these errors were encountered:
CC @randall77 @golang/runtime
Sorry, something went wrong.
Duplicated with #60982
This was fixed in a031f4e
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
the source code like that:
when I change the code like that is ok
What did you expect to see?
build success
What did you see instead?
The text was updated successfully, but these errors were encountered: