Robert Marsh
d8b5d3bce8
C++: accept test fixes
2020-05-28 08:45:01 -07:00
Robert Marsh
693789c2cc
Merge branch 'master' into ir-this-parameter
...
Bring in new tests so their output can be fixed
2020-05-28 08:32:10 -07:00
Jonas Jensen
1b23f3ec90
C++: Accept two more changed tests
2020-05-28 11:18:14 +02:00
Jonas Jensen
9153f568be
C++: Accept test results with location fixes
2020-05-28 09:42:49 +02:00
Robert Marsh
593d4c0f32
Merge pull request #3567 from MathiasVP/ir-partial-definition
...
Implement `asPartialDefinition` for IR dataflow nodes
2020-05-27 13:51:41 -07:00
Robert Marsh
be74616b2b
C++: accept consistency test fixes
2020-05-27 12:39:54 -07:00
Dave Bartolomeo
533eeff7e8
C++: Fix MemoryLocation with multiple VirtualVariables
...
While investigating a bug with `TInstruction` sharing, I discovered that we had a case where alias analysis could create two `VirtualVariable`s for the same `Allocation`. For an indirect parameter allocation, we were using the type of the pointer variable as the type of the indirect allocation, instead of just `Unknown`. If the `IRType` of the pointer variable was the same type as the type of at least one access to the indirect allocation, we'd create both an `EntireAllocationVirtualVariable` and a `VariableVirtualVariable` for the allocation.
I added a new consistency test to guard against this in the future. This also turned out to be the root cause of the one existing known consistency failure in the IR tests.
2020-05-27 14:06:59 -04:00
Mathias Vorreiter Pedersen
bd97fe627c
Merge branch 'master' into remove-field-conflation-from-ir-fieldflow
2020-05-27 17:08:19 +02:00
Mathias Vorreiter Pedersen
97edd97778
C++: Add getLocation to TNode IPA type in testcase
2020-05-27 08:28:18 +02:00
Robert Marsh
fb46002332
C++: Fix ThisParameterNode after IR changes
2020-05-26 13:35:08 -07:00
Robert Marsh
7ad45d50c0
C++: add test case from issue
2020-05-26 11:38:14 -07:00
Geoffrey White
95537ed26f
C++: Fix mysprintf in test.
2020-05-26 18:06:14 +01:00
Geoffrey White
d96bf797ef
C++: Test layout.
2020-05-26 18:06:06 +01:00
Jonas Jensen
5deeda0337
Merge pull request #3387 from geoffw0/tostringperf
...
C++: Eliminate recursion from toString().
2020-05-26 13:24:43 +02:00
Mathias Vorreiter Pedersen
251240376b
C++: Fix asPartialDefinition for IR dataflow nodes and accept testcases
2020-05-26 13:14:38 +02:00
Mathias Vorreiter Pedersen
c5c3ffaef0
C++: Add asPartialDefinition testcases
2020-05-26 13:14:11 +02:00
Mathias Vorreiter Pedersen
b205d36933
C++: Remove chi -> load rule from simpleLocalFlowStep and accept tests
2020-05-26 11:40:26 +02:00
Jonas Jensen
85df60ea65
C++: Replace import default with import cpp
...
Some tests still used the old name for the top-level library.
2020-05-25 19:07:28 +02:00
Robert Marsh
b4a947ddf1
C++: add getIRVariable for this temp variables
2020-05-22 15:43:34 -07:00
Robert Marsh
8a53dc882d
C++: treat this as a parameter in IR
2020-05-22 15:35:34 -07:00
Mathias Vorreiter Pedersen
617ef32464
C++: Remove [FALSE POSITIVE] annotations
2020-05-21 02:22:57 +02:00
Mathias Vorreiter Pedersen
3c167125e5
C++: Accept test output
2020-05-20 18:18:34 +02:00
Robert Marsh
28c2acabe5
Merge pull request #3505 from dbartol/github/codeql-c-analysis-team/69
...
C++/C#: Remove `UnmodeledDefinition` instruction
2020-05-19 17:17:53 -07:00
Jonas Jensen
d38700a87c
Merge remote-tracking branch 'upstream/master' into mergeback-2020-05-19
...
Conflicts:
cpp/ql/test/library-tests/dataflow/DefaultTaintTracking/tainted.expected
cpp/ql/test/library-tests/dataflow/DefaultTaintTracking/test_diff.expected
2020-05-19 17:44:15 +02:00
Jonas Jensen
5318d42c4f
Merge remote-tracking branch 'upstream/rc/1.24' into mergeback-2020-05-19
2020-05-19 14:42:58 +02:00
Jonas Jensen
486f06ab18
C++: Simplify field conflation test
...
It turned out the `memcpy` step was not even necessary.
2020-05-19 14:12:11 +02:00
Dave Bartolomeo
3758f3c48d
C++: Fix syntax-zoo test output
2020-05-18 18:07:52 -04:00
Dave Bartolomeo
42c659b8f2
C++/C#: Remove UnmodeledDefinition instruction
2020-05-18 15:08:50 -04:00
Dave Bartolomeo
35868d4e5b
C++/C#: Change dump of unmodeled use to m?
...
This is kind of inconsequential on its own, but will make the test diffs easier to understand once the next commit removes `UnmodeledDefinition`.
2020-05-18 10:47:43 -04:00
Jonas Jensen
76e194c8be
C++: Fix struct field conflation in IR data flow
...
The virtual-dispatch code for globals was missing any relationship
between the union field access and the global variable, which meant it
propagated function-pointer flow between any two fields of a global
struct. This resulted in false positives from
`cpp/tainted-format-string` on projects using SDL, such as
WohlSoft/PGE-Project.
In addition to fixing that bug, this commit also brings the code up to
date with the new style of modeling flow through global variables:
`DataFlow::Node.asVariable()`.
2020-05-18 16:24:22 +02:00
Jonas Jensen
f2402c5abb
C++: Test virtual dispatch field conflation
...
This test demonstrates that IR data flow conflates unrelated fields of a
global struct-typed variable and that this bug is not present in the old
AST-based implementation of `semmle.code.cpp.security.TaintTracking`.
2020-05-18 15:37:22 +02:00
Jonas Jensen
cc00f0f584
C++: Move identical declarations to shared.h file
...
This cleans up the test results, which were confusing because functions
like `sink` had multiple locations.
There are some additional results now involving casts to `const char *`
because previously it varied whether `sink` used `const`, and now it
always does.
2020-05-18 10:42:52 +02:00
Mathias Vorreiter Pedersen
a42d80aa14
Merge pull request #3481 from dbartol/github/codeql-c-analysis-team/69
...
C++/C#: Allow memory operands to lack a definition
2020-05-16 11:53:00 +02:00
Jonas Jensen
b08de6c051
Merge pull request #3482 from MathiasVP/getlim-taint-source
...
C++: Add GetDelim as taint step
2020-05-15 15:54:29 +02:00
Mathias Vorreiter Pedersen
866b1361ec
C++: Accept tests
2020-05-15 11:12:47 +02:00
Mathias Vorreiter Pedersen
90d473d886
C++: Demonstrate lack of taint through getdelim
2020-05-15 11:01:27 +02:00
Dave Bartolomeo
6c12b59f0f
C++/C#: Allow non-Phi memory operands to have no definition
2020-05-14 17:22:23 -04:00
Mathias Vorreiter Pedersen
fe682556bf
Merge pull request #3475 from jbj/field-conflation-memcpy
...
C++: Test field conflation with array in struct
2020-05-14 17:53:32 +02:00
Dave Bartolomeo
efa133f0db
Merge pull request #3463 from MathiasVP/fix-field-flow-annotation
...
C++: Annotate field flow tests
2020-05-14 10:49:27 -04:00
Jonas Jensen
49ebb3197a
Merge pull request #3472 from geoffw0/paramstring
...
C++: Improve getParameterString().
2020-05-14 16:48:07 +02:00
Jonas Jensen
a380dc113f
C++: Test field conflation with array in struct
2020-05-14 16:29:39 +02:00
Jonas Jensen
3cd377e299
C++: Fixup forgotten test annotation
...
This should have been removed in 038bea2f52 .
2020-05-14 15:57:47 +02:00
Mathias Vorreiter Pedersen
1c2b8563ae
C++: Remove 'flow' value from testcases
2020-05-14 15:33:02 +02:00
Geoffrey White
da83f826b9
C++: Solve duplication in getParameterString().
2020-05-14 14:21:06 +01:00
Geoffrey White
ca0d23fd72
C++: Add a test case.
2020-05-14 14:20:02 +01:00
Mathias Vorreiter Pedersen
5f9b96cde9
C++: Fix off-by-one in test annotation
2020-05-14 15:12:00 +02:00
Geoffrey White
78f098f37a
C++: Test Function.getParameterString().
2020-05-14 13:05:39 +01:00
Mathias Vorreiter Pedersen
f414b277ba
C++: Modify complex.cpp test to account for longer access paths in the dataflow library
2020-05-14 13:58:04 +02:00
Geoffrey White
53a53fb633
C++: Modernize the Functions test.
2020-05-14 12:50:57 +01:00
Mathias Vorreiter Pedersen
f5f3405ec3
C++: Modify IR field flow tests to use InlineExpectationsTest.qll
2020-05-14 11:11:21 +02:00