Refine codes and fix several issues (#1094)

Add aot relocation for ".rodata.str" symbol to support more cases
Fix some coding style issues
Fix aot block/value stack destroy issue
Refine classic/fast interpreter codes
Clear compile warning of libc_builtin_wrapper.c in 32-bit platform
This commit is contained in:
Wenyong Huang
2022-04-18 17:33:30 +08:00
committed by GitHub
parent 2366e8c493
commit d4758d7380
9 changed files with 40 additions and 25 deletions

View File

@ -694,7 +694,7 @@ static inline int64
sign_ext_8_64(int8 val)
{
if (val & 0x80)
return (int64)val | (int64)0xffffffffffffff00;
return (int64)val | (int64)0xffffffffffffff00LL;
return val;
}
@ -702,7 +702,7 @@ static inline int64
sign_ext_16_64(int16 val)
{
if (val & 0x8000)
return (int64)val | (int64)0xffffffffffff0000;
return (int64)val | (int64)0xffffffffffff0000LL;
return val;
}
@ -710,15 +710,19 @@ static inline int64
sign_ext_32_64(int32 val)
{
if (val & (int32)0x80000000)
return (int64)val | (int64)0xffffffff00000000;
return (int64)val | (int64)0xffffffff00000000LL;
return val;
}
static inline void
word_copy(uint32 *dest, uint32 *src, unsigned num)
{
for (; num > 0; num--)
*dest++ = *src++;
if (dest != src) {
/* No overlap buffer */
bh_assert(!((src < dest) && (dest < src + num)));
for (; num > 0; num--)
*dest++ = *src++;
}
}
static inline WASMInterpFrame *
@ -1067,7 +1071,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
{
value_type = *frame_ip++;
param_cell_num = 0;
cell_num = wasm_value_type_cell_num(value_type);
cell_num = 0;
handle_op_loop:
PUSH_CSP(LABEL_TYPE_LOOP, param_cell_num, cell_num, frame_ip);
HANDLE_OP_END();