Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove nested code blocks (Sonar).
[simgrid.git] / src / mc / explo / odpor / ReversibleRaceCalculator.cpp
index 68d9eadbdfb9c1ce36d362ae96cca2352f494312..f2db6b6b9a22642c3bdcfb3d6b61e85fe5a229e4 100644 (file)
@@ -41,19 +41,17 @@ bool ReversibleRaceCalculator::is_race_reversible(const Execution& E, Execution:
                  {Action::TESTANY, &ReversibleRaceCalculator::is_race_reversible_TestAny},
                  {Action::WAITANY, &ReversibleRaceCalculator::is_race_reversible_WaitAny}};
 
-  const auto e2_action = E.get_transition_for_handle(e2);
+  const auto* e2_action = E.get_transition_for_handle(e2);
   if (const auto handler = handlers.find(e2_action->type_); handler != handlers.end()) {
     return handler->second(E, e1, e2_action);
   } else {
-    xbt_assert(false,
-               "There is currently no specialized computation for the transition "
-               "'%s' for computing reversible races in ODPOR, so the model checker cannot "
-               "determine how to proceed. Please submit a bug report requesting "
-               "that the transition be supported in SimGrid using ODPPR and consider "
-               "using the other model-checking algorithms supported by SimGrid instead "
-               "in the meantime",
-               e2_action->to_string().c_str());
-    DIE_IMPOSSIBLE;
+    xbt_die("There is currently no specialized computation for the transition "
+            "'%s' for computing reversible races in ODPOR, so the model checker cannot "
+            "determine how to proceed. Please submit a bug report requesting "
+            "that the transition be supported in SimGrid using ODPPR and consider "
+            "using the other model-checking algorithms supported by SimGrid instead "
+            "in the meantime",
+            e2_action->to_string().c_str());
   }
 }
 
@@ -102,7 +100,7 @@ bool ReversibleRaceCalculator::is_race_reversible_CommWait(const Execution& E, E
   // If the other event is a communication event, then we
   // are not reversible; otherwise we are reversible.
   const auto e1_action = E.get_transition_for_handle(e1)->type_;
-  return e1_action != Transition::Type::COMM_ASYNC_SEND and e1_action != Transition::Type::COMM_ASYNC_RECV;
+  return e1_action != Transition::Type::COMM_ASYNC_SEND && e1_action != Transition::Type::COMM_ASYNC_RECV;
 }
 
 bool ReversibleRaceCalculator::is_race_reversible_CommTest(const Execution&, Execution::EventHandle e1,
@@ -145,7 +143,7 @@ bool ReversibleRaceCalculator::is_race_reversible_MutexWait(const Execution& E,
 {
   // TODO: Get the semantics correct here
   const auto e1_action = E.get_transition_for_handle(e1)->type_;
-  return e1_action != Transition::Type::MUTEX_ASYNC_LOCK and e1_action != Transition::Type::MUTEX_UNLOCK;
+  return e1_action != Transition::Type::MUTEX_ASYNC_LOCK && e1_action != Transition::Type::MUTEX_UNLOCK;
 }
 
 bool ReversibleRaceCalculator::is_race_reversible_SemAsyncLock(const Execution&, Execution::EventHandle e1,
@@ -198,4 +196,4 @@ bool ReversibleRaceCalculator::is_race_reversible_WaitAny(const Execution&, Exec
   return false;
 }
 
-} // namespace simgrid::mc::odpor
\ No newline at end of file
+} // namespace simgrid::mc::odpor