Skip to content

Commit

Permalink
vpr: Fix potential invalid memory access during exception handling
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kmurray committed Aug 1, 2019
1 parent 43e7fe4 commit 2957e10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vpr/src/base/atom_lookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ void AtomLookup::set_atom_pb(const AtomBlockId blk_id, const t_pb* pb) {
* PB Pins
*/
const t_pb_graph_pin* AtomLookup::atom_pin_pb_graph_pin(AtomPinId atom_pin) const {
if (atom_pin_to_pb_graph_pin_.empty()) {
return nullptr;
}
return atom_pin_to_pb_graph_pin_[atom_pin];
}

Expand Down

0 comments on commit 2957e10

Please sign in to comment.