Skip to content

Commit b8c1ef1

Browse files
authored
Merge pull request #2865 from verilog-to-routing/routing_graphics_toggle_segfault
Fixed segfault in draw_routing_costs
2 parents 3f60382 + 38a4f11 commit b8c1ef1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

vpr/src/draw/draw_basic.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,14 @@ void draw_routing_costs(ezgl::renderer* g) {
384384
auto& device_ctx = g_vpr_ctx.device();
385385
auto& route_ctx = g_vpr_ctx.routing();
386386
g->set_line_width(0);
387-
387+
388388
VTR_ASSERT(!route_ctx.rr_node_route_inf.empty());
389389

390390
float min_cost = std::numeric_limits<float>::infinity();
391391
float max_cost = -min_cost;
392-
vtr::vector<RRNodeId, float> rr_node_costs(0.);
392+
393+
size_t node_count = device_ctx.rr_graph.nodes().size();
394+
vtr::vector<RRNodeId, float> rr_node_costs(node_count, 0.);
393395

394396
for (const RRNodeId inode : device_ctx.rr_graph.nodes()) {
395397
float cost = 0.;

0 commit comments

Comments
 (0)