Skip to content

Commit 0fc3349

Browse files
fix null-deref warning in GridTileLookup constructor
1 parent e8eeed3 commit 0fc3349

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

vpr/src/place/grid_tile_lookup.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
#include "grid_tile_lookup.h"
22

3-
GridTileLookup::GridTileLookup() {
3+
GridTileLookup::GridTileLookup()
4+
: max_placement_locations(g_vpr_ctx.device().logical_block_types.size()) {
45
const auto& device_ctx = g_vpr_ctx.device();
56
const int num_layers = device_ctx.grid.get_num_layers();
67

7-
if (device_ctx.logical_block_types.empty()) {
8-
throw std::runtime_error("Logical block types are empty.");
9-
} else {
10-
// Will store the max number of tile locations for each logical block type
11-
max_placement_locations.resize(device_ctx.logical_block_types.size());
12-
}
13-
148
for (const auto& type : device_ctx.logical_block_types) {
159
vtr::NdMatrix<int, 3> type_count({static_cast<unsigned long>(num_layers), device_ctx.grid.width(), device_ctx.grid.height()});
1610
fill_type_matrix(&type, type_count);

0 commit comments

Comments
 (0)