Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 74b6c9d

Browse files
committed
C++: Add MaD model for 'CSimpleMap'.
1 parent 12674ea commit 74b6c9d

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/cpp-all
4+
extensible: summaryModel
5+
data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance
6+
- ["", "CSimpleMap", True, "Add", "", "", "Argument[*@1]", "Argument[-1].Element[@]", "value", "manual"]
7+
- ["", "CSimpleMap", True, "GetValueAt", "", "", "Argument[-1].Element[@]", "ReturnValue[*@]", "taint", "manual"]
8+
- ["", "CSimpleMap", True, "Lookup", "", "", "Argument[-1].Element[@]", "ReturnValue.Element[@]", "value", "manual"]
9+
- ["", "CSimpleMap", True, "SetAt", "", "", "Argument[*@1]", "Argument[-1].Element[@]", "value", "manual"]
10+
- ["", "CSimpleMap", True, "SetAtIndex", "", "", "Argument[*@2]", "Argument[-1].Element[@]", "value", "manual"]
11+
- ["", "CSimpleMap", True, "operator[]", "", "", "Argument[-1].Element[@]", "ReturnValue[*@]", "value", "manual"]
12+
- ["", "CSimpleMap", True, "operator=", "", "", "Argument[*0].Element[@]", "Argument[-1].Element[@]", "value", "manual"]

cpp/ql/test/library-tests/dataflow/taint-tests/atl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ void test_CSimpleMap() {
779779
{
780780
CSimpleMap<char*, wchar_t*> a;
781781
a.Add("hello", x);
782-
sink(a.Lookup("hello")); // $ MISSING: ir
782+
sink(a.Lookup("hello")); // $ ir
783783
}
784784
{
785785
CSimpleMap<char*, wchar_t*> a;
@@ -800,11 +800,11 @@ void test_CSimpleMap() {
800800
{
801801
CSimpleMap<char*, wchar_t*> a;
802802
a.SetAt("hello", x);
803-
sink(a.Lookup("hello")); // $ MISSING: ir
803+
sink(a.Lookup("hello")); // $ ir
804804
}
805805
{
806806
CSimpleMap<char*, wchar_t*> a;
807807
a.SetAtIndex(0, "hello", x);
808-
sink(a.Lookup("hello")); // $ MISSING: ir
808+
sink(a.Lookup("hello")); // $ ir
809809
}
810810
}

0 commit comments

Comments
 (0)