From 873eb6a0d82066a6a9e1daa749346433c674ff66 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 10 Apr 2018 11:56:32 +0200 Subject: [PATCH] Fix scan-build warning (link may be null). --- src/s4u/s4u_actor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index 748091d51e..9afb7946d7 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -84,7 +84,8 @@ void Actor::migrate(Host* new_host) { std::string key; simgrid::instr::LinkType* link = nullptr; - if (TRACE_actor_is_enabled()) { + bool tracing = TRACE_actor_is_enabled(); + if (tracing) { static long long int counter = 0; key = std::to_string(counter); @@ -111,7 +112,7 @@ void Actor::migrate(Host* new_host) SIMIX_process_change_host(this->pimpl_, new_host); }); - if (TRACE_actor_is_enabled()) { + if (tracing) { // create new container on the new_host location simgrid::instr::Container::byName(new_host->get_name())->createChild(instr_pid(this), "ACTOR"); // end link -- 2.20.1