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

Fix drop order for Module fields #2806

Merged
merged 2 commits into from Feb 25, 2022
Merged

Fix drop order for Module fields #2806

merged 2 commits into from Feb 25, 2022

Commits on Feb 24, 2022

  1. Fix drop order for Module fields

    The field ordering here is actually significant because of the drop
    order: we want to drop the artifact before dropping the engine.
    
    The reason for this is that dropping the Artifact will de-register the
    trap handling metadata from the global registry. This must be done before
    the code memory for the artifact is freed (which happens when the store
    is dropped) since there is a chance that this memory could be reused by
    another module which will try to register its own trap information.
    
    Note that in Rust, the drop order for struct fields is from top to
    bottom: the opposite of C++.
    
    In the future, this code should be refactored to properly describe the
    ownership of the code and its metadata.
    
    Fixes #2434
    Amanieu committed Feb 24, 2022
    Copy the full SHA
    feaf483 View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2022

  1. Copy the full SHA
    9c72853 View commit details
    Browse the repository at this point in the history