diff --git a/core/iwasm/interpreter/wasm_interp_classic.c b/core/iwasm/interpreter/wasm_interp_classic.c index 419d6d49..0bfa02fc 100644 --- a/core/iwasm/interpreter/wasm_interp_classic.c +++ b/core/iwasm/interpreter/wasm_interp_classic.c @@ -3389,6 +3389,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, CHECK_BULK_MEMORY_OVERFLOW(addr + offset, 1, maddr); CHECK_ATOMIC_MEMORY_ACCESS(); + expect = (uint8)expect; os_mutex_lock(&memory->mem_lock); readv = (uint32)(*(uint8 *)maddr); if (readv == expect) @@ -3399,6 +3400,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, CHECK_BULK_MEMORY_OVERFLOW(addr + offset, 2, maddr); CHECK_ATOMIC_MEMORY_ACCESS(); + expect = (uint16)expect; os_mutex_lock(&memory->mem_lock); readv = (uint32)LOAD_U16(maddr); if (readv == expect) @@ -3433,6 +3435,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, CHECK_BULK_MEMORY_OVERFLOW(addr + offset, 1, maddr); CHECK_ATOMIC_MEMORY_ACCESS(); + expect = (uint8)expect; os_mutex_lock(&memory->mem_lock); readv = (uint64)(*(uint8 *)maddr); if (readv == expect) @@ -3443,6 +3446,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, CHECK_BULK_MEMORY_OVERFLOW(addr + offset, 2, maddr); CHECK_ATOMIC_MEMORY_ACCESS(); + expect = (uint16)expect; os_mutex_lock(&memory->mem_lock); readv = (uint64)LOAD_U16(maddr); if (readv == expect) @@ -3453,6 +3457,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, CHECK_BULK_MEMORY_OVERFLOW(addr + offset, 4, maddr); CHECK_ATOMIC_MEMORY_ACCESS(); + expect = (uint32)expect; os_mutex_lock(&memory->mem_lock); readv = (uint64)LOAD_U32(maddr); if (readv == expect) diff --git a/core/iwasm/interpreter/wasm_interp_fast.c b/core/iwasm/interpreter/wasm_interp_fast.c index 9bb57021..0b567137 100644 --- a/core/iwasm/interpreter/wasm_interp_fast.c +++ b/core/iwasm/interpreter/wasm_interp_fast.c @@ -3308,6 +3308,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, CHECK_BULK_MEMORY_OVERFLOW(addr + offset, 1, maddr); CHECK_ATOMIC_MEMORY_ACCESS(1); + expect = (uint8)expect; os_mutex_lock(&memory->mem_lock); readv = (uint32)(*(uint8 *)maddr); if (readv == expect) @@ -3318,6 +3319,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, CHECK_BULK_MEMORY_OVERFLOW(addr + offset, 2, maddr); CHECK_ATOMIC_MEMORY_ACCESS(2); + expect = (uint16)expect; os_mutex_lock(&memory->mem_lock); readv = (uint32)LOAD_U16(maddr); if (readv == expect) @@ -3352,6 +3354,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, CHECK_BULK_MEMORY_OVERFLOW(addr + offset, 1, maddr); CHECK_ATOMIC_MEMORY_ACCESS(1); + expect = (uint8)expect; os_mutex_lock(&memory->mem_lock); readv = (uint64)(*(uint8 *)maddr); if (readv == expect) @@ -3362,6 +3365,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, CHECK_BULK_MEMORY_OVERFLOW(addr + offset, 2, maddr); CHECK_ATOMIC_MEMORY_ACCESS(2); + expect = (uint16)expect; os_mutex_lock(&memory->mem_lock); readv = (uint64)LOAD_U16(maddr); if (readv == expect) @@ -3372,6 +3376,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, CHECK_BULK_MEMORY_OVERFLOW(addr + offset, 4, maddr); CHECK_ATOMIC_MEMORY_ACCESS(4); + expect = (uint32)expect; os_mutex_lock(&memory->mem_lock); readv = (uint64)LOAD_U32(maddr); if (readv == expect)