[lldb/Reproducers] Assert when trying to get object for invalid index.

Assert when trying to get an object for an index we haven't seen before.
This will crash anyway, the assertion is just a bit more informative.
This commit is contained in:
Jonas Devlieghere 2020-01-29 21:19:58 -08:00
parent e28d8f9069
commit 056f01f895
1 changed files with 1 additions and 0 deletions

View File

@ -15,6 +15,7 @@ using namespace lldb_private;
using namespace lldb_private::repro;
void *IndexToObject::GetObjectForIndexImpl(unsigned idx) {
assert(m_mapping.count(idx) && "No object for index");
return m_mapping.lookup(idx);
}