Repository navigation
Throw a JetdbError, not a plain Error, on misuse of a freed Database - #180
Merged
Merged
Conversation
CoverageFor 4185f69. |
- Hold the database in an Option that our own free() takes, which wasm-bindgen writes after its generated free(), so that it is the free() of the class and Symbol.dispose - Let free() be called more than once and together with using, and throw DATABASE_FREED from a method called after it - Document DATABASE_FREED, and test double free, using with free, and calls after free Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
dominion525
force-pushed
the
fix/wasm-free-twice
branch
from
October 26, 2026 18:19
6229c8e to
4185f69
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
free()twice, calling it inside ausingblock, or calling a method after it threw a plainError: null pointer passed to rustfrom the wasm-bindgen glue.free()may now be called more than once and together withusing; a method called after it throws aJetdbErrorwith the new codeDATABASE_FREED.Optionthat our ownfree()takes. wasm-bindgen writes it after the generatedfree(), so it is thefree()of the class andSymbol.dispose; generated code is not changed. wasm-bindgen is pinned, and the smoke test fails if a later version writes the methods in another order.DATABASE_FREED.🤖 Generated with Claude Code