-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Infinite recursion (stack overflow) calling trait function on tuples #5504
Labels
P: critical
Should be looked at before anything else
Comments
esdrubal
added a commit
that referenced
this issue
Jan 24, 2024
ReplaceDecls, CollectTypesMetadata, HashWithEngines now have a mechanism that interrupts recursive visiting. The mechanism works by adding TypeIds or DeclIds to a HashMap or HashSet and no longer visiting TypeIds or DeclIds on the passed collection. This was necessary because in some cases while visiting a declaration we can go back to the beginning because of recursive DeclIds. I suspect these changes will also be useful to #3018 This partially fixes #5504, which is still failing because we have yet to fix a recursion problem in the IR side of the compiler.
7 tasks
So with #5515, ReplaceDecls, CollectTypesMetadata, HashWithEngines now have a mechanism that interrupts recursive visiting. But we still have a recursion problem in the IR side of the compiler. |
esdrubal
added a commit
that referenced
this issue
Jan 24, 2024
ReplaceDecls, CollectTypesMetadata, HashWithEngines now have a mechanism that interrupts recursive visiting. The mechanism works by adding TypeIds or DeclIds to a HashMap or HashSet and no longer visiting TypeIds or DeclIds on the passed collection. This was necessary because in some cases while visiting a declaration we can go back to the beginning because of recursive DeclIds. I suspect these changes will also be useful to #3018 This partially fixes #5504, which is still failing because we have yet to fix a recursion problem in the IR side of the compiler.
esdrubal
added a commit
that referenced
this issue
Jan 25, 2024
ReplaceDecls, CollectTypesMetadata, HashWithEngines now have a mechanism that interrupts recursive visiting. The mechanism works by adding TypeIds or DeclIds to a HashMap or HashSet and no longer visiting TypeIds or DeclIds on the passed collection. This was necessary because in some cases while visiting a declaration we can go back to the beginning because of recursive DeclIds. I suspect these changes will also be useful to #3018 This partially fixes #5504, which is still failing because we have yet to fix a recursion problem in the IR side of the compiler.
esdrubal
added a commit
that referenced
this issue
Feb 2, 2024
`ReplaceDecls` was using an hack to replace some function refs based on the self fuction parameter this didn't work for associated methods. Now DeclMapping sources also contain a typeid this guarantees that the replacement is done to the correct declaration in case we have nested trait methods with the same name replaced. Fixes #5504
7 tasks
esdrubal
added a commit
that referenced
this issue
Feb 2, 2024
`ReplaceDecls` was using a hack to replace some function refs based on the self function parameter didn't work for associated methods. Now DeclMapping sources also contain a typeid that guarantees that the replacement is done to the correct declaration in case we have nested trait methods with the same name replaced. Fixes #5504
esdrubal
added a commit
that referenced
this issue
Feb 2, 2024
`ReplaceDecls` was using a hack to replace some function refs based on the self function parameter, this didn't work for associated functions. Now DeclMapping sources also contain a typeid that guarantees that the replacement is done to the correct declaration in case we have nested trait methods with the same name replaced. Fixes #5504
IGI-111
pushed a commit
that referenced
this issue
Feb 5, 2024
`ReplaceDecls` was using a hack to replace some function refs based on the self function parameter, this didn't work for associated functions. Now DeclMapping sources also contain a typeid that guarantees that the replacement is done to the correct declaration in case we have nested trait methods with the same name replaced. Fixes #5504 ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [x] I have added tests that prove my fix is effective or that my feature works. - [x] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. Co-authored-by: Joshua Batty <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I managed to reproduce this problem with this minimal example on
master
.The first interesting code in the stack is at
sway-core/src/language/ty/expression/expression_variant.rs:784
(all the others frames in our codebase point to compiler derivedclone()
s)The text was updated successfully, but these errors were encountered: