-
Notifications
You must be signed in to change notification settings - Fork 2k
C++: Always recognize pointers as iterators #7159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
212 changes: 212 additions & 0 deletions
212
cpp/ql/test/library-tests/dataflow/fields/path-flow.expected
Large diffs are not rendered by default.
Oops, something went wrong.
76 changes: 76 additions & 0 deletions
76
cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| | file://:0:0:0:0 | __wchar_t * | PointerType | Wchar_t, WideCharType | | ||
| | file://:0:0:0:0 | __wchar_t * | IteratorByPointer, PointerType | Wchar_t, WideCharType | | ||
| | file://:0:0:0:0 | const __wchar_t | SpecifiedType | Wchar_t, WideCharType | | ||
| | file://:0:0:0:0 | wchar_t | Wchar_t, WideCharType | | |
2 changes: 1 addition & 1 deletion
2
cpp/ql/test/library-tests/types/wchar_t_typedef/wchar_t.expected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| | file://:0:0:0:0 | wchar_t | Wchar_t, WideCharType | | | ||
| | file://:0:0:0:0 | wchar_t * | PointerType | CTypedefType, Wchar_t | | ||
| | file://:0:0:0:0 | wchar_t * | IteratorByPointer, PointerType | CTypedefType, Wchar_t | | ||
| | ms.c:2:24:2:30 | wchar_t | CTypedefType, Wchar_t | | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
...sts/Likely Bugs/Conversion/CastArrayPointerArithmetic/CastArrayPointerArithmetic.expected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,137 @@ | ||
| edges | ||
| | test.cpp:26:29:26:29 | b | test.cpp:26:29:26:29 | b | | ||
| | test.cpp:26:29:26:29 | b | test.cpp:27:2:27:2 | b | | ||
| | test.cpp:30:34:30:34 | b | test.cpp:31:2:31:2 | b | | ||
| | test.cpp:34:31:34:31 | b | test.cpp:34:31:34:31 | b | | ||
| | test.cpp:34:31:34:31 | b | test.cpp:35:2:35:2 | b | | ||
| | test.cpp:38:35:38:35 | d | test.cpp:38:35:38:35 | d | | ||
| | test.cpp:38:35:38:35 | d | test.cpp:39:2:39:2 | d | | ||
| | test.cpp:42:40:42:40 | d | test.cpp:43:2:43:2 | d | | ||
| | test.cpp:46:37:46:37 | d | test.cpp:46:37:46:37 | d | | ||
| | test.cpp:46:37:46:37 | d | test.cpp:47:2:47:2 | d | | ||
| | test.cpp:50:31:50:31 | b | test.cpp:51:11:51:11 | b | | ||
| | test.cpp:57:19:57:19 | d | test.cpp:26:29:26:29 | b | | ||
| | test.cpp:57:19:57:19 | d | test.cpp:57:19:57:19 | ref arg d | | ||
| | test.cpp:57:19:57:19 | ref arg d | test.cpp:58:25:58:25 | d | | ||
| | test.cpp:57:19:57:19 | ref arg d | test.cpp:59:21:59:21 | d | | ||
| | test.cpp:57:19:57:19 | ref arg d | test.cpp:61:22:61:22 | d | | ||
| | test.cpp:57:19:57:19 | ref arg d | test.cpp:62:28:62:28 | d | | ||
| | test.cpp:57:19:57:19 | ref arg d | test.cpp:63:24:63:24 | d | | ||
| | test.cpp:57:19:57:19 | ref arg d | test.cpp:95:21:95:21 | d | | ||
| | test.cpp:58:25:58:25 | d | test.cpp:30:34:30:34 | b | | ||
| | test.cpp:59:21:59:21 | d | test.cpp:34:31:34:31 | b | | ||
| | test.cpp:59:21:59:21 | d | test.cpp:59:21:59:21 | ref arg d | | ||
| | test.cpp:59:21:59:21 | ref arg d | test.cpp:61:22:61:22 | d | | ||
| | test.cpp:59:21:59:21 | ref arg d | test.cpp:62:28:62:28 | d | | ||
| | test.cpp:59:21:59:21 | ref arg d | test.cpp:63:24:63:24 | d | | ||
| | test.cpp:59:21:59:21 | ref arg d | test.cpp:95:21:95:21 | d | | ||
| | test.cpp:61:22:61:22 | d | test.cpp:38:35:38:35 | d | | ||
| | test.cpp:61:22:61:22 | d | test.cpp:61:22:61:22 | ref arg d | | ||
| | test.cpp:61:22:61:22 | ref arg d | test.cpp:62:28:62:28 | d | | ||
| | test.cpp:61:22:61:22 | ref arg d | test.cpp:63:24:63:24 | d | | ||
| | test.cpp:61:22:61:22 | ref arg d | test.cpp:95:21:95:21 | d | | ||
| | test.cpp:62:28:62:28 | d | test.cpp:42:40:42:40 | d | | ||
| | test.cpp:63:24:63:24 | d | test.cpp:46:37:46:37 | d | | ||
| | test.cpp:63:24:63:24 | d | test.cpp:63:24:63:24 | ref arg d | | ||
| | test.cpp:63:24:63:24 | ref arg d | test.cpp:95:21:95:21 | d | | ||
| | test.cpp:74:19:74:21 | dss | test.cpp:26:29:26:29 | b | | ||
| | test.cpp:74:19:74:21 | dss | test.cpp:74:19:74:21 | ref arg dss | | ||
| | test.cpp:74:19:74:21 | ref arg dss | test.cpp:75:25:75:27 | dss | | ||
| | test.cpp:74:19:74:21 | ref arg dss | test.cpp:76:21:76:23 | dss | | ||
| | test.cpp:74:19:74:21 | ref arg dss | test.cpp:96:21:96:23 | dss | | ||
| | test.cpp:75:25:75:27 | dss | test.cpp:30:34:30:34 | b | | ||
| | test.cpp:76:21:76:23 | dss | test.cpp:34:31:34:31 | b | | ||
| | test.cpp:76:21:76:23 | dss | test.cpp:76:21:76:23 | ref arg dss | | ||
| | test.cpp:76:21:76:23 | ref arg dss | test.cpp:96:21:96:23 | dss | | ||
| | test.cpp:86:19:86:20 | d2 | test.cpp:26:29:26:29 | b | | ||
| | test.cpp:86:19:86:20 | d2 | test.cpp:86:19:86:20 | ref arg d2 | | ||
| | test.cpp:86:19:86:20 | ref arg d2 | test.cpp:87:25:87:26 | d2 | | ||
| | test.cpp:86:19:86:20 | ref arg d2 | test.cpp:88:21:88:22 | d2 | | ||
| | test.cpp:86:19:86:20 | ref arg d2 | test.cpp:90:22:90:23 | d2 | | ||
| | test.cpp:86:19:86:20 | ref arg d2 | test.cpp:91:28:91:29 | d2 | | ||
| | test.cpp:86:19:86:20 | ref arg d2 | test.cpp:92:24:92:25 | d2 | | ||
| | test.cpp:87:25:87:26 | d2 | test.cpp:30:34:30:34 | b | | ||
| | test.cpp:88:21:88:22 | d2 | test.cpp:34:31:34:31 | b | | ||
| | test.cpp:88:21:88:22 | d2 | test.cpp:88:21:88:22 | ref arg d2 | | ||
| | test.cpp:88:21:88:22 | ref arg d2 | test.cpp:90:22:90:23 | d2 | | ||
| | test.cpp:88:21:88:22 | ref arg d2 | test.cpp:91:28:91:29 | d2 | | ||
| | test.cpp:88:21:88:22 | ref arg d2 | test.cpp:92:24:92:25 | d2 | | ||
| | test.cpp:90:22:90:23 | d2 | test.cpp:38:35:38:35 | d | | ||
| | test.cpp:90:22:90:23 | d2 | test.cpp:90:22:90:23 | ref arg d2 | | ||
| | test.cpp:90:22:90:23 | ref arg d2 | test.cpp:91:28:91:29 | d2 | | ||
| | test.cpp:90:22:90:23 | ref arg d2 | test.cpp:92:24:92:25 | d2 | | ||
| | test.cpp:91:28:91:29 | d2 | test.cpp:42:40:42:40 | d | | ||
| | test.cpp:92:24:92:25 | d2 | test.cpp:46:37:46:37 | d | | ||
| | test.cpp:95:21:95:21 | d | test.cpp:50:31:50:31 | b | | ||
| | test.cpp:96:21:96:23 | dss | test.cpp:50:31:50:31 | b | | ||
| nodes | ||
| | test.cpp:26:29:26:29 | b | semmle.label | b | | ||
| | test.cpp:26:29:26:29 | b | semmle.label | b | | ||
| | test.cpp:27:2:27:2 | b | semmle.label | b | | ||
| | test.cpp:30:34:30:34 | b | semmle.label | b | | ||
| | test.cpp:31:2:31:2 | b | semmle.label | b | | ||
| | test.cpp:34:31:34:31 | b | semmle.label | b | | ||
| | test.cpp:34:31:34:31 | b | semmle.label | b | | ||
| | test.cpp:35:2:35:2 | b | semmle.label | b | | ||
| | test.cpp:38:35:38:35 | d | semmle.label | d | | ||
| | test.cpp:38:35:38:35 | d | semmle.label | d | | ||
| | test.cpp:39:2:39:2 | d | semmle.label | d | | ||
| | test.cpp:42:40:42:40 | d | semmle.label | d | | ||
| | test.cpp:43:2:43:2 | d | semmle.label | d | | ||
| | test.cpp:46:37:46:37 | d | semmle.label | d | | ||
| | test.cpp:46:37:46:37 | d | semmle.label | d | | ||
| | test.cpp:47:2:47:2 | d | semmle.label | d | | ||
| | test.cpp:50:31:50:31 | b | semmle.label | b | | ||
| | test.cpp:51:11:51:11 | b | semmle.label | b | | ||
| | test.cpp:57:19:57:19 | d | semmle.label | d | | ||
| | test.cpp:57:19:57:19 | ref arg d | semmle.label | ref arg d | | ||
| | test.cpp:58:25:58:25 | d | semmle.label | d | | ||
| | test.cpp:59:21:59:21 | d | semmle.label | d | | ||
| | test.cpp:59:21:59:21 | ref arg d | semmle.label | ref arg d | | ||
| | test.cpp:61:22:61:22 | d | semmle.label | d | | ||
| | test.cpp:61:22:61:22 | ref arg d | semmle.label | ref arg d | | ||
| | test.cpp:62:28:62:28 | d | semmle.label | d | | ||
| | test.cpp:63:24:63:24 | d | semmle.label | d | | ||
| | test.cpp:63:24:63:24 | ref arg d | semmle.label | ref arg d | | ||
| | test.cpp:74:19:74:21 | dss | semmle.label | dss | | ||
| | test.cpp:74:19:74:21 | ref arg dss | semmle.label | ref arg dss | | ||
| | test.cpp:75:25:75:27 | dss | semmle.label | dss | | ||
| | test.cpp:76:21:76:23 | dss | semmle.label | dss | | ||
| | test.cpp:76:21:76:23 | ref arg dss | semmle.label | ref arg dss | | ||
| | test.cpp:86:19:86:20 | d2 | semmle.label | d2 | | ||
| | test.cpp:86:19:86:20 | ref arg d2 | semmle.label | ref arg d2 | | ||
| | test.cpp:87:25:87:26 | d2 | semmle.label | d2 | | ||
| | test.cpp:88:21:88:22 | d2 | semmle.label | d2 | | ||
| | test.cpp:88:21:88:22 | ref arg d2 | semmle.label | ref arg d2 | | ||
| | test.cpp:90:22:90:23 | d2 | semmle.label | d2 | | ||
| | test.cpp:90:22:90:23 | ref arg d2 | semmle.label | ref arg d2 | | ||
| | test.cpp:91:28:91:29 | d2 | semmle.label | d2 | | ||
| | test.cpp:92:24:92:25 | d2 | semmle.label | d2 | | ||
| | test.cpp:95:21:95:21 | d | semmle.label | d | | ||
| | test.cpp:96:21:96:23 | dss | semmle.label | dss | | ||
| subpaths | ||
| | test.cpp:57:19:57:19 | d | test.cpp:26:29:26:29 | b | test.cpp:26:29:26:29 | b | test.cpp:57:19:57:19 | ref arg d | | ||
| | test.cpp:59:21:59:21 | d | test.cpp:34:31:34:31 | b | test.cpp:34:31:34:31 | b | test.cpp:59:21:59:21 | ref arg d | | ||
| | test.cpp:61:22:61:22 | d | test.cpp:38:35:38:35 | d | test.cpp:38:35:38:35 | d | test.cpp:61:22:61:22 | ref arg d | | ||
| | test.cpp:63:24:63:24 | d | test.cpp:46:37:46:37 | d | test.cpp:46:37:46:37 | d | test.cpp:63:24:63:24 | ref arg d | | ||
| | test.cpp:74:19:74:21 | dss | test.cpp:26:29:26:29 | b | test.cpp:26:29:26:29 | b | test.cpp:74:19:74:21 | ref arg dss | | ||
| | test.cpp:76:21:76:23 | dss | test.cpp:34:31:34:31 | b | test.cpp:34:31:34:31 | b | test.cpp:76:21:76:23 | ref arg dss | | ||
| | test.cpp:86:19:86:20 | d2 | test.cpp:26:29:26:29 | b | test.cpp:26:29:26:29 | b | test.cpp:86:19:86:20 | ref arg d2 | | ||
| | test.cpp:88:21:88:22 | d2 | test.cpp:34:31:34:31 | b | test.cpp:34:31:34:31 | b | test.cpp:88:21:88:22 | ref arg d2 | | ||
| | test.cpp:90:22:90:23 | d2 | test.cpp:38:35:38:35 | d | test.cpp:38:35:38:35 | d | test.cpp:90:22:90:23 | ref arg d2 | | ||
| #select | ||
| | test.cpp:27:2:27:2 | b | test.cpp:57:19:57:19 | d | test.cpp:27:2:27:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:57:19:57:19 | d | here | | ||
| | test.cpp:27:2:27:2 | b | test.cpp:74:19:74:21 | dss | test.cpp:27:2:27:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:74:19:74:21 | dss | here | | ||
| | test.cpp:27:2:27:2 | b | test.cpp:86:19:86:20 | d2 | test.cpp:27:2:27:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:86:19:86:20 | d2 | here | | ||
| | test.cpp:31:2:31:2 | b | test.cpp:57:19:57:19 | d | test.cpp:31:2:31:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:57:19:57:19 | d | here | | ||
| | test.cpp:31:2:31:2 | b | test.cpp:58:25:58:25 | d | test.cpp:31:2:31:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:58:25:58:25 | d | here | | ||
| | test.cpp:31:2:31:2 | b | test.cpp:74:19:74:21 | dss | test.cpp:31:2:31:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:74:19:74:21 | dss | here | | ||
| | test.cpp:31:2:31:2 | b | test.cpp:75:25:75:27 | dss | test.cpp:31:2:31:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:75:25:75:27 | dss | here | | ||
| | test.cpp:31:2:31:2 | b | test.cpp:86:19:86:20 | d2 | test.cpp:31:2:31:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:86:19:86:20 | d2 | here | | ||
| | test.cpp:31:2:31:2 | b | test.cpp:87:25:87:26 | d2 | test.cpp:31:2:31:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:87:25:87:26 | d2 | here | | ||
| | test.cpp:35:2:35:2 | b | test.cpp:57:19:57:19 | d | test.cpp:35:2:35:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:57:19:57:19 | d | here | | ||
| | test.cpp:35:2:35:2 | b | test.cpp:59:21:59:21 | d | test.cpp:35:2:35:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:59:21:59:21 | d | here | | ||
| | test.cpp:35:2:35:2 | b | test.cpp:74:19:74:21 | dss | test.cpp:35:2:35:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:74:19:74:21 | dss | here | | ||
| | test.cpp:35:2:35:2 | b | test.cpp:76:21:76:23 | dss | test.cpp:35:2:35:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:76:21:76:23 | dss | here | | ||
| | test.cpp:35:2:35:2 | b | test.cpp:86:19:86:20 | d2 | test.cpp:35:2:35:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:86:19:86:20 | d2 | here | | ||
| | test.cpp:35:2:35:2 | b | test.cpp:88:21:88:22 | d2 | test.cpp:35:2:35:2 | b | Pointer arithmetic here may be done with the wrong type because of the cast $@. | test.cpp:88:21:88:22 | d2 | here | |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM.
Do you have any idea what the downside would be if we made something an
Iteratorwhen it shouldn't be? e.g. if we made everyIntegralTypeanIterator, would we get some kind of incorrect flow through integer parameters?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think such a change would mean that we get flow in cases like:
I'm not sure if we've set up everything such that this was the only thing necessary to get flow in such cases, but it would certainly be a likely outcome of such a change.