Skip to content

Commit 7861fd2

Browse files
committed
Add a check to prevent a -Wnull-dereference warning from GCC 12
1 parent dc989c6 commit 7861fd2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/StfSender/StfSenderOutputUCX.cxx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,13 @@ bool StfSenderOutputUCX::disconnectTfBuilder(const std::string &pTfBuilderId)
235235
}
236236
return true;
237237
}
238-
lConnInfo = std::move(mOutputMap.extract(lIt).mapped());
238+
auto lConnInfoNode = mOutputMap.extract(lIt);
239+
if (lConnInfoNode.empty()) {
240+
// this should never happen, but the check makes the static analyzer happy
241+
EDDLOG("StfSenderOutputUCX::disconnectTfBuilder: Internal error. tfb_id={}", pTfBuilderId);
242+
return true;
243+
}
244+
lConnInfo = std::move(lConnInfoNode.mapped());
239245
}
240246

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

0 commit comments

Comments
 (0)