Skip to content

Commit c46a105

Browse files
kgugalaacomodi
authored andcommitted
vpr: utils: fix segfault in find_most_common_block_type
Recent logical/physical tiles split introduced the regression. If there is no max_type found we should not call the logical_block_type function, but rather return the nullptr maidenly (like we did before the split). Signed-off-by: Karol Gugala <[email protected]>
1 parent 771be2c commit c46a105

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

vpr/src/util/vpr_utils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,7 @@ t_logical_block_type_ptr find_most_common_block_type(const DeviceGrid& grid) {
779779

780780
if (max_type == nullptr) {
781781
VTR_LOG_WARN("Unable to determine most common block type (perhaps the device grid was empty?)\n");
782+
return nullptr;
782783
}
783784
return logical_block_type(max_type);
784785
}

0 commit comments

Comments
 (0)