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:
Wenyong Huang
2024-05-31 11:32:36 +08:00
committed by GitHub
parent 67638e24f4
commit 23e1d51587
7 changed files with 139 additions and 32 deletions

View File

@ -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'"
}
}
]
}