wasm-micro-runtime/core
Wenyong Huang 313ce8cb61
Fix memory/table segment checks in memory.init/table.init (#3081)
According to the wasm core spec, the checks for the table segments in
`table.init` opcode are similar to the checks for `memory.init` opcode:
- The size of a passive segment is shrunk to zero after `data.drop`
  (or `elem.drop`) opcode is executed, and the segment can be used to do
  `memory.init` (or `table.init`) again
- The `memory.init` only traps when `s+n > len(data.data)` or `d+n > len(mem.data)`
  and `table.init` only traps when `s+n > len(elem.elem)` or `d+n > len(tab.elem)`
- The active segment can also be used to do `memory.init` (or `table.init`),
  while it behaves like a dropped passive segment

https://github.com/WebAssembly/bulk-memory-operations/blob/master/proposals/bulk-memory-operations/Overview.md
```
Segments can also be shrunk to size zero by using the following new instructions:
- data.drop: discard the data in an data segment
- elem.drop: discard the data in an element segment

An active segment is equivalent to a passive segment, but with an implicit
memory.init followed by a data.drop (or table.init followed by a elem.drop)
that is prepended to the module's start function.
```
ps.
https://webassembly.github.io/spec/core/bikeshed/#-hrefsyntax-instr-memorymathsfmemoryinitx%E2%91%A0
https://webassembly.github.io/spec/core/bikeshed/#-hrefsyntax-instr-tablemathsftableinitxy%E2%91%A0
https://github.com/bytecodealliance/wasm-micro-runtime/issues/3020
2024-01-26 09:45:59 +08:00
..
app-framework Readme refactoring (#2038) 2023-03-19 08:05:57 +08:00
app-mgr Corrects Zephyr include files for current versions of Zephyr (#2881) 2023-12-08 17:16:16 +08:00
deps wasi-nn: Simplify cmake and headers' location (#2308) 2023-06-26 09:29:05 +08:00
iwasm Fix memory/table segment checks in memory.init/table.init (#3081) 2024-01-26 09:45:59 +08:00
shared cosmopolitan: Update compiler and update platform_internal.h (#3079) 2024-01-24 16:04:48 +08:00
config.h Add flag to control Winsocket initialization (#3060) 2024-01-22 07:33:26 +08:00
version.h Update version number to 1.3.1 and update release notes (#2999) 2024-01-12 11:31:01 +08:00