Skip to content

Commit

Permalink
Remove memory bound checks
Browse files Browse the repository at this point in the history
  • Loading branch information
haoyu-zc committed Nov 20, 2023
1 parent 099b6d6 commit b13608f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/engine/v3/V3Interpreter.v3
Original file line number Diff line number Diff line change
Expand Up @@ -1206,8 +1206,6 @@ component V3Interpreter {
var memarg = codeptr.read_MemArg();
var memory = frame.func.instance.memories[memarg.memory_index];
var index = popm(memory);
if (!u32.?(index)) return trap(TrapReason.MEM_OUT_OF_BOUNDS);
if (!u32.?(memarg.offset)) return trap(TrapReason.MEM_OUT_OF_BOUNDS);
// Decode immediate
var idx = codeptr.read1();
// Extract lane
Expand All @@ -1222,7 +1220,7 @@ component V3Interpreter {
val = view(high >> shift);
}
// Write to memory
var t = memory.range_oil_32(u32.!(memarg.offset), u32.!(index), size);
var t = memory.range_oil_64(memarg.offset, index, size);
if (t.reason != TrapReason.NONE) trap(t.reason);
else write(t.result, val);
}
Expand Down

0 comments on commit b13608f

Please sign in to comment.