Skip to content
New issue

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

Fix a crash when parsing nested function calls (see added test case). #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sfc-gh-bxin
Copy link

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10f0e78]

goroutine 78 [running]:
testing.tRunner.func1.2({0x1106160, 0x1209f70})
/usr/local/go/src/testing/testing.go:1209 +0x24e
testing.tRunner.func1()
/usr/local/go/src/testing/testing.go:1212 +0x218
panic({0x1106160, 0x1209f70})
/usr/local/go/src/runtime/panic.go:1038 +0x215
github.com/kanmu/go-sqlfmt/sqlfmt/parser.(*Retriever).appendGroupsToResult(0x0)
go-sqlfmt/sqlfmt/parser/retriever.go:94 +0x38
github.com/kanmu/go-sqlfmt/sqlfmt/parser.(*Retriever).Retrieve(0x0)
go-sqlfmt/sqlfmt/parser/retriever.go:79 +0x1e
github.com/kanmu/go-sqlfmt/sqlfmt/parser.ParseTokens({0xc000239b00, 0x11, 0x20})
go-sqlfmt/sqlfmt/parser/parser.go:36 +0x17d

@sfc-gh-bxin
Copy link
Author

@pongzu Reasonable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant