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

Handle instantiation of unmanaged class via object literal #1189

Merged
merged 3 commits into from
Apr 1, 2020

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Mar 26, 2020

As reported in #1183 instantiating an unmanaged class from an object literal, like in

@unmanaged
class Foo {
  a: i32;
}

var foo: Foo = { a: 1 };

results in unexpected behavior. Wasn't able to reproduce the issue Wasm Studio produces on current master, but it was indeed trying to retain/release unmanaged memory, which might have been the cause and should be fixed now, along a proper diagnostic when attempting this in --noUnsafe contexts. @jtenner Does this fix the original problem?

@jtenner
Copy link
Contributor

jtenner commented Mar 26, 2020

It looks like it! @DuncanUszkay1 should review this as well.

@jtenner
Copy link
Contributor

jtenner commented Mar 26, 2020

Also, this is going to make instantiating iovecs a bit more ergonomic.

@dcodeIO dcodeIO closed this Mar 26, 2020
@dcodeIO dcodeIO reopened this Mar 26, 2020
@dcodeIO
Copy link
Member Author

dcodeIO commented Mar 27, 2020

Would be great if someone with that issue could validate that the PR indeed fixes the problem :)

@jtenner
Copy link
Contributor

jtenner commented Mar 28, 2020

I yeah tried out Duncan's example and it does work.

@jtenner
Copy link
Contributor

jtenner commented Mar 31, 2020

Any update?

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.

None yet

2 participants