bytecodealliance / bytecodealliance/wasmtime

cranelift-reader: ParseError { location: Location { line_number: 9 }, message: "expected block header", is_warning: false }

Open
#9,149 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

When I used cranelift-reader to read the functions of Cranelift IR, the following error occurred:
```
parsing error: ParseError { location: Location { line_number: 9 }, message: "expected block header", is_warning: false }
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:652
1: core::panicking::panic_fmt
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\panicking.rs:72
2: core::result::unwrap_failed
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\result.rs:1679
3: enum2$,cranelift_reader::error::ParseError> >::expect,cranelift_reader::err
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\core\src\result.rs:1059
4: ir_serde::main
at .\src\bin\ir_serde.rs:27
5: core::ops::function::FnOnce::call_once,anyhow::Error> > (*)(),tuple$<> >
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
```
And the error is caused by this line of code:
```
let ir_funcs = parse_functions(&ir_str).expect("parsing error");
```
[wasm_func_27.zip](https://github.com/user-attachments/files/16667431/wasm_func_27.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.