Skip to content

Conversation

ChAoSUnItY
Copy link
Collaborator

@ChAoSUnItY ChAoSUnItY commented Sep 11, 2025

Phi instructions in SSA unit is previously allocated via builtin
malloc, and wasn't freeing after SSA unit completed. Later, we
replaced allocator with arena allocator, which guaranteed its lifetime
is within the compilation, thus the TODO comment is removed as resolved.

Close #275.


Summary by cubic

Enable LeakSanitizer in the sanitizer build to catch memory leaks during compiler tests. Adds -fsanitize=leak to CFLAGS/LDFLAGS and removes a stale TODO about freeing SSA phi instruction memory.

Phi instructions in SSA unit is previously allocated via builtin
malloc, and wasn't freeing after SSA unit completed. Later, we
replaced allocator with arena allocator, which guaranteed its lifetime
is within the compilation, thus the TODO comment is removed as resolved.

Close sysprog21#275.
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@ChAoSUnItY ChAoSUnItY changed the title Enable leak sanitizer for memory leak detection Cleanup stale TODO comments Sep 11, 2025
@jserv jserv merged commit f265042 into sysprog21:master Sep 11, 2025
6 checks passed
@jserv
Copy link
Collaborator

jserv commented Sep 11, 2025

Thank @ChAoSUnItY for contributing!

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.

Memory leak: Phi instructions not released in SSA construction
2 participants