1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-04-10 22:37:30 +00:00

Avoid potential out-of-bounds access.

This commit is contained in:
Thomas Harte 2025-03-18 20:23:31 -04:00
parent 15da707324
commit b654c2e170

View File

@ -99,7 +99,7 @@ void Bus::run_for(HalfCycles time) {
const auto old_index = dispatch_index_;
const auto time_as_int = time_in_state_.as_integral();
while(time_as_int >= dispatch_times_[dispatch_index_] && dispatch_index_ < dispatch_times_.size()) {
while(dispatch_index_ < dispatch_times_.size() && time_as_int >= dispatch_times_[dispatch_index_]) {
++dispatch_index_;
}