Skip to content

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

Open
sfc-gh-bxin wants to merge 1 commit intokanmu:masterfrom
sfc-gh-bxin:fix_nested_func_crash
Open

Fix a crash when parsing nested function calls (see added test case).#28
sfc-gh-bxin wants to merge 1 commit intokanmu:masterfrom
sfc-gh-bxin:fix_nested_func_crash

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?

@noneymous
Copy link

This repository seems to be abandoned, so I've created a fork, applied some patches and restructured and cleaned-up the whole code. Hope it is an improvement for some, might improve it further...

https://github.com/noneymous/go-sqlfmt

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.

2 participants