Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix bound checking.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 19 Apr 2021 20:28:41 +0000 (22:28 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 19 Apr 2021 20:50:16 +0000 (22:50 +0200)
src/kernel/routing/NetZoneImpl.cpp

index bec7fb8..cd92db9 100644 (file)
@@ -372,7 +372,7 @@ bool NetZoneImpl::get_bypass_route(NetPoint* src, NetPoint* dst,
   std::pair<kernel::routing::NetPoint*, kernel::routing::NetPoint*> key;
   // Search for a bypass with the given indices. Returns true if found. Initialize variables `bypassedRoute' and `key'.
   auto lookup = [&bypassedRoute, &key, &path_src, &path_dst, this](unsigned src_index, unsigned dst_index) {
-    if (src_index < path_src.size() && dst_index <= path_dst.size()) {
+    if (src_index < path_src.size() && dst_index < path_dst.size()) {
       key      = {path_src[src_index]->netpoint_, path_dst[dst_index]->netpoint_};
       auto bpr = bypass_routes_.find(key);
       if (bpr != bypass_routes_.end()) {