Skip to content

Commit b92d033

Browse files
committed
Added fix for warning about potentially dereferencing null pointer
1 parent 2d6e585 commit b92d033

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vpr/src/pack/cluster.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,10 @@ static void update_total_gain(float alpha, float beta, bool timing_driven, bool
20612061
t_pb* cur_pb = pb;
20622062

20632063
cur_pb = get_parent_pb(cur_pb);
2064-
AttractGroupId cluster_att_grp_id = cur_pb->pb_stats->attraction_grp_id;
2064+
AttractGroupId cluster_att_grp_id;
2065+
if (cur_pb) {
2066+
cluster_att_grp_id = cur_pb->pb_stats->attraction_grp_id;
2067+
}
20652068

20662069
for (AtomBlockId blk_id : cur_pb->pb_stats->marked_blocks) {
20672070
//Initialize connectiongain and sharinggain if

0 commit comments

Comments
 (0)