Fix llvm jit push funcref/externref result type issue (#3169)

When dealing with non-gc enabled funcref/externref, need to make sure
to push them as i32 type.
This commit is contained in:
TianlongLiang 2024-02-21 12:15:18 +08:00 committed by GitHub
parent 63cd567b3f
commit 58c980c4df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -569,6 +569,10 @@ set_local_gc_ref(AOTCompFrame *frame, int n, LLVMValueRef value, uint8 ref_type)
memset(aot_value, 0, sizeof(AOTValue)); \
if (comp_ctx->enable_gc && aot_is_type_gc_reftype(value_type)) \
aot_value->type = VALUE_TYPE_GC_REF; \
else if (comp_ctx->enable_ref_types \
&& (value_type == VALUE_TYPE_FUNCREF \
|| value_type == VALUE_TYPE_EXTERNREF)) \
aot_value->type = VALUE_TYPE_I32; \
else \
aot_value->type = value_type; \
aot_value->value = llvm_value; \

View File

@ -1102,7 +1102,7 @@ jit_compile_op_br_if(JitCompContext *cc, uint32 br_depth,
}
}
/* Only opy parameters or results when their count > 0 and
/* Only copy parameters or results when their count > 0 and
the src/dst addr are different */
copy_arities = check_copy_arities(block_dst, jit_frame);