You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wasmer using the singlepass backend will panic when:
Result of read_table is unwraped even if this result is an Error.
$ ./target/release/wasmer run --backend singlepass panic_unwrap_brtable_singlepass.wasm
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: BinaryReaderError { message: "Invalid var_u32", offset: 4 }', src/libcore/result.rs:1084:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
$ unzip panic_unwrap_brtable_singlepass.zip
$ ./target/release/wasmer run --backend singlepass panic_unwrap_brtable_singlepass.wasm
Expected behavior
wasmer should return and propagate the Error using ?.
Actual behavior
$ ./target/release/wasmer run --backend singlepass panic_unwrap_brtable_singlepass.wasm
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: BinaryReaderError { message: "Invalid var_u32", offset: 4 }', src/libcore/result.rs:1084:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
1052: Fix issue #1051 + replace assert, unreachable in singlepass codegen code r=syrusakbary a=pventuzelo
# Description
This pull request:
- fix the issue #1051
- replace `asserts` by Errors
- replace `unreachable!` by Errors
- Improve Error handling in singlepass codegen code
# Review
- [x] Add a short description of the the change to the CHANGELOG.md file
Co-authored-by: Patrick Ventuzelo <[email protected]>
Co-authored-by: Patrick Ventuzelo <[email protected]>
Describe the bug
wasmer
using thesinglepass
backend will panic when:read_table
is unwraped even if this result is an Error.wasmer/lib/singlepass-backend/src/codegen_x64.rs
Lines 6451 to 6452 in d639748
Status of my environment
version: 71b342e
Steps to reproduce
Download panic_unwrap_brtable_singlepass.zip
Expected behavior
wasmer
should return and propagate the Error using?
.Actual behavior
Additional context
Once fixing patch #1052 applied,
$ ./target/release/wasmer run --backend singlepass panic_unwrap_brtable_singlepass.wasm Error: Can't compile module: InternalError { msg: "Codegen(\"CodegenError { message: \\\"BrTable read_table: BinaryReaderError { message: \\\\\\\"Invalid var_u32\\\\\\\", offset: 4 }\\\" }\")" }
The text was updated successfully, but these errors were encountered: