From 2058b51b893f793857d160d184bbeb4e47b8234f Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 5 Jul 2021 15:17:29 +0200 Subject: [PATCH] It's an internal error if get_impl returns null. Add an assert to be sure. (and hope to please fbinfer) --- src/s4u/s4u_Link.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/s4u/s4u_Link.cpp b/src/s4u/s4u_Link.cpp index 74ad674909..0f5c751013 100644 --- a/src/s4u/s4u_Link.cpp +++ b/src/s4u/s4u_Link.cpp @@ -40,7 +40,9 @@ kernel::resource::LinkImpl* Link::get_impl() const xbt_assert( get_sharing_policy() != SharingPolicy::SPLITDUPLEX, "Impossible to get a LinkImpl* from a Split-Duplex link. You should call this method to each UP/DOWN member"); - return dynamic_cast(pimpl_); + auto* link_impl = dynamic_cast(pimpl_); + xbt_assert(link_impl != nullptr); + return link_impl; } Link* Link::by_name_or_null(const std::string& name) -- 2.20.1