Sfoglia il codice sorgente

Fix type checking for array.copy opcode (#2438)

Xu Jun 2 anni fa
parent
commit
fb8dbc1555
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      core/iwasm/interpreter/wasm_loader.c

+ 4 - 4
core/iwasm/interpreter/wasm_loader.c

@@ -11709,10 +11709,10 @@ re_scan:
                                     &wasm_ref_type,
                                     &wasm_ref_type,
                                     wasm_reftype_struct_size(&wasm_ref_type));
                                     wasm_reftype_struct_size(&wasm_ref_type));
 
 
-                        if (!wasm_reftype_is_subtype_of(
-                                src_ref_type.ref_type, &src_ref_type,
-                                dst_ref_type.ref_type, &dst_ref_type,
-                                module->types, module->type_count)) {
+                        if (!wasm_type_is_subtype_of(
+                                module->types[src_type_idx],
+                                module->types[type_idx], module->types,
+                                module->type_count)) {
                             set_error_buf(error_buf, error_buf_size,
                             set_error_buf(error_buf, error_buf_size,
                                           "type mismatch");
                                           "type mismatch");
                             goto fail;
                             goto fail;