Commit Graph

2357 Commits

Author SHA1 Message Date
Jonas Jensen
3ba650911c Merge pull request #1847 from geoffw0/erafix8
CPP: Deal with two very similar Japanese era queries
2019-09-04 09:57:10 +02:00
Jonas Jensen
0e54709d47 Merge pull request #1859 from geoffw0/qldocpartialdef
CPP: Document PartialDefinitions
2019-09-04 09:54:55 +02:00
Jonas Jensen
067c55adb9 C++: Fix ConditionDeclExpr data flow
Data flow probably never worked when a variable declared in a
`ConditionDeclExpr` was modeled with `BlockVar`. That combination did
not come up in testing before the last commit.
2019-09-04 09:33:00 +02:00
Geoffrey White
3a3bef3a03 CPP: Add the new Japanese era. 2019-09-03 18:28:24 +01:00
Geoffrey White
bac39e6288 CPP: Add test cases. 2019-09-03 17:46:30 +01:00
Nick Rolfe
641232a9d7 Merge pull request #1855 from mgrettondann/cpp-343-lambda-names-simplification
C++: Update tests for lambda description changes
2019-09-03 11:45:50 +01:00
Jonas Jensen
d7681bf122 C++: Don't use definitionByReference for data flow
The data flow library conflates pointers and objects enough for the
`definitionByReference` predicate to be too strict in some cases. It was
too permissive in other cases that are now (or will be) handled better
by field flow.

See also the change note entry.
2019-09-03 11:49:01 +02:00
Geoffrey White
84da3e3431 CPP: Effect of 'Support nested field flow'. 2019-09-03 09:27:50 +01:00
Geoffrey White
8105d153b1 CPP: Add a test of PartialDefinitions. 2019-09-03 09:27:50 +01:00
Geoffrey White
0f295c65f9 CPP: Add QLDoc to the PartialDefinitions class. 2019-09-03 09:27:50 +01:00
Jonas Jensen
d3a6ae5657 C++: Support nested field flow
This is the C/C++ side of PR #1766.
2019-09-03 08:50:15 +02:00
Matthew Gretton-Dann
03eb1ff785 C++: Update taint-tests for changed lambda support 2019-09-02 15:18:27 +01:00
Jonas Jensen
9c9b7ac651 C#/C++/Java: Revert AccessPathNil.toString changes
This caused too many `*.expected` files to change, also in our internal
repo.
2019-09-02 15:59:36 +02:00
Jonas Jensen
a98992f0f9 C#/C++/Java: distinguish toString of nil from cons 2019-09-02 14:22:03 +02:00
Jonas Jensen
cdede8744f C#/C++/Java: Prettier PartialAccessPath.toString 2019-09-02 14:05:50 +02:00
Jonas Jensen
c3bc9f8575 C#/C++/Java: Unbreak partial data flow support
Partial data flow had a semantic merge conflict with this branch. The
problem is that partial data flow doesn't (and shouldn't) cause the
initial pruning steps to run, but the length-2 access paths depend on
the `consCand` information that comes from that initial pruning. The
solution is to restore the old `AccessPath` class, now called
`PartialAccessPath` for use only by partial data flow.

With this change, partial data flow will in some cases allow more field
flow than non-partial data flow.
2019-09-02 14:02:39 +02:00
Geoffrey White
c4d74c3922 CPP: Replace query paths with @name and @id. 2019-09-02 12:36:36 +01:00
Jonas Jensen
dec0c3a0ee C#/C++/Java: Make AccessPath abstract
This was requested by @hvitved in code review. There is no difference in
the generated DIL.
2019-09-02 13:14:30 +02:00
Jonas Jensen
b1be123e31 C#/C++/Java: Prettier AccessPath.toString
The `ppReprType` predicate should now be `none()` instead of `result=""`
to signal that there is nothing to print. That seems clearer to me.
2019-09-02 13:14:20 +02:00
Jonas Jensen
9f0f2f7c04 C++: Accept test changes 2019-09-02 13:14:17 +02:00
Jonas Jensen
b2c94cc6b4 C++/C#/Java: Restore the AccessPathCons class 2019-09-02 13:14:13 +02:00
Jonas Jensen
fbe34015f3 C++/C#/Java: AccessPath class names reflect length
One -> ConsNil
Two -> ConsCons
2019-09-02 13:13:59 +02:00
Jonas Jensen
e8006bb2cc C++/C#/Java: data flow AccessPath up to length 2
This commit does not include updates to test results.
2019-09-02 13:13:46 +02:00
Jonas Jensen
e9a029cba3 C++: Local field flow using global library
This commit removes fields from the responsibilities of `FlowVar.qll`.
The treatment of fields in that file was slow and imprecise.

