fix ivflib (#1410)
Summary: if `ils = dynamic_cast<ArrayInvertedLists *> (index_ivf->invlists)` failed, `ils` would be `nullptr`. so check if `ils` is `nullptr` before use it. Pull Request resolved: https://github.com/facebookresearch/faiss/pull/1410 Reviewed By: beauby Differential Revision: D23985814 Pulled By: mdouze fbshipit-source-id: f62a3988e74b4de1f1c9a127475368302a35d4a5pull/1431/head
parent
27393c436c
commit
c69c18ef32
|
@ -180,9 +180,9 @@ SlidingIndexWindow::SlidingIndexWindow (Index *index): index (index) {
|
|||
n_slice = 0;
|
||||
IndexIVF* index_ivf = const_cast<IndexIVF*>(extract_index_ivf (index));
|
||||
ils = dynamic_cast<ArrayInvertedLists *> (index_ivf->invlists);
|
||||
nlist = ils->nlist;
|
||||
FAISS_THROW_IF_NOT_MSG (ils,
|
||||
"only supports indexes with ArrayInvertedLists");
|
||||
nlist = ils->nlist;
|
||||
sizes.resize(nlist);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue