urange: fix bug (seg fault) in getMeta
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
27466f6ef1
commit
190032729a
1 changed files with 1 additions and 0 deletions
|
@ -300,6 +300,7 @@ namespace CNORXZ
|
||||||
auto b = mSpace.begin();
|
auto b = mSpace.begin();
|
||||||
auto e = mSpace.end();
|
auto e = mSpace.end();
|
||||||
auto i = std::lower_bound(b, e, meta, std::less<MetaT>());
|
auto i = std::lower_bound(b, e, meta, std::less<MetaT>());
|
||||||
|
CXZ_ASSERT(i != e, "element with meta data = " << toString(meta) << " not in range"); // check this first, otherwise the next test may potentially result in a seg fault!
|
||||||
CXZ_ASSERT(*i == meta, "element with meta data = " << toString(meta) << " not in range");
|
CXZ_ASSERT(*i == meta, "element with meta data = " << toString(meta) << " not in range");
|
||||||
return i - b;
|
return i - b;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue