From cd63b3b8f212e77306226fbbad04963e8731b94a Mon Sep 17 00:00:00 2001 From: TianlongLiang <111852609+TianlongLiang@users.noreply.github.com> Date: Mon, 4 Mar 2024 09:01:40 +0800 Subject: [PATCH] Fix LLVM assertion failure and update CONTRIBUTING.md (#3197) The issue was reported in https://github.com/bytecodealliance/wasm-micro-runtime/issues/3188. --- CONTRIBUTING.md | 2 +- core/iwasm/compilation/aot_llvm.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9210b3de..0e04101d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ We Use Github Flow, So All Code Changes Happen Through Pull Requests. Pull reque Coding Style =============================== Please use [K&R](https://en.wikipedia.org/wiki/Indentation_style#K.26R) coding style, such as 4 spaces for indentation rather than tabs etc. -We suggest use Eclipse like IDE or stable coding format tools to make your code compliant to K&R format. +We suggest using VS Code like IDE or stable coding format tools, like clang-format, to make your code compliant to the customized format(in .clang-format). Report bugs =================== diff --git a/core/iwasm/compilation/aot_llvm.c b/core/iwasm/compilation/aot_llvm.c index c8417e6d..d3f1b7c0 100644 --- a/core/iwasm/compilation/aot_llvm.c +++ b/core/iwasm/compilation/aot_llvm.c @@ -1965,8 +1965,8 @@ aot_set_llvm_basic_types(AOTLLVMTypes *basic_types, LLVMContextRef context, basic_types->intptr_t_ptr_type = basic_types->int64_ptr_type; } - basic_types->gc_ref_type = LLVMPointerType(basic_types->void_type, 0); - basic_types->gc_ref_ptr_type = LLVMPointerType(basic_types->gc_ref_type, 0); + basic_types->gc_ref_type = basic_types->int8_ptr_type; + basic_types->gc_ref_ptr_type = basic_types->int8_pptr_type; return (basic_types->int8_ptr_type && basic_types->int8_pptr_type && basic_types->int16_ptr_type && basic_types->int32_ptr_type