Skip to content

Commit e85c521

Browse files
tiifRalfJung
andcommitted
Checked add for duration update
Co-authored-by: Ralf Jung <post@ralfj.de>
1 parent d0fb350 commit e85c521

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/miri/src/clock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl Clock {
102102
ClockKind::Virtual { nanoseconds } => {
103103
// Just pretend that we have slept for some time.
104104
let nanos: u128 = duration.as_nanos();
105-
nanoseconds.update(|x| x + nanos);
105+
nanoseconds.update(|x| x.checked_add(nanos).expect("Miri's virtual clock cannot represent an execution this long"));
106106
}
107107
}
108108
}

0 commit comments

Comments
 (0)