Skip to content

Commit

Permalink
[liftoff][arm64] Use 64 bit offset reg in mem op
Browse files Browse the repository at this point in the history
Accessing the Wasm memory with a 64 bit offset was truncated to 32 bit,
which is fine if we check bounds first, but not if we rely on the
trap handler to catch the OOB.

[email protected]

Bug: v8:11587
Change-Id: I82a3a2906e55d9d640c30e770a5c93532e3a442c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2808942
Reviewed-by: Clemens Backes <[email protected]>
Commit-Queue: Thibaud Michaud <[email protected]>
Cr-Commit-Position: refs/heads/master@{#73829}
  • Loading branch information
thibaudmichaud authored and Commit Bot committed Apr 7, 2021
1 parent 5dcd080 commit f645d0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wasm/baseline/arm64/liftoff-assembler-arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ inline MemOperand GetMemOp(LiftoffAssembler* assm,
UseScratchRegisterScope* temps, Register addr,
Register offset, T offset_imm) {
if (offset.is_valid()) {
if (offset_imm == 0) return MemOperand(addr.X(), offset.W(), UXTW);
if (offset_imm == 0) return MemOperand(addr.X(), offset.X());
Register tmp = temps->AcquireX();
DCHECK_GE(kMaxUInt32, offset_imm);
assm->Add(tmp, offset.X(), offset_imm);
Expand Down

0 comments on commit f645d0b

Please sign in to comment.