File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
source/layers/validation/checkers/events_checker Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -559,7 +559,10 @@ void eventsChecker::ZEeventsChecker::checkForDeadlock(
559
559
// Form the dependency in the DAG
560
560
for (uint32_t i = 0 ; i < numWaitEvents; i++) {
561
561
auto it = eventToDagID.find (phWaitEvents[i]);
562
-
562
+ if (it == eventToDagID.end ()) {
563
+ std::cerr << " Warning: phWaitEvents {" << phWaitEvents[i] << " } might be an invalid event in call to " << zeCallDisc << std::endl;
564
+ return ;
565
+ }
563
566
uint32_t dagID = it->second ;
564
567
if (dagID == invalidDagID) {
565
568
// Create a new node in the DAG for this wait event. That action will be created some time in the future.
Original file line number Diff line number Diff line change @@ -56,12 +56,16 @@ class OrderedSet {
56
56
// set.
57
57
void Erase (T value) {
58
58
auto it = value_to_index_.find (value);
59
- assert (it != value_to_index_.end ());
59
+ if (it == value_to_index_.end ()) {
60
+ std::cerr << " Value not found in OrderedSet" << std::endl;
61
+ exit (0 );
62
+ }
60
63
64
+ auto index = it->second ;
61
65
// Since we don't want to move values around in `value_sequence_` we swap
62
66
// the value in the last position and with value to be deleted and then
63
67
// pop_back.
64
- value_to_index_[value_sequence_.back ()] = it-> second ;
68
+ value_to_index_[value_sequence_.back ()] = index ;
65
69
std::swap (value_sequence_[it->second ], value_sequence_.back ());
66
70
value_sequence_.pop_back ();
67
71
value_to_index_.erase (it);
You can’t perform that action at this time.
0 commit comments