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

Recover from exceptions during placement new #5

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

smuenzel
Copy link
Contributor

@smuenzel smuenzel commented Oct 1, 2023

When an exception occurs when running the constructor during placement new, modify the allocated block so it won't try to run the delete operation. When an exception was raised, it means that the block was allocated, but not initialized, so running a destructor will result in invalid operations. We can't "unallocate" the block, so the finalizer is modified to be a no-op.

Closes #3

@recoules
Copy link
Collaborator

recoules commented Oct 4, 2023

Hi @smuenzel,

Thank you, I did not anticipate this behavior.
This PR looks good to me and made me realize that this binding misses tests for misuse cases.

@recoules recoules merged commit 47a30d5 into bitwuzla:master Oct 4, 2023
6 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.

Tracking of sort lifetimes is incomplete, leads to multiple frees
2 participants