Skip to content

Commit 6de29a6

Browse files
committed
C++: Provide std::pair constructor initializers.
1 parent 8059230 commit 6de29a6

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,6 +1992,20 @@
19921992
| stl.h:315:9:315:9 | constructor init of field first [post-this] | stl.h:315:9:315:9 | constructor init of field second [pre-this] | |
19931993
| stl.h:315:9:315:9 | constructor init of field first [pre-this] | stl.h:315:9:315:9 | constructor init of field second [pre-this] | |
19941994
| stl.h:315:9:315:9 | this | stl.h:315:9:315:9 | constructor init of field first [pre-this] | |
1995+
| stl.h:322:3:322:3 | this | stl.h:322:36:322:43 | constructor init of field first [pre-this] | |
1996+
| stl.h:322:3:322:6 | this | stl.h:322:36:322:43 | constructor init of field first [pre-this] | |
1997+
| stl.h:322:18:322:18 | x | stl.h:322:42:322:42 | x | |
1998+
| stl.h:322:18:322:18 | x | stl.h:322:42:322:42 | x | |
1999+
| stl.h:322:31:322:31 | y | stl.h:322:53:322:53 | y | |
2000+
| stl.h:322:31:322:31 | y | stl.h:322:53:322:53 | y | |
2001+
| stl.h:322:36:322:43 | call to unknown function | stl.h:322:36:322:43 | constructor init of field first | TAINT |
2002+
| stl.h:322:36:322:43 | constructor init of field first [post-this] | stl.h:322:46:322:54 | constructor init of field second [pre-this] | |
2003+
| stl.h:322:36:322:43 | constructor init of field first [post-this] | stl.h:322:46:322:54 | constructor init of field second [pre-this] | |
2004+
| stl.h:322:36:322:43 | constructor init of field first [pre-this] | stl.h:322:46:322:54 | constructor init of field second [pre-this] | |
2005+
| stl.h:322:36:322:43 | constructor init of field first [pre-this] | stl.h:322:46:322:54 | constructor init of field second [pre-this] | |
2006+
| stl.h:322:42:322:42 | x | stl.h:322:36:322:43 | constructor init of field first | TAINT |
2007+
| stl.h:322:46:322:54 | call to unknown function | stl.h:322:46:322:54 | constructor init of field second | TAINT |
2008+
| stl.h:322:53:322:53 | y | stl.h:322:46:322:54 | constructor init of field second | TAINT |
19952009
| string.cpp:24:12:24:17 | call to source | string.cpp:28:7:28:7 | a | |
19962010
| string.cpp:25:16:25:20 | 123 | string.cpp:25:16:25:21 | call to basic_string | TAINT |
19972011
| string.cpp:25:16:25:21 | call to basic_string | string.cpp:29:7:29:7 | b | |

cpp/ql/test/library-tests/dataflow/taint-tests/stl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ namespace std {
319319
T1 first;
320320
T2 second;
321321
pair();
322-
pair(const T1& x, const T2& y);
322+
pair(const T1& x, const T2& y) : first(x), second(y) {};
323323
template<class U, class V> pair(const pair<U, V> &p);
324324

325325
void swap(pair& p) /*noexcept(...)*/;

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,18 @@
3535
| format.cpp:158:7:158:27 | ... + ... | format.cpp:148:16:148:30 | call to source |
3636
| map.cpp:26:9:26:13 | first | map.cpp:25:12:25:17 | call to source |
3737
| map.cpp:32:9:32:14 | second | map.cpp:30:13:30:18 | call to source |
38+
| map.cpp:41:9:41:13 | first | map.cpp:40:30:40:35 | call to source |
3839
| map.cpp:43:7:43:7 | e | map.cpp:40:30:40:35 | call to source |
40+
| map.cpp:47:9:47:14 | second | map.cpp:45:37:45:42 | call to source |
3941
| map.cpp:48:7:48:7 | f | map.cpp:45:37:45:42 | call to source |
42+
| map.cpp:52:9:52:14 | second | map.cpp:45:37:45:42 | call to source |
4043
| map.cpp:53:7:53:7 | g | map.cpp:45:37:45:42 | call to source |
44+
| map.cpp:58:9:58:14 | second | map.cpp:45:37:45:42 | call to source |
4145
| map.cpp:59:7:59:7 | h | map.cpp:45:37:45:42 | call to source |
4246
| map.cpp:69:7:69:7 | i | map.cpp:62:37:62:42 | call to source |
47+
| map.cpp:71:9:71:14 | second | map.cpp:62:37:62:42 | call to source |
4348
| map.cpp:72:7:72:7 | j | map.cpp:62:37:62:42 | call to source |
49+
| map.cpp:74:9:74:14 | second | map.cpp:63:37:63:42 | call to source |
4450
| map.cpp:75:7:75:7 | k | map.cpp:63:37:63:42 | call to source |
4551
| map.cpp:78:7:78:7 | l | map.cpp:63:37:63:42 | call to source |
4652
| map.cpp:83:7:83:32 | call to pair | map.cpp:83:17:83:22 | call to source |

cpp/ql/test/library-tests/dataflow/taint-tests/test_diff.expected

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,14 @@
1717
| copyableclass.cpp:67:11:67:21 | copyableclass.cpp:67:13:67:18 | IR only |
1818
| copyableclass_declonly.cpp:42:8:42:9 | copyableclass_declonly.cpp:34:30:34:35 | AST only |
1919
| copyableclass_declonly.cpp:67:11:67:11 | copyableclass_declonly.cpp:67:13:67:18 | AST only |
20-
| map.cpp:41:9:41:13 | map.cpp:40:30:40:35 | IR only |
2120
| map.cpp:42:9:42:14 | map.cpp:40:30:40:35 | IR only |
2221
| map.cpp:46:9:46:13 | map.cpp:45:37:45:42 | IR only |
23-
| map.cpp:47:9:47:14 | map.cpp:45:37:45:42 | IR only |
2422
| map.cpp:51:9:51:13 | map.cpp:45:37:45:42 | IR only |
25-
| map.cpp:52:9:52:14 | map.cpp:45:37:45:42 | IR only |
2623
| map.cpp:57:9:57:13 | map.cpp:45:37:45:42 | IR only |
27-
| map.cpp:58:9:58:14 | map.cpp:45:37:45:42 | IR only |
2824
| map.cpp:67:9:67:13 | map.cpp:62:37:62:42 | IR only |
2925
| map.cpp:68:9:68:14 | map.cpp:62:37:62:42 | IR only |
3026
| map.cpp:70:9:70:13 | map.cpp:62:37:62:42 | IR only |
31-
| map.cpp:71:9:71:14 | map.cpp:62:37:62:42 | IR only |
3227
| map.cpp:73:9:73:13 | map.cpp:63:37:63:42 | IR only |
33-
| map.cpp:74:9:74:14 | map.cpp:63:37:63:42 | IR only |
3428
| map.cpp:76:9:76:13 | map.cpp:63:37:63:42 | IR only |
3529
| map.cpp:77:9:77:14 | map.cpp:63:37:63:42 | IR only |
3630
| map.cpp:84:34:84:38 | map.cpp:84:17:84:22 | IR only |

0 commit comments

Comments
 (0)