-
Notifications
You must be signed in to change notification settings - Fork 372
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 memory leak in ASTvariable_declaration #1576
Conversation
4398e8c
to
4b1114f
Compare
This look ok? |
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.
LGTM
Though the fact that this node sometimes owns the memory and sometimes does not seems a bit confusing.
Would there be a way to rig this to use unique_ptr? Or is the pointer potentially valid but non-owning in some cases?
If it puts it into the symbol table (which it does if it's not metadata), this pointer is non-owning and the symbol table itself is responsible for deleting it. But for metadata, this is the only pointer to it. Let me take another look at this, maybe there is a more clear way to organize it to not be so confusing. |
Signed-off-by: Larry Gritz <lg@larrygritz.com>
@fpsunflower I pushed an update. Do you think this makes the logic clearer? |
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.
I like it!
…#1576) * Fix memory leak in ASTvariable_declaration Signed-off-by: Larry Gritz <lg@larrygritz.com>
* Bug fix: assigning init-op param its default value as instance got lost (AcademySoftwareFoundation#1578) * Fix oslc memory leak in ASTvariable_declaration (AcademySoftwareFoundation#1576) See merge request spi/dev/3rd-party/osl-feedstock!32
No description provided.