Skip to content

Commit 46c9482

Browse files
JBYoshiJonathanWoollett-Light
authored andcommitted
ARM64: Update types for (in)equality checks
For equalities and inequalities, we can change the types on each side to always convert to the larger type, which ensures all conversions are safe. I've done this in a separate commit because my dev setup doesn't use ARM. In case something ARM-specific breaks in CI, I'd like to be able to keep those changes in their own commit so I can debug more easily. Signed-off-by: Jonathan Browne <[email protected]>
1 parent 7eb076a commit 46c9482

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vmm/src/arch/aarch64/regs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ mod tests {
843843

844844
let reg_ref: Aarch64RegisterRef = (&old_reg).try_into().unwrap();
845845
assert_eq!(old_reg.id, reg_ref.id);
846-
assert_eq!(old_reg.data as u64, reg_ref.value::<u64, 8>());
846+
assert_eq!(old_reg.data, u128::from(reg_ref.value::<u64, 8>()));
847847

848848
let old_reg = Aarch64RegisterOld {
849849
id: KVM_REG_SIZE_U256,
@@ -870,7 +870,7 @@ mod tests {
870870

871871
let reg: Aarch64RegisterOld = reg_ref.try_into().unwrap();
872872
assert_eq!(reg.id, reg_ref.id);
873-
assert_eq!(reg.data as u64, reg_ref.value::<u64, 8>());
873+
assert_eq!(reg.data, u128::from(reg_ref.value::<u64, 8>()));
874874

875875
let reg_ref = Aarch64RegisterRef::new(KVM_REG_SIZE_U256, &[0_u8; 32]);
876876

0 commit comments

Comments
 (0)