From d0e0b15947b1714adb3851c5302d8a2e8b7917c7 Mon Sep 17 00:00:00 2001 From: TL Date: Thu, 24 Aug 2023 14:59:11 +0800 Subject: [PATCH] some update --- core/iwasm/compilation/aot_compiler.c | 2 ++ core/iwasm/compilation/aot_emit_gc.c | 4 ++-- core/iwasm/interpreter/wasm_runtime.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/iwasm/compilation/aot_compiler.c b/core/iwasm/compilation/aot_compiler.c index 6fd8cf9686..b04ae70b54 100644 --- a/core/iwasm/compilation/aot_compiler.c +++ b/core/iwasm/compilation/aot_compiler.c @@ -638,6 +638,8 @@ aot_compile_func(AOTCompContext *comp_ctx, uint32 func_index) read_leb_uint32(frame_ip, frame_ip_end, type_index); if (opcode == WASM_OP_ARRAY_NEW_CANON_FIXED) read_leb_uint32(frame_ip, frame_ip_end, array_len); + else + array_len = 0; if (!aot_compile_op_array_new( comp_ctx, func_ctx, type_index, opcode == WASM_OP_ARRAY_NEW_CANON_DEFAULT, diff --git a/core/iwasm/compilation/aot_emit_gc.c b/core/iwasm/compilation/aot_emit_gc.c index 4611d49a15..22f1720034 100644 --- a/core/iwasm/compilation/aot_emit_gc.c +++ b/core/iwasm/compilation/aot_emit_gc.c @@ -858,8 +858,8 @@ aot_compile_op_array_new_data(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx, uint32 type_index, uint32 data_seg_index) { - LLVMValueRef array_length, data_seg_offset, rtt_type, elem_size, array_elem, - array_obj, cmp; + LLVMValueRef array_length, data_seg_offset, rtt_type, + elem_size = NULL, array_elem, array_obj, cmp; LLVMBasicBlockRef check_rtt_type_succ, check_array_obj_succ; /* Use for distinguish what type of element in array */ WASMArrayType *compile_time_array_type = diff --git a/core/iwasm/interpreter/wasm_runtime.c b/core/iwasm/interpreter/wasm_runtime.c index e7acaedfe1..eb16ba6e92 100644 --- a/core/iwasm/interpreter/wasm_runtime.c +++ b/core/iwasm/interpreter/wasm_runtime.c @@ -3764,7 +3764,7 @@ llvm_jit_rtt_type_new(WASMModuleInstance *module_inst, uint32 type_index) korp_mutex *rtt_type_lock = &module->rtt_type_lock; return wasm_rtt_type_new(defined_type, type_index, rtt_types, - rtt_type_count, &module->rtt_type_lock); + rtt_type_count, rtt_type_lock); } #endif /* end of WASM_ENABLE_GC != 0 */