Skip to content

Commit a6276ba

Browse files
authored
Merge pull request #8792 from The-OpenROAD-Project-staging/stt-null-tree-check
stt: check for null tree request
2 parents fd416f6 + 7c3da25 commit a6276ba

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/stt/src/pdr/src/pd.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "lemon/list_graph.h"
1919
#include "odb/geom.h"
2020
#include "stt/SteinerTreeBuilder.h"
21+
#include "utl/Logger.h"
2122

2223
namespace pdr {
2324

@@ -434,6 +435,15 @@ Tree primDijkstra(const vector<int>& x,
434435
const float alpha,
435436
Logger* logger)
436437
{
438+
if (x.size() != y.size()) {
439+
logger->error(
440+
utl::STT, 8, "x size ({}) != y size ({})", x.size(), y.size());
441+
}
442+
443+
if (x.empty()) {
444+
logger->error(utl::STT, 9, "Invalid request for an empty Steiner tree.");
445+
}
446+
437447
ListGraph graph;
438448
ListGraph::NodeMap<Point> node_point(graph); // Node -> location
439449

0 commit comments

Comments
 (0)