Skip to content

Commit 54bed47

Browse files
committed
add comments
1 parent f297e08 commit 54bed47

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

core/iwasm/interpreter/wasm_loader.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,11 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
847847
#else
848848
cur_value.gc_obj = NULL_REF;
849849

850+
/*
851+
* According to the current GC SPEC rules, the heap_type must be
852+
* validated when ref.null is used. It can be an absheaptype,
853+
* or the type C.types[typeidx] must be defined in the context.
854+
*/
850855
if (heap_type >= 0) {
851856
if (!check_type_index(module, module->type_count, heap_type,
852857
error_buf, error_buf_size)) {

0 commit comments

Comments
 (0)