Skip to content

Commit 5a4d621

Browse files
generatedunixname4593378654225212meta-codesync[bot]
authored andcommitted
deadly-signal (vector::_M_default_append) in __clang_call_terminate (facebookresearch#4986)
Summary: Pull Request resolved: facebookresearch#4986 Reviewed By: limqiying Differential Revision: D97439617 fbshipit-source-id: 35a883d2f20035b5d346165e4d2ed2aa6220304d
1 parent 0759009 commit 5a4d621

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

faiss/invlists/BlockInvertedLists.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include <faiss/impl/io.h>
1717
#include <faiss/impl/io_macros.h>
18+
#include <faiss/index_io.h>
1819

1920
namespace faiss {
2021

@@ -167,6 +168,17 @@ InvertedLists* BlockInvertedListsIOHook::read(IOReader* f, int /* io_flags */)
167168
const {
168169
auto il = std::make_unique<BlockInvertedLists>();
169170
READ1(il->nlist);
171+
{
172+
auto limit_ = get_deserialization_loop_limit();
173+
if (limit_ > 0) {
174+
FAISS_THROW_IF_NOT_FMT(
175+
static_cast<size_t>(il->nlist) <= limit_,
176+
"BlockInvertedLists nlist=%zd exceeds "
177+
"deserialization_loop_limit of %zd",
178+
static_cast<size_t>(il->nlist),
179+
limit_);
180+
}
181+
}
170182
READ1(il->code_size);
171183
READ1(il->n_per_block);
172184
READ1(il->block_size);

0 commit comments

Comments
 (0)