Open
Description
I tried this code:
pub extern "C-unwind" fn gzgetc() -> i32 {
42
}
pub extern "C-unwind" fn gzgetc_() -> i32 {
gzgetc()
}
fn main() {
for gzgetc_fn in [gzgetc, gzgetc_] {
// gzgetc on a null file handle should return -1.
assert_eq!(gzgetc_fn(), -1);
}
}
compiled for wasm32-wasip1 or wasm32-unknown-unknown without -Ctarget-feature=exception-handling
.
I expected to see this happen: No exception handling instructions emitted
Instead, this happened: catch_call
is emitted for gzgetc_fn()
when opt-level < 2.
Meta
rustc --version --verbose
: Both 1.86 and nightly
This is causing failure to run on Wasmtime in some cases: trifectatechfoundation/zlib-rs#352 (comment)