wasm-micro-runtime/core/iwasm
Liu Jia 928598f1ce
add heap-type check for GC when ref.null (#4300)
- According to [Link 1](https://webassembly.github.io/gc/core/valid/instructions.html#xref-syntax-instructions-syntax-instr-ref-mathsf-ref-null-mathit-ht), we must ensure that the heap type is valid when ref.null.
- According to [Link 2](https://webassembly.github.io/gc/core/valid/types.html#heap-types), a heap type is considered valid if it is either a concrete heap type or an abstract heap type.

However, in this function, the check for abstract heap types (absheaptype) was clearly missing, so this condition needs to be added explicitly in the if statement.

- When GC is disabled, no change is needed.
- When GC is enabled, heap types in WAMR are LEB-encoded values ([Link 3](https://webassembly.github.io/gc/core/appendix/index-types.html)). Therefore, we must use read_leb_int32 to parse the heap type correctly. And we can compute the original type1 using type1 = (uint8)((int32)0x80 + heap_type);.
2025-06-12 09:31:17 +08:00
..
aot updating WASI stdio handle initialization and build options for UVWASI (#4260) 2025-05-30 07:42:39 +08:00
common updating WASI stdio handle initialization and build options for UVWASI (#4260) 2025-05-30 07:42:39 +08:00
compilation Enable aot memory64 sw bounds checks by default (#4350) 2025-06-12 08:44:45 +08:00
doc Fix some more spelling issues (#3393) 2024-05-08 09:30:29 +08:00
fast-jit Keep fix the CMake compatibility issue (#4180) 2025-04-15 12:51:19 +08:00
include feat: Add instruction metering for interpreter (#4122) 2025-05-26 16:16:42 +08:00
interpreter add heap-type check for GC when ref.null (#4300) 2025-06-12 09:31:17 +08:00
libraries wasi_nn_types.h: remove a seemingly stale comment (#4348) 2025-06-12 09:29:59 +08:00
README.md Add architecture diagram for wasm globals and classic-interp stack frame (#2058) 2023-03-25 09:39:20 +08:00