-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Bug in Embedded/ARC/WebAssembly combination? #73768
Comments
Re-testing with
It seems odd the
Still getting a free before use. |
I'll take another look. Seems like a different issue. |
@turbolent #74152 fixed the remaining issue here. I verified with the generated IR that the
|
@meg-gupta Great, thank you! I'll test again with the next trunk toolchain |
I can confirm that the tests look good now with
Thank you again for fixing these issues! |
Description
I'm seeing some strange behaviour when using classes/ARC in WebAssembly/Embedded (might be unrelated):
In some cases calls to
deinit
seem to be missing, and in some cases,deinit
seems to be called before a last use of the instance.Reproduction
Missing deinit
gets compiled to (pseudo-code produced by
wasm-decompile
):Why is the call to
foo_c
indeinit
missing?Deinit before last use
gets compiled to:
Note the order: Why is
bar_free
called beforebar_use
?Is this expected? If so, how so? If not, are these bugs? They might not be related to WebAssembly or Embedded at all, it is just the combination I'm trying out and can easily reproduce locally.
Expected behavior
I had assumed that the results are:
and
Environment
Swift version 6.0-dev (LLVM cef183591317ec7, Swift 66e311074bff491)
/swift-DEVELOPMENT-SNAPSHOT-2024-05-15-a-ubuntu22.04
, and the following flags in thePackage.swift
file:Additional information
Asked about this in the forum https://forums.swift.org/t/bug-in-embedded-arc-webassembly-combination/71967.
@kubamracek asked me to open a bug report
The text was updated successfully, but these errors were encountered: