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

Load pointer and length of a list before creating the block for the deallocation loop. #997

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

primoly
Copy link
Contributor

@primoly primoly commented Jul 6, 2024

Currently the block for the deallocation loop gets generated before the pointer and the length of the list.

In the haskell generator this leads to the problem where the variables that store the pointer/length are pushed to the inner block rather than the outer one (since I always just push all code to the last block on the “block-stack”) making them inaccessible for the loop setup itself. Both Rust and C do not store the pointer/length in variables, just pushing the code to load them onto the results directly.

This solves that issue by simply getting them before the inner block is created. I don’t think this will break any other generators, tho I can’t test most of them on my machine.

Alternatively I could keep track of the current active block manually rather than assuming it’s the last one but I would prefer this solution instead if possible.

@primoly primoly marked this pull request as ready for review July 6, 2024 16:27
@alexcrichton
Copy link
Member

Seems reasonable to me, thanks! The CI failures should be fixed by #998

@alexcrichton
Copy link
Member

If you're up for rebasing this it should pass CI now and I can queue for merge

@primoly primoly force-pushed the ptrlen-before-block branch from 255ae25 to 6b824e5 Compare July 8, 2024 15:55
@alexcrichton alexcrichton enabled auto-merge July 8, 2024 16:00
@alexcrichton alexcrichton added this pull request to the merge queue Jul 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 8, 2024
@alexcrichton alexcrichton added this pull request to the merge queue Jul 8, 2024
Merged via the queue into bytecodealliance:main with commit 0bc43bd Jul 8, 2024
25 checks passed
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.

2 participants