ソースを参照

Fix memory.init opcode issue in fast-interp (#2798)

Fix fast interpreter didn't throw OOB exception correctly in some scenarios.
Reported in #2797.
TianlongLiang 2 年 前
コミット
a57e70016a
1 ファイル変更2 行追加2 行削除
  1. 2 2
      core/iwasm/interpreter/wasm_interp_fast.c

+ 2 - 2
core/iwasm/interpreter/wasm_interp_fast.c

@@ -2989,8 +2989,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
 
                         segment = read_uint32(frame_ip);
 
-                        bytes = (uint64)POP_I32();
-                        offset = (uint64)POP_I32();
+                        bytes = (uint64)(uint32)POP_I32();
+                        offset = (uint64)(uint32)POP_I32();
                         addr = POP_I32();
 
 #if WASM_ENABLE_THREAD_MGR