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

[Mono]: Fix static closed delegate fnptr crash. #68701

Merged

Commits on Apr 29, 2022

  1. Fix static closed delegate fnptr crash.

    When accessing a function pointer to a static closed delegate like
    done in added test:
    
    GetFunctionPointerForDelegate_MarshalledClosedStaticDelegate
    
    it will trigger a read outside of the allocated mspecs buffer since
    invoke_sig and method signature arguments wont match.
    
    There was already logic to adjust this in emit_managed_wrapper_ilgen,
    but done after call to emit_managed_wrapper_validate_signature
    that will touch memory and depending on its content, trigger a crash.
    
    Fix make sure we do signature adjustments first and then validate
    the signature. Fix also adjust a couple of mspecs allocations to use
    g_new0 as all others to make sure we get NULL pointers in the mspecs
    array.
    
    Since this scenario was not covered on CI, commit also adds a new test
    in GetFunctionPointerForDelegateTests.cs covering this scenario.
    lateralusX committed Apr 29, 2022
    Configuration menu
    Copy the full SHA
    eeb2b9b View commit details
    Browse the repository at this point in the history

Commits on May 2, 2022

  1. Disable tests on WASM.

    lateralusX committed May 2, 2022
    Configuration menu
    Copy the full SHA
    601e8fc View commit details
    Browse the repository at this point in the history