wasm-micro-runtime/core
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
..
deps Separate app-manager and app-framework from WAMR (#3129) 2024-02-20 18:12:36 +08:00
iwasm add heap-type check for GC when ref.null (#4300) 2025-06-12 09:31:17 +08:00
shared initialize WASI stdio handles to invalid for better error handling (#4092) 2025-05-08 08:47:07 +08:00
config.h feat: Add instruction metering for interpreter (#4122) 2025-05-26 16:16:42 +08:00
version.h Bump version to 2.3.1 and update release notes (#4303) 2025-06-02 10:45:50 +08:00
version.h.in Add version.h and update versioning documentation for embedded platforms 2025-02-05 10:31:20 +00:00