wasm-micro-runtime/core/iwasm/interpreter
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
..
iwasm_interp.cmake Implement wasm mini loader and refine footprint of loader and runtime (#276) 2020-06-08 11:19:09 +08:00
SConscript add porting codes of rt-thread (#494) 2021-01-14 11:26:35 +08:00
wasm_interp_classic.c feat: Add instruction metering for interpreter (#4122) 2025-05-26 16:16:42 +08:00
wasm_interp_fast.c feat: Add instruction metering for interpreter (#4122) 2025-05-26 16:16:42 +08:00
wasm_interp.h Calculate func_index instead of adding an extra field to wasm frame 2025-01-28 11:09:32 +00:00
wasm_loader.c add heap-type check for GC when ref.null (#4300) 2025-06-12 09:31:17 +08:00
wasm_loader.h Enhance wasm loading with LoadArgs and support module names (#3265) 2024-04-07 15:04:35 +08:00
wasm_mini_loader.c updating WASI stdio handle initialization and build options for UVWASI (#4260) 2025-05-30 07:42:39 +08:00
wasm_opcode.h Add select 128 (#4236) 2025-05-14 12:35:56 +08:00
wasm_runtime.c fix false native stack overflow detections with HW_BOUND_CHECK (#4196) 2025-04-15 11:48:48 +08:00
wasm_runtime.h address comments 2025-02-27 14:32:17 +00:00
wasm.h Enhance type checking for function types in loader and improve error handling (#4294) 2025-05-28 20:29:09 +08:00