Skip to content

Commit

Permalink
Fixing UB #213
Browse files Browse the repository at this point in the history
  • Loading branch information
searchivairus committed Jul 20, 2017
1 parent 6b6873f commit 4d9d86d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion similarity_search/src/method/small_world_rand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,8 @@ void SmallWorldRand<dist_t>::LoadIndex(const string &location) {
if (pass == 0) {
unique_ptr<MSWNode> node(new MSWNode(data_[nodeID], nodeID));
ptrMapper[nodeID] = node.get();
ElList_.insert(make_pair(node->getData()->id(), node.release()));
IdType dataId = node->getData()->id();
ElList_.insert(make_pair(dataId, node.release()));
} else {
MSWNode *pNode = ptrMapper[nodeID];
CHECK_MSG(pNode != NULL,
Expand Down

0 comments on commit 4d9d86d

Please sign in to comment.