Skip to content

Commit ecbe9a5

Browse files
committed
Fixed dbNetwork::name(const Instance* instance)
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
1 parent 83ff256 commit ecbe9a5

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/dbSta/src/dbNetwork.cc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,18 @@ const char* dbNetwork::name(const Instance* instance) const
824824
}
825825

826826
if (hierarchy_) {
827-
size_t last_idx = name.find_last_of('/');
827+
size_t last_idx = std::string::npos;
828+
size_t pos = name.length();
829+
while ((pos = name.rfind('/', pos)) != std::string::npos) {
830+
if (pos > 0 && name[pos - 1] == '\\') {
831+
// This is an escaped slash, so we should ignore it and continue
832+
// searching.
833+
pos--;
834+
} else {
835+
last_idx = pos;
836+
break;
837+
}
838+
}
828839
if (last_idx != std::string::npos) {
829840
name = name.substr(last_idx + 1);
830841
}

0 commit comments

Comments
 (0)