Fix loader parse block type and calculate dynamic offset for loop args (#3482)
Fix several issues in wasm loader: - Parse a block's type index with leb int32 instead leb uint32 - Correct dst dynamic offset of loop block arguments for opcode br when copying the stack operands to the arguments of loop block - Free each frame_csp's param_frame_offsets when destroy loader ctx - Fix compilation error in wasm_mini_loader.c - Add test cases of failed issues This PR fixes issue #3467 and #3468.
This commit is contained in:
BIN
tests/regression/ba-issues/issues/issue-3467/tt_unreachable.wasm
Normal file
BIN
tests/regression/ba-issues/issues/issue-3467/tt_unreachable.wasm
Normal file
Binary file not shown.
BIN
tests/regression/ba-issues/issues/issue-3468/i64.add.wasm
Normal file
BIN
tests/regression/ba-issues/issues/issue-3468/i64.add.wasm
Normal file
Binary file not shown.
@ -1674,6 +1674,38 @@
|
||||
"stdout content": "Hello from Kotlin via WASI\nCurrent 'realtime' timestamp is:",
|
||||
"description": "no 'type mismatch: expect (ref null ht) but got other1 unknown type'"
|
||||
}
|
||||
},
|
||||
{
|
||||
"deprecated": false,
|
||||
"ids": [
|
||||
3467
|
||||
],
|
||||
"runtime": "iwasm-default-wasi-disabled",
|
||||
"file": "tt_unreachable.wasm",
|
||||
"mode": "fast-interp",
|
||||
"options": "--heap-size=0 -f to_test",
|
||||
"argument": "",
|
||||
"expected return": {
|
||||
"ret code": 1,
|
||||
"stdout content": "Exception: unreachable",
|
||||
"description": "no '-1.861157e+19:f32'"
|
||||
}
|
||||
},
|
||||
{
|
||||
"deprecated": false,
|
||||
"ids": [
|
||||
3468
|
||||
],
|
||||
"runtime": "iwasm-default-wasi-disabled",
|
||||
"file": "i64.add.wasm",
|
||||
"mode": "fast-interp",
|
||||
"options": "--heap-size=0 -f to_test",
|
||||
"argument": "",
|
||||
"expected return": {
|
||||
"ret code": 255,
|
||||
"stdout content": "WASM module load failed: unknown type",
|
||||
"description": "no '0x0:i64'"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user