From b75f8ba063a236c634be673776b1016355a6a596 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 25 May 2022 12:07:10 +0200 Subject: [PATCH] Avoid null dereference in assert (when !dst). --- src/kernel/routing/RoutedZone.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/kernel/routing/RoutedZone.cpp b/src/kernel/routing/RoutedZone.cpp index a82e487eb1..453436887a 100644 --- a/src/kernel/routing/RoutedZone.cpp +++ b/src/kernel/routing/RoutedZone.cpp @@ -46,8 +46,8 @@ Route* RoutedZone::new_extended_route(RoutingMode hierarchy, NetPoint* gw_src, N void RoutedZone::get_route_check_params(const NetPoint* src, const NetPoint* dst) const { - xbt_assert(src, "Cannot find a route from nullptr to %s", dst->get_cname()); - xbt_assert(dst, "Cannot find a route from %s to nullptr", src->get_cname()); + xbt_assert(src, "Cannot have a route with (nullptr) source"); + xbt_assert(dst, "Cannot have a route with (nullptr) destination"); const NetZoneImpl* src_as = src->get_englobing_zone(); const NetZoneImpl* dst_as = dst->get_englobing_zone(); @@ -61,6 +61,7 @@ void RoutedZone::get_route_check_params(const NetPoint* src, const NetPoint* dst "%s@%s). Please report that bug.", src->get_cname(), dst->get_cname(), src_as->get_cname(), dst_as->get_cname(), get_cname()); } + void RoutedZone::add_route_check_params(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, const std::vector& link_list, bool symmetrical) const { -- 2.20.1