Skip to content

Commit

Permalink
Add a check to prevent a -Wnull-dereference warning from GCC 12
Browse files Browse the repository at this point in the history
  • Loading branch information
cuveland committed Jan 26, 2023
1 parent dc989c6 commit 7861fd2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/StfSender/StfSenderOutputUCX.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,13 @@ bool StfSenderOutputUCX::disconnectTfBuilder(const std::string &pTfBuilderId)
}
return true;
}
lConnInfo = std::move(mOutputMap.extract(lIt).mapped());
auto lConnInfoNode = mOutputMap.extract(lIt);
if (lConnInfoNode.empty()) {
// this should never happen, but the check makes the static analyzer happy
EDDLOG("StfSenderOutputUCX::disconnectTfBuilder: Internal error. tfb_id={}", pTfBuilderId);
return true;
}
lConnInfo = std::move(lConnInfoNode.mapped());
}

// Transport is only closed when other side execute close as well. Execute async
Expand Down

0 comments on commit 7861fd2

Please sign in to comment.