diff --git a/core/iwasm/interpreter/wasm_interp_fast.c b/core/iwasm/interpreter/wasm_interp_fast.c index 9e9d33810..f00358f32 100644 --- a/core/iwasm/interpreter/wasm_interp_fast.c +++ b/core/iwasm/interpreter/wasm_interp_fast.c @@ -534,13 +534,16 @@ read_leb(const uint8 *buf, uint32 *p_offset, uint32 maxbits, bool sign) #if WASM_CPU_SUPPORTS_UNALIGNED_64BIT_ACCESS != 0 #define DEF_OP_NUMERIC_64 DEF_OP_NUMERIC #else -#define DEF_OP_NUMERIC_64(src_type1, src_type2, src_op_type, operation) do {\ - src_type1 val1; \ - src_type2 val2; \ - val1 = (src_type1)GET_##src_op_type##_FROM_ADDR(frame_ip + 2); \ - val2 = (src_type2)GET_##src_op_type##_FROM_ADDR(frame_ip); \ - val1 operation##= val2; \ - PUT_##src_op_type##_TO_ADDR(frame_ip + 4, val1); \ +#define DEF_OP_NUMERIC_64(src_type1, src_type2, src_op_type, operation) do { \ + src_type1 val1; \ + src_type2 val2; \ + val1 = \ + (src_type1)GET_##src_op_type##_FROM_ADDR(frame_lp + (*(int16*)(frame_ip + 2))); \ + val2 = \ + (src_type2)GET_##src_op_type##_FROM_ADDR(frame_lp + (*(int16*)(frame_ip))); \ + val1 operation##= val2; \ + PUT_##src_op_type##_TO_ADDR(frame_lp + (*(int16*)(frame_ip + 4)), val1); \ + frame_ip += 6; \ } while (0) #endif diff --git a/core/iwasm/interpreter/wasm_loader.c b/core/iwasm/interpreter/wasm_loader.c index 42da5be16..32b2fed8c 100644 --- a/core/iwasm/interpreter/wasm_loader.c +++ b/core/iwasm/interpreter/wasm_loader.c @@ -3054,7 +3054,8 @@ wasm_loader_get_const_offset(WASMLoaderContext *ctx, uint8 type, } c->slot_index = operand_offset; ctx->num_const ++; - LOG_OP("#### new const [%d]: %ld\n", num_const, (int64)val); + LOG_OP("#### new const [%d]: %ld\n", + ctx->num_const, (int64)c->value.i64); } /* use negetive index for const */ operand_offset = -(operand_offset + 1); @@ -4300,7 +4301,8 @@ handle_next_reachable_block: #if WASM_ENABLE_FAST_INTERP != 0 skip_label(); disable_emit = true; - f64 = *(float64 *)p_org; + /* Some MCU may require 8-byte align */ + memcpy((uint8*)&f64, p_org, sizeof(float64)); GET_CONST_F64_OFFSET(VALUE_TYPE_F64, f64); #endif PUSH_F64();