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 "undefined function" error with mutually-recursive functions #184

Merged
merged 2 commits into from
Jun 5, 2023

Conversation

benhoyt
Copy link
Owner

@benhoyt benhoyt commented Jun 5, 2023

Fix "undefined function" error with mutually-recursive functions

When the AWK code defines mutually-recursive functions, the topological
sort can't help us. So define all funcInfos in the initial call-graph
pass before doing any resolver passes. This avoids the "undefined
function" error in those cases.

Add a minimal test for this, and also add a test of parsing/using the
gron.awk code, as it's a nice, fairly complex test case.

Fixes #183. Thanks @xonixx for the bug report!

benhoyt added 2 commits June 5, 2023 18:12
When the AWK code defines mutually-recursive functions, the topological
sort can't help us. So define all funcInfos in the initial call-graph
pass before doing any resolver passes. This avoids the "undefined
function" error in those cases.

Add a minimal test for this, and also add a test of parsing/using the
gron.awk code, as it's a nice, fairly complex test case.

Fixes #183. Thanks @xonixx for the bug report!
@benhoyt benhoyt merged commit 92e0799 into master Jun 5, 2023
@benhoyt benhoyt deleted the fix-mutual-recursion branch June 5, 2023 23:03
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.

GoAWK 1.23.X fails on gron.awk
1 participant