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

Structs cannot escape the function they are defined in #176

Closed
Champii opened this issue Aug 25, 2023 · 1 comment
Closed

Structs cannot escape the function they are defined in #176

Champii opened this issue Aug 25, 2023 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@Champii
Copy link
Owner

Champii commented Aug 25, 2023

Structs are built using alloca statements and thus are deallocated when the function returns.
This is obviously UB and should be mitigated by allocating them on the heap.
This would require either to allow for explicit heap allocation/deallocation like new/free or to have a proper lifetime checker to transparently do these operations.

@Champii Champii added bug Something isn't working enhancement New feature or request labels Aug 25, 2023
@Champii Champii mentioned this issue Aug 25, 2023
@Champii
Copy link
Owner Author

Champii commented Sep 2, 2023

This has been implemented in #179 but only the allocation part.
Will need #180 to properly deallocate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

1 participant