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

wasm-snip --snip-rust-panicking-code should not target std::panicking::panicking() #133

Open
nwoods-cimpress opened this issue Nov 2, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@nwoods-cimpress
Copy link

Motivation

std::panicking::panicking() is a simple function that checks to see if the current thread is panicking. Looking at the wasm-snip source code, it appears that this will be targeted by this pattern when --snip-rust-panicking-code is used:

options.patterns.push(r#".*std\.\.panicking\.\..*"#.into());

It is unfortunate because this function is called by std::thread::panicking(); a function extensively used by tokio

Proposed Solution

Omit this particular function from the patterns, or somehow snip this particular function to always return false

@nwoods-cimpress nwoods-cimpress added the enhancement New feature or request label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant