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

Still alive for issue #2168 #3960

Closed
cyk2018 opened this issue May 14, 2024 · 2 comments
Closed

Still alive for issue #2168 #3960

cyk2018 opened this issue May 14, 2024 · 2 comments
Labels

Comments

@cyk2018
Copy link

cyk2018 commented May 14, 2024

Describe the Bug

null pointer for auto free.

Steps to Reproduce

  1. following the step in thie issue

Expected Behavior

May be two 42 in console?
I follow one article written by this author, and I find that the result in console still throw null pointer exception.

Additional Context

I found the "the_answer" function has been fixed like this:

        const ptr = this.__destroy_into_raw();
        const ret = wasm.answer_the_answer(ptr);
        return ret >>> 0;

but the "__destroy_into_raw" function will work like this:

        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        AnswerFinalization.unregister(this);
        return ptr;

and the "__wbg_ptr" will be 0 when second-call.

@cyk2018 cyk2018 added the bug label May 14, 2024
@cyk2018
Copy link
Author

cyk2018 commented May 14, 2024

@alexcrichton may be you can check this problem? Thanks!

@daxpedda
Copy link
Collaborator

Closing in favor of #2168.

@daxpedda daxpedda closed this as not planned Won't fix, can't repro, duplicate, stale Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants