wasm-micro-runtime/core/iwasm/aot
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
..
arch aot_reloc_x86_64.c: Suggest to try --size-level=0 as well (#3067) 2024-01-23 13:00:19 +08:00
debug Fix aot large model (--size-level=0) with LLVM 18 (#3057) 2024-01-19 19:43:41 +08:00
aot_intrinsic.c Add "--enable-builtin-intrinsics=<flags>" option to wamrc (#2341) 2023-07-06 18:20:35 +08:00
aot_intrinsic.h Implement i32.div_s (#1792) 2022-12-13 10:48:51 +08:00
aot_loader.c Fix inconsistent code style in aot_loader.c (#3082) 2024-01-25 17:19:14 +08:00
aot_reloc.h Refine AOT/JIT code call wasm-c-api import process (#2982) 2024-01-10 18:37:02 +08:00
aot_runtime.c Fix memory/table segment checks in memory.init/table.init (#3081) 2024-01-26 09:45:59 +08:00
aot_runtime.h Enhancements on wasm function execution time statistic (#2985) 2024-01-17 09:51:54 +08:00
iwasm_aot.cmake Fix windows AOT hw bound check (#2475) 2023-08-18 10:16:03 +08:00
SConscript Add ia32 support and fix compiling issue for RT-Thread (#730) 2021-09-07 10:20:14 +08:00