From: Arnaud Giersch Date: Thu, 16 Mar 2023 16:28:51 +0000 (+0100) Subject: Reduce scope for variable. X-Git-Tag: v3.34~273 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/82bffec16701223d01c1e08fd48169689740d009 Reduce scope for variable. --- diff --git a/src/smpi/mpi/smpi_request.cpp b/src/smpi/mpi/smpi_request.cpp index 893969583e..05c2e70dc3 100644 --- a/src/smpi/mpi/smpi_request.cpp +++ b/src/smpi/mpi/smpi_request.cpp @@ -531,12 +531,11 @@ void Request::start() if ((flags_ & MPI_REQ_SSEND) == 0 && ((flags_ & MPI_REQ_RMA) != 0 || (flags_ & MPI_REQ_BSEND) != 0 || static_cast(size_) < smpi_cfg_detached_send_thresh())) { - void *oldbuf = nullptr; detached_ = true; XBT_DEBUG("Send request %p is detached", this); this->ref(); if (not(type_->flags() & DT_FLAG_DERIVED)) { - oldbuf = buf_; + void* oldbuf = buf_; if (not process->replaying() && oldbuf != nullptr && size_ != 0) { if (smpi_switch_data_segment(simgrid::s4u::Actor::by_pid(src_), buf_)) XBT_DEBUG("Privatization : We are sending from a zone inside global memory. Switch data segment ");