Skip to content

Commit

Permalink
Merge pull request #199 from borglab/fix/segfaults-in-x32
Browse files Browse the repository at this point in the history
fix Key as size_t (Closes #182)
  • Loading branch information
dellaert authored Dec 23, 2019
2 parents f2aaa2a + 1b697b1 commit 76ff65f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gtsam/linear/IterativeSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ void KeyInfo::initialize(const GaussianFactorGraph &fg) {
size_t start = 0;

for (size_t i = 0; i < n; ++i) {
const size_t key = ordering_[i];
const size_t dim = colspec.find(key)->second;
const Key key = ordering_[i];
const auto it_key = colspec.find(key);
if (it_key==colspec.end())
throw std::runtime_error("KeyInfo: Inconsistency in key-dim map");
const size_t dim = it_key->second;
this->emplace(key, KeyInfoEntry(i, dim, start));
start += dim;
}
Expand Down

0 comments on commit 76ff65f

Please sign in to comment.