bitwuzla / ocaml-bitwuzla

Bitwuzla SMT solver repackaged for convenient use in opam.
MIT License
6 stars 3 forks source link

Recover from exceptions during placement new #5

Closed smuenzel closed 9 months ago

smuenzel commented 9 months ago

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 commented 9 months ago

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.