Skip to content

Commit 2957e10

Browse files
committed
vpr: Fix potential invalid memory access during exception handling
When handling tatum exceptions the atom look-up may not have been initialized, so ensure we return nullptr for the associated PB graph pin in that case
1 parent 43e7fe4 commit 2957e10

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

vpr/src/base/atom_lookup.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ void AtomLookup::set_atom_pb(const AtomBlockId blk_id, const t_pb* pb) {
5252
* PB Pins
5353
*/
5454
const t_pb_graph_pin* AtomLookup::atom_pin_pb_graph_pin(AtomPinId atom_pin) const {
55+
if (atom_pin_to_pb_graph_pin_.empty()) {
56+
return nullptr;
57+
}
5558
return atom_pin_to_pb_graph_pin_[atom_pin];
5659
}
5760

0 commit comments

Comments
 (0)