C++: Add MaD model for 'CSimpleMap'.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-11-27 14:36:48 +00:00
parent 12674ea2e6
commit 74b6c9dcc7
2 changed files with 15 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: summaryModel
data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance
- ["", "CSimpleMap", True, "Add", "", "", "Argument[*@1]", "Argument[-1].Element[@]", "value", "manual"]
- ["", "CSimpleMap", True, "GetValueAt", "", "", "Argument[-1].Element[@]", "ReturnValue[*@]", "taint", "manual"]
- ["", "CSimpleMap", True, "Lookup", "", "", "Argument[-1].Element[@]", "ReturnValue.Element[@]", "value", "manual"]
- ["", "CSimpleMap", True, "SetAt", "", "", "Argument[*@1]", "Argument[-1].Element[@]", "value", "manual"]
- ["", "CSimpleMap", True, "SetAtIndex", "", "", "Argument[*@2]", "Argument[-1].Element[@]", "value", "manual"]
- ["", "CSimpleMap", True, "operator[]", "", "", "Argument[-1].Element[@]", "ReturnValue[*@]", "value", "manual"]
- ["", "CSimpleMap", True, "operator=", "", "", "Argument[*0].Element[@]", "Argument[-1].Element[@]", "value", "manual"]

View File

@@ -779,7 +779,7 @@ void test_CSimpleMap() {
{
CSimpleMap<char*, wchar_t*> a;
a.Add("hello", x);
sink(a.Lookup("hello")); // $ MISSING: ir
sink(a.Lookup("hello")); // $ ir
}
{
CSimpleMap<char*, wchar_t*> a;
@@ -800,11 +800,11 @@ void test_CSimpleMap() {
{
CSimpleMap<char*, wchar_t*> a;
a.SetAt("hello", x);
sink(a.Lookup("hello")); // $ MISSING: ir
sink(a.Lookup("hello")); // $ ir
}
{
CSimpleMap<char*, wchar_t*> a;
a.SetAtIndex(0, "hello", x);
sink(a.Lookup("hello")); // $ MISSING: ir
sink(a.Lookup("hello")); // $ ir
}
}