parent
8d8d801b2f
commit
5c7560bcea
|
@ -56,6 +56,10 @@ impl SectionAddress {
|
|||
}
|
||||
|
||||
pub fn is_aligned(self, align: u32) -> bool { self.address & (align - 1) == 0 }
|
||||
|
||||
pub fn wrapping_add(self, rhs: u32) -> Self {
|
||||
Self { section: self.section, address: self.address.wrapping_add(rhs) }
|
||||
}
|
||||
}
|
||||
|
||||
impl Add<u32> for SectionAddress {
|
||||
|
|
|
@ -208,11 +208,11 @@ impl VM {
|
|||
(
|
||||
GprValue::Address(RelocationTarget::Address(left)),
|
||||
GprValue::Constant(right),
|
||||
) => GprValue::Address(RelocationTarget::Address(left + right)),
|
||||
) => GprValue::Address(RelocationTarget::Address(left.wrapping_add(right))),
|
||||
(
|
||||
GprValue::Constant(left),
|
||||
GprValue::Address(RelocationTarget::Address(right)),
|
||||
) => GprValue::Address(RelocationTarget::Address(right + left)),
|
||||
) => GprValue::Address(RelocationTarget::Address(right.wrapping_add(left))),
|
||||
_ => GprValue::Unknown,
|
||||
};
|
||||
self.gpr[ins.field_rd() as usize].set_direct(value);
|
||||
|
|
Loading…
Reference in New Issue