It then adds another copy of the shared global data flow library, used
only to find local field flow, and it exposes that local field flow
through `localFlow` and `localFlowStep`.

This has a performance cost. It adds two cached stages to any query that
uses `localFlow`: the stage from `DataFlowImplCommon`, which is shared
with all queries that use global data flow, and a new stage just for
`localFlowStep`.
2019-09-02 11:17:27 +02:00
Jonas Jensen
4f57f37b31 C++: Test to show false flow through object copy 2019-09-02 11:16:48 +02:00
Jonas Jensen
8ee87fd9fc C++: Make TaintTracking2 QLDoc more like DataFlow2 2019-09-02 09:43:52 +02:00
Jonas Jensen
26c81eaae9 C++: Mention localExpr{Flow,Taint} in module QLDoc 2019-09-02 09:43:23 +02:00
semmle-qlci
0cf872ed32 Merge pull request #1846 from hvitved/csharp/autoformat
Approved by jbj
2019-09-02 08:31:43 +01:00
Jonas Jensen
f1d7fde49d C++: Use localExprFlow in existing queries
This shortens the queries a bit and ensures test coverage of the new
predicate.
2019-09-02 09:29:12 +02:00
Jonas Jensen
63311739a5 C++: Add localExprFlow and localExprTaint
This is for ODASA-8053.
2019-09-02 09:29:10 +02:00
Anders Schack-Mulligen
5e6326d1d5 Java/C++/C#: Add support for dataflow exploration by partial paths. 2019-08-30 14:32:55 +02:00
Tom Hvitved
75eb7f92a2 C++: Sync identical files 2019-08-30 09:54:05 +02:00
zlaski-semmle
f2025116d5 Merge pull request #1771 from geoffw0/qldoceg8
CPP: Add syntax examples to QLDoc in NameQualifiers.qll
2019-08-29 15:16:37 -07:00
Geoffrey White
2b1871fd2b CPP: Remove the old test. I don't think preserving a duplicate test of deprecated queries is helpful. 2019-08-29 18:18:23 +01:00
Geoffrey White
ed7586d829 CPP: Add a combined test for the combined query. 2019-08-29 18:18:22 +01:00
Geoffrey White
ed53aef4dd CPP: Deprecate the two old queries. 2019-08-29 17:47:42 +01:00
Geoffrey White
7c14c68486 CPP: Add a new, combined Japanese era query. 2019-08-29 17:47:42 +01:00
Geoffrey White
b441b65918 CPP: Give the two japanese era queries unique @names. 2019-08-29 17:47:42 +01:00
Nick Rolfe
36b42def1c Merge pull request #1841 from ian-semmle/valuetext
C++: Split valuetext off into its own table
2019-08-29 17:42:14 +01:00
Geoffrey White
11da14c5f2 Merge pull request #1838 from jbj/leap-year-name
C++: Change name of UncheckedReturnValueForTimeFunctions.ql
2019-08-29 17:32:31 +01:00
Geoffrey White
1215da2d6c Merge pull request #1827 from jbj/sbb-tidy
C++: Tidy up SubBasicBlocks.qll
2019-08-29 15:42:40 +01:00
Geoffrey White
a84f19238b CPP: Add a scoped enum example. 2019-08-29 15:38:17 +01:00
Ian Lynagh
c08eb7e8c7 C++: Tweak the getValueText() code 2019-08-29 14:59:05 +01:00
Jonas Jensen
be7be1fb38 C++: Improve name/descr. of leap year queries 2019-08-29 15:53:51 +02:00
Ian Lynagh
28832c9021 C++: Add a comment 2019-08-29 10:32:34 +01:00
Calum Grant
d2bee79370 Merge pull request #1600 from AndreiDiaconu1/ircsharp
C#: Initial port of IR for C#
2019-08-29 09:26:34 +01:00
Ian Lynagh
395197432f C++: Update stats for valuetext 2019-08-28 22:52:14 +01:00
Geoffrey White
2e0c1af6c4 Merge pull request #1836 from jbj/xheader-undef
C++: Support x-macros that are #undef'ed in header
2019-08-28 17:16:50 +01:00
Ian Lynagh
cc031183bc C++: Add an upgrade script 2019-08-28 16:06:28 +01:00
Tom Hvitved
853a3aa998 Merge pull request #1799 from aschackmull/java/fieldflow-perf
Java/C++/C#: Improve performance of data flow with fields.
2019-08-28 16:30:25 +02:00