Fix wasm loader check data segment count (#3492)
When datacount section exists, loader will check whether the data count read from data segment section is same with the data count read from datacount section, but the value of latter can be 0, loader should not skip the check when the latter is 0. This fixes #3491. And fix handle_name_section return value not checked issue and early return true issue after handle_name_section. And also add the failed case in #3491 to ba-issues.
This commit is contained in:
@ -912,7 +912,7 @@
|
||||
"options": "",
|
||||
"argument": "",
|
||||
"expected return": {
|
||||
"ret code": 57,
|
||||
"ret code": 8,
|
||||
"stdout content": "",
|
||||
"description": "sock_shutdown on a non-socket file descriptor should fail with 57 notsock"
|
||||
}
|
||||
@ -1706,6 +1706,22 @@
|
||||
"stdout content": "WASM module load failed: unknown type",
|
||||
"description": "no '0x0:i64'"
|
||||
}
|
||||
},
|
||||
{
|
||||
"deprecated": false,
|
||||
"ids": [
|
||||
3491
|
||||
],
|
||||
"runtime": "iwasm-default-wasi-disabled",
|
||||
"file": "nop_0LM_592_17171016522810388.wasm",
|
||||
"mode": "fast-interp",
|
||||
"options": "",
|
||||
"argument": "",
|
||||
"expected return": {
|
||||
"ret code": 255,
|
||||
"stdout content": "WASM module load failed: data count and data section have inconsistent lengths",
|
||||
"description": "Check data segment count"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user