mirror of https://github.com/icedland/iced.git
Use wrapping_sub and update expr
This commit is contained in:
parent
af14398080
commit
b4d7c67fae
|
@ -63,7 +63,7 @@ impl Block {
|
|||
if self.valid_data.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
for _ in 0..self.valid_data_address_aligned - self.valid_data_address {
|
||||
for _ in 0..self.valid_data_address_aligned.wrapping_sub(self.valid_data_address) {
|
||||
self.encoder.write_byte_internal(0xCC);
|
||||
}
|
||||
match self.alignment {
|
||||
|
|
|
@ -42,7 +42,8 @@ pub(super) trait Instr {
|
|||
}
|
||||
|
||||
fn correct_diff(in_block: bool, diff: i64, gained: u64) -> i64 {
|
||||
if in_block && diff >= gained as i64 {
|
||||
if in_block && diff >= 0 {
|
||||
debug_assert!(diff as u64 >= gained);
|
||||
diff - gained as i64
|
||||
} else {
|
||||
diff
|
||||
|
|
Loading…
Reference in New Issue