wasmtime icon indicating copy to clipboard operation
wasmtime copied to clipboard

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

Open abc767234318 opened this issue 6 months ago • 3 comments

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$<core::result::Result<alloc::vec::Vec<cranelift_codegen::ir::function::Function,alloc::alloc::Global>,cranelift_reader::error::ParseError> >::expect<alloc::vec::Vec<cranelift_codegen::ir::function::Fun
ction,alloc::alloc::Global>,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<enum2$<core::result::Result<tuple$<>,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

abc767234318 avatar Aug 20 '24 01:08 abc767234318