Commit 0bf6c87b authored by Joey Gouly's avatar Joey Gouly Committed by Commit Bot

[ubsan][arm64] Fixed a left shift of negative value error

This is similar to the change made to IsImmLSPair in
9f7ae50a.

Change-Id: I17a7cc95661542efb5711df0639cc11ac7926702
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1971950
Commit-Queue: Joey Gouly <joey.gouly@arm.com>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65501}
parent 843e467f
......@@ -1013,7 +1013,8 @@ Instr Assembler::ImmLS(int imm9) {
}
Instr Assembler::ImmLSPair(int imm7, unsigned size) {
DCHECK_EQ((imm7 >> size) << size, imm7);
DCHECK_EQ(imm7,
static_cast<int>(static_cast<uint32_t>(imm7 >> size) << size));
int scaled_imm7 = imm7 >> size;
DCHECK(is_int7(scaled_imm7));
return truncate_to_int7(scaled_imm7) << ImmLSPair_offset;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment