-
Notifications
You must be signed in to change notification settings - Fork 908
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
Fixed lifetime issue in ast transform tests #17292
Fixed lifetime issue in ast transform tests #17292
Conversation
Would it be better to convert this test to use the new approach? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving as a minimal fix, but we should evaluate refactoring the tests to use the new machinery that manages expression lifetimes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified this fixes the debug build gtest error.
yes, that's the right thing to do. I'll do that in another merge request |
/merge |
The ast operation takes references to the expressions. The expression was being copied to a lambda scope and destroyed at the end, leading to a dangling reference.
New code should use the ast tree for constructing complicated expression trees as it handles lifetime management.
Closes #17274
Description
Checklist