Skip to content

Commit 6074b87

Browse files
committed
assert in grid.num_instances if intance_counts is not initialized
1 parent ff0cf71 commit 6074b87

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

libs/libarchfpga/src/device_grid.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ DeviceGrid::DeviceGrid(std::string grid_name, vtr::NdMatrix<t_grid_tile, 3> grid
1313

1414
size_t DeviceGrid::num_instances(t_physical_tile_type_ptr type, int layer_num) const {
1515
size_t count = 0;
16-
if (instance_counts_.size() == 0) {
17-
//No instances counted
18-
return count;
19-
}
16+
//instance_counts_ is not initialized
17+
VTR_ASSERT(!instance_counts_.empty());
2018

2119
int num_layers = (int)grid_.dim_size(0);
2220

0 commit comments

Comments
 (0)