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

sys: use process::abort() instead of arch::wasm32::unreachable() #81530

Merged

Commits on Jan 29, 2021

  1. sys: use process::abort() instead of arch::wasm32::unreachable()

    Rationale:
    
      - `abort()` lowers to `wasm32::unreachable()` anyway.
      - `abort()` isn't `unsafe`.
      - `abort()` matches the comment better.
      - `abort()` avoids confusion by future readers (e.g.
        rust-lang#81527): the naming of wasm's
        `unreachable' instruction is a bit unfortunate because it is not
        related to the `unreachable()` intrinsic (intended to trigger UB).
    
    Codegen is likely to be different since `unreachable()` is `inline`
    while `abort()` is `cold`. Since it doesn't look like we are expecting
    here to trigger this case, the latter seems better anyway.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    c7f4154 View commit details
    Browse the repository at this point in the history