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 segfault with gensym node instantiation #24050

Merged
merged 1 commit into from
Sep 3, 2024
Merged

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Sep 2, 2024

fixes #24048

Generic lambdas get instantiated via replaceTypesInBody which calls replaceTypeVarsN on the body of the lambda. This body can contain sym nodes of gensym symbols generated by macros, which have nil type. But a piece of code in replaceTypeVarsN checks whether the type of a symbol is equal to void without checking if it's nil first, which causes a segfault. Now it also checks that the type of the symbol isn't nil for it to be void.

@Araq Araq merged commit d27061f into nim-lang:devel Sep 3, 2024
17 of 19 checks passed
Copy link
Contributor

github-actions bot commented Sep 3, 2024

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from d27061f

Hint: mm: orc; opt: speed; options: -d:release
174003 lines; 8.758s; 655.379MiB peakmem

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.

Macro generating lambda containing ident("auto") and genSym causes SIGSEGV
2 participants