Commit Graph

927 Commits

Author SHA1 Message Date
Anders Schack-Mulligen
72415c7c2c C++: Rename references. 2023-03-23 13:06:19 +01:00
Jeroen Ketema
8aa9207281 Merge remote-tracking branch 'upstream/main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-03-16 10:28:44 +01:00
Tom Hvitved
b3ef1e9372 C++: Update expected test output 2023-03-16 08:40:53 +01:00
Jeroen Ketema
55da3257bf C++: Fix multiple toString consistency error in use-use dataflow 2023-03-09 10:08:25 +01:00
Jeroen Ketema
a2248cb5a0 C++: Use getAUse in getIRRepresentationOfOperand 2023-03-09 09:45:54 +01:00
Jeroen Ketema
6f2407412e C++: Update some dataflow tests to use DataFlow::ConfigSig 2023-03-08 15:04:53 +01:00
Mathias Vorreiter Pedersen
263b208282 C++: Disambiguate a test annotation. 2023-03-08 09:07:07 +00:00
Mathias Vorreiter Pedersen
eea02e1ac1 C++: Accept test changes. 2023-03-07 16:18:43 +00:00
Mathias Vorreiter Pedersen
959237e8d2 C++: Fix missing type for Phi nodes. 2023-03-02 22:48:10 +00:00
Mathias Vorreiter Pedersen
2963dc1cb1 C++: Include phi read nodes in SSA.
There's a small fix to the mapping from 'global def -> use'.

Finally, this commit also accepts a test failure related to new missing
types for phi nodes. The fix for that is in the next commit.
2023-03-02 22:48:06 +00:00
Mathias Vorreiter Pedersen
b3f92fcf0f C++: Add FN caused by missing static local initialization in SSA. 2023-03-02 22:37:52 +00:00
Mathias Vorreiter Pedersen
7bb806563f Merge branch 'mathiasvp/replace-ast-with-ir-use-usedataflow' into no-taint-indirect-direct-conflation 2023-02-27 17:19:36 +00:00
Mathias Vorreiter Pedersen
b36d4931f2 C++: Fix test annotation. 2023-02-27 15:47:52 +00:00
Mathias Vorreiter Pedersen
1db24dd28d C++: Fix missing types. We now assign the node corresponding to **p
an `UnknownType`.
2023-02-27 14:57:36 +00:00
Mathias Vorreiter Pedersen
4e16bb65e3 C++: Accept test changes. Because we now allocate _three_ indirect nodes
for a value of type `void*` (i.e., `p`, `*p` and `**p`) we need to decide
on a type for the `**p` value. We will do this in the next commit.
2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
f6b9ca3da6 C++: Add failing test. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
da4a059388 C++: Accept test changes. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
575ac46bf3 C++: Add failing test. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
b952f619db C++: Accept test changes. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
9d64c0a023 C++: Add failing test. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
2cb4a554ea C++: Fix a bug in Expr <-> Node mapping. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
09df318e9e C++: Also track flow out of indirect sources. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
a806569b5f C++: The next commit is going to track flow out of both direct and indirect sources. This means we'll get a lot of duplication since there'll be flow from indirect source -> indirect sink and direct source -> direct sink (which both map to the same expressions). This commit changes the testing so that we only report a duplication when they're at different locations. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
5a8b900394 C++: Properly track smart pointer wrappers. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
64abf5b163 C++: Add conflation into DefaultTaintTracking. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
b951bf0f8f C++: Remove conflation from taint-tracking. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
7437de2909 C++: Fix issue where 'getEnclosingCallable' didn't exist for some globals. 2023-02-27 14:06:13 +00:00
Mathias Vorreiter Pedersen
7a81f06e84 C++: Accept test changes. 2023-02-14 09:01:51 +00:00
Mathias Vorreiter Pedersen
748a345e7f C++: Add a test to reveal missing or spurious types on dataflow nodes. 2023-02-14 08:58:29 +00:00
Jeroen Ketema
996eb6c63c C++: Fix Ql-for-QL warnings 2023-02-13 09:22:31 +01:00
Mathias Vorreiter Pedersen
378484ec01 Merge pull request #12149 from MathiasVP/fewer-flowthroughs
C++: Fix spurious flow-through
2023-02-10 18:45:46 +00:00
Mathias Vorreiter Pedersen
168202dbf7 Update cpp/ql/test/library-tests/dataflow/dataflow-tests/has-parameter-flow-out.ql
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2023-02-10 16:36:40 +00:00
Mathias Vorreiter Pedersen
9a8b3bad31 C++: Respond to PR reviews. 2023-02-10 13:56:19 +00:00
Jeroen Ketema
ecdeb9a970 C++: Revert semmle.code.cpp.dataflow to its old state
While here make sure all queries and tests use IR dataflow when appropriate.
2023-02-10 14:21:44 +01:00
Mathias Vorreiter Pedersen
5bd7589109 C++: Fix spurious flow though and accept test changes. 2023-02-10 12:42:40 +00:00
Mathias Vorreiter Pedersen
faf9fd6253 C++: Add a testcase (and a new test) to test flow through functions. 2023-02-10 12:40:29 +00:00
Jeroen Ketema
8f15abc285 Merge pull request #12146 from jketema/global-indirect
C++: Do not mark global indirect flow as spurious in dataflow tests
2023-02-10 10:21:04 +01:00
Jeroen Ketema
350fb89ebf C++: Also mention all locations in the AST case 2023-02-10 09:49:24 +01:00
Jeroen Ketema
12930c68fb C++: Do not mark global indirect flow as spurious in dataflow tests 2023-02-10 09:29:27 +01:00
Mathias Vorreiter Pedersen
6b851d0529 C++: Fix an inconsistency with too many out nodes. 2023-02-09 16:55:19 +00:00
Mathias Vorreiter Pedersen
7439de37a3 C++: Add a new test that demonstrates multiple out nodes. 2023-02-09 16:23:32 +00:00
Mathias Vorreiter Pedersen
946e301ed6 Merge pull request #12079 from rdmarsh2/rdmarsh2/use-use-taint-test-reads
C++: allow read steps at the sink in IR taint test
2023-02-08 15:08:00 +00:00
Mathias Vorreiter Pedersen
825628675e C++: Only allow implicit reads of fields that exist on the sink node's type. 2023-02-08 13:08:22 +00:00
Mathias Vorreiter Pedersen
559c799309 C++: Also recognize iterators obtained via a function that doesn't receive the container as a qualiifer. 2023-02-03 21:43:21 +00:00
Mathias Vorreiter Pedersen
77250af444 Merge pull request #12050 from MathiasVP/flow-out-of-iterators-3 2023-02-03 18:43:37 +00:00
Mathias Vorreiter Pedersen
09a7573163 C++: Add comments to the new FP. 2023-02-03 17:09:19 +00:00
Mathias Vorreiter Pedersen
ae774a6b95 C++: Add a test with an indirect source. 2023-02-03 16:59:54 +00:00
Robert Marsh
ad8e82ac65 C++: allow read steps at the sink in IR taint test 2023-02-03 11:38:49 -05:00
Mathias Vorreiter Pedersen
968fff29ac Merge branch 'mathiasvp/replace-ast-with-ir-use-usedataflow' into flow-out-of-iterators-3 2023-02-02 09:12:02 +00:00
Mathias Vorreiter Pedersen
eb31160ae0 C++: Accept test changes. 2023-02-01 13:42:03 +00:00