Skip to content

Commit 62c2f56

Browse files
committed
Fixed coverity 1620066.
_____________________________________________________________________________________________ *** CID 1620066: Null pointer dereferences (FORWARD_NULL) /src/rsz/src/CloneMove.cc: 276 in rsz::CloneMove::doMove(const sta::Path *, int, float, sta::PathExpanded *, float)() 270 sta_->disconnectPin(load_pin); 271 // hierarchy fix: if load and clone in different modules 272 // do the cross module wiring. 273 if (load_parent_inst != parent) { 274 std::string unique_connection_name 275 = db_network_->getBlockOf(load_pin)->makeNewNetName(); >>> CID 1620066: Null pointer dereferences (FORWARD_NULL) >>> Passing null pointer "clone_output_iterm" to "hierarchicalConnect", which dereferences it. 276 db_network_->hierarchicalConnect( 277 clone_output_iterm, load_iterm, unique_connection_name.c_str()); 278 } else { 279 sta_->connectPin(load, load_port, out_net); 280 } 281 } Signed-off-by: Jaehyun Kim <[email protected]>
1 parent d957ce8 commit 62c2f56

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/rsz/src/CloneMove.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,16 @@ bool CloneMove::doMove(const Path* drvr_path,
248248
// hierarchical wiring
249249

250250
odb::dbITerm* clone_output_iterm = db_network_->flatPin(clone_output_pin);
251+
if (clone_output_iterm == nullptr) {
252+
logger_->warn(
253+
RSZ,
254+
100,
255+
"Cloning dbITerm failed. Driver pin: {}, Clone "
256+
"output pin: {}",
257+
(drvr_pin) ? network_->pathName(drvr_pin) : "Null",
258+
(clone_output_pin) ? network_->pathName(clone_output_pin) : "Null");
259+
return false;
260+
}
251261

252262
// Divide the list of pins in half and connect them to the new net we
253263
// created as part of gate cloning. Skip ports connected to the original net

0 commit comments

Comments
 (0)