Skip to content

fix use-after-free in BridgeJS#690

Merged
kateinoigakukun merged 1 commit intoswiftwasm:mainfrom
untitled-in-brackets:bugfix/fix-use-after-free
Mar 4, 2026
Merged

fix use-after-free in BridgeJS#690
kateinoigakukun merged 1 commit intoswiftwasm:mainfrom
untitled-in-brackets:bugfix/fix-use-after-free

Conversation

@diederich
Copy link
Contributor

We were seeing a use-after-free in BridgeJS, where self got released before _swift_js_retain ran.

I checked the generated WASM w and w/o this and indeed adding withExtendedLifetime fixed the order of the release/retains.

(TBF - I'm not clear why this isn't an issue more generally 😅 )

@kateinoigakukun kateinoigakukun merged commit 0c4c45a into swiftwasm:main Mar 4, 2026
12 checks passed
@diederich
Copy link
Contributor Author

Thank you! 🙏

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