Allow aliasing between different descriptor types silently

* Also make the error about duplicate keys less severe - this can happen in
  practice as different views boil down to the same descriptor bytes and
  applications don't use only one view.
This commit is contained in:
baldurk committed 2025-09-08 16:35:41 +01:00
1 parent 5eaac6c03f
commit c25161a759
3 files changed
+41 -5

No files matched your search

+14 -3
View File
@@ -99,9 +99,17 @@ struct rdcbytetrie
return true;
// used only so the tests can EXPECT_ERROR()
RDResult err;
SET_ERROR_RESULT(err, ResultCode::InternalError, "Duplicate key with differing value located");
(void)err;
if(m_StrictErrorChecking)
{
RDResult err;
SET_ERROR_RESULT(err, ResultCode::InternalError,
"Duplicate key with differing value located");
(void)err;
}
else
{
RDCWARN("Duplicate key with differing value located");
}
return false;
}
@@ -110,6 +118,8 @@ struct rdcbytetrie
return true;
}
void SetStrictErrorChecking(bool check) { m_StrictErrorChecking = check; }
private:
///////////////////////////////
// nodes
@@ -615,4 +625,5 @@ private:
///////////////////////////////
NodeOrLeaf *m_Root = NULL;
bool m_StrictErrorChecking = false;
};