Commit Graph

2069 Commits

Author SHA1 Message Date
Jonas Jensen
97fc4b0c8e Merge pull request #703 from aeyerstaylor/fix-optimiser-performance
C++: Improve optimiser performance
v1.19.3 v1.19.2
2018-12-18 12:26:16 +00:00
alexet
d61022ffcc C++: Improve optimiser performance 2018-12-17 16:11:23 +00:00
Aditya Sharad
fb82811545 Merge pull request #681 from jbj/import-dataflow-clash
C++: Fix name clash in data flow imports
v1.19.1 v1.19.0
2018-12-13 10:22:32 +00:00
Jonas Jensen
1a0a8c931f C++: Fix name clash in data flow imports
The AST-based data flow libraries and the IR-based ones both define
modules `DataFlow`, `DataFlow2`, etc. This caused
`ImportAdditionalLibraries.ql` to fail in compilation.
2018-12-13 09:53:20 +00:00
semmle-qlci
1470f9fb70 Merge pull request #677 from aschackmull/java/change-note-cfg-cast
Approved by felicity-semmle
2018-12-12 18:24:45 +00:00
Anders Schack-Mulligen
2150af9732 Java: Add change note about CFG cast deprecation. 2018-12-12 15:04:19 +00:00
Dave Bartolomeo
be5ac2f2ff Merge pull request #648 from dave-bartolomeo/dave/UnreachableIR
C++: Remove unreachable IR
2018-12-11 20:58:49 -08:00
Dave Bartolomeo
0140cd23d0 C++: Accept correct test output 2018-12-11 17:11:51 -08:00
Dave Bartolomeo
283c1d43c3 C++: Restore previous test expectations 2018-12-11 17:07:25 -08:00
Robert Marsh
59c0e5d39e C++: update test expectations 2018-12-11 15:07:09 -08:00
Aditya Sharad
ce905e7a0a Merge pull request #597 from dave-bartolomeo/dave/IRDataflow
C++: Initial IR-based dataflow implementation
2018-12-11 15:05:58 +00:00
Dave Bartolomeo
8a73bea72f C++: Avoid bad join ordering in getOperandMemoryAccess 2018-12-11 00:47:53 -08:00
Dave Bartolomeo
4170d4fadd C++: Handle relational operators in constant analysis 2018-12-10 23:03:02 -08:00
Dave Bartolomeo
5ba51e32f0 C++: Remove aliased_ssa instantiation of IR reachability
We never actually consumed this iteration, since SSA construction only depends on the reachability instantiation of the previous IR layer.
2018-12-10 21:22:55 -08:00
Dave Bartolomeo
a81ba84c0e C++: Update test expectations after unreachable IR removal 2018-12-10 21:22:55 -08:00
Dave Bartolomeo
b2e596fcc2 C++: Improve join order in IR reachability 2018-12-10 21:22:55 -08:00
Dave Bartolomeo
99d33f9623 C++: Remove unreachable IR
This change removes any IR instructions that can be statically proven unreachable. To detect unreachable IR, we first run a simple constant value analysis on the IR. Then, any `ConditionalBranch` with a constant condition has the appropriate edge marked as "infeasible". We define a class `ReachableBlock` as any `IRBlock` with a path from the entry block of the function. SSA construction has been modified to operate only on `ReachableBlock` and `ReachableInstruction`, which ensures that only reachable IR gets translated into SSA form. For any infeasible edge where its predecessor block is reachable, we replace the original target of the branch with an `Unreached` instruction, which lets us preserve the invariant that all `ConditionalBranch` instructions have both a true and a false edge, and allows guard inference to still work.

The changes to `SSAConstruction.qll` are not as scary as they look. They are almost entirely a mechanical replacement of `OldIR::IRBlock` with `OldBlock`, which is just an alias for `ReachableBlock`.

Note that the `constant_func.ql` test can determine that the two new test functions always return 0.

Removing unreachable code helps get rid of some common FPs in IR-based dataflow analysis, especially for constructs like `while(true)`.
2018-12-10 21:22:55 -08:00
Dave Bartolomeo
59fc77f066 C++: Simple constant analysis
This change moves the simple constant analysis that was used by the const_func test into a pyrameterized module for use on any stage of the IR. This will be used to detect unreachable code.
2018-12-10 21:22:54 -08:00
Dave Bartolomeo
6a11ef5c18 C++: Add a couple test cases for unreachable code in IR 2018-12-10 21:22:54 -08:00
Dave Bartolomeo
78e5b3ad63 C++: Add IR dataflow to ImportAdditionalQueries.ql 2018-12-10 15:09:49 -08:00
Dave Bartolomeo
23993710d1 Revert "C++: Avoid creating ExprNodes for Conversions"
This reverts commit df882a9e72.
2018-12-10 15:06:29 -08:00
Dave Bartolomeo
df882a9e72 C++: Avoid creating ExprNodes for Conversions 2018-12-10 10:09:42 -08:00
Aditya Sharad
d94e14d54b Merge pull request #609 from hvitved/csharp/autobuilder/fixes
C#: Autobuilder fixes
2018-12-10 18:07:31 +00:00
Tom Hvitved
1e9fe0046a C#: Address review comments 2018-12-10 15:31:23 +01:00
semmle-qlci
57de628ab8 Merge pull request #650 from xiemaisi/js/nomagic-isDOMProperty
Approved by asger-semmle
2018-12-10 13:52:47 +00:00
Felicity Chapman
882ab7e9ca Merge pull request #636 from jbj/incorrect-not-operator-usage-case
C++: Rename "Incorrect 'not' operator usage"
2018-12-10 11:13:19 +00:00
Max Schaefer
e7df9b8b01 JavaScript: Avoid unhelpful magic. 2018-12-10 10:40:37 +00:00
semmle-qlci
1ca27e2c18 Merge pull request #647 from xiemaisi/js/fix-msita-perf
Approved by esben-semmle
2018-12-09 21:32:31 +00:00
semmle-qlci
3b383e3aaf Merge pull request #635 from Semmle/xiemaisi-patch-3
Approved by esben-semmle
2018-12-07 14:02:48 +00:00
Max Schaefer
74e70615ed JavaScript: Fix performance regression in MixedStaticInstanceThisAccess. 2018-12-07 13:17:36 +00:00
Max Schaefer
74e3709de1 JavaScript: Add missing query id in change notes. 2018-12-07 08:25:28 +00:00
Jonas Jensen
00e52df371 C++: Rename "Incorrect 'not' operator usage"
This makes the casing consistent with our other queries.
2018-12-07 09:24:35 +01:00
Dave Bartolomeo
ebbd701188 C++: Fix PR feedback 2018-12-06 12:35:43 -08:00
Dave Bartolomeo
84b39bf999 C++: Simplify models for side effects and alias info. 2018-12-06 12:35:33 -08:00
Taus
cb93017d98 Merge pull request #606 from markshannon/python-fix-regex-fp
Python: Fix off-by-one error in regex parsing.
2018-12-06 12:59:44 +01:00
Felicity Chapman
6a7b528280 1.19: Finalize change notes for JavaScript 2018-12-06 08:44:35 +00:00
semmle-qlci
bc91e0f53b Merge pull request #624 from Semmle/xiemaisi-patch-2
Approved by esben-semmle
2018-12-06 08:04:37 +00:00
Max Schaefer
305b8a6723 Merge pull request #620 from xiemaisi/js/qhelp-for-ms-queries
JavaScript: Add query help for two externally contributed queries.
2018-12-06 08:04:13 +00:00
Dave Bartolomeo
2b80aee557 C++: Use getConvertedResultExpr in IR-based dataflow
This sort of fixes one FP and causes a new FN, but for the wrong reasons. The IR dataflow is tracking the reference itself, rather than the referred-to object. Once we can better model indirections, we can make this work correctly.

This change is still the right thing to do, because it ensures that the dataflow is looking at actual expression being computed by the instruction.
2018-12-05 12:34:44 -08:00
Dave Bartolomeo
e8efb32156 C++: Remove StoreDestinationAsPostUpdateNode 2018-12-05 11:33:48 -08:00
Dave Bartolomeo
65360b23f9 C++: Change model API based on feedback
I've separated the model interface for memory side effects from the model for escaped addresses. It will be fairly common for a given model to extend both interfaces, but they are used for two different purposes.

I've also put each model interface and the non-member predicates that query it into a named module, which seemed cleaner than having predicates named `functionModelReadsMemory()` and `getFunctionModelParameterAliasBehavior()`.
2018-12-05 10:58:46 -08:00
Taus
a8354b98d9 Merge pull request #626 from felicity-semmle/1.19/python-change-notes
Update logging information based on 'extractor-python.md'
2018-12-05 17:42:56 +01:00
Felicity Chapman
c735043772 Update for feedback 2018-12-05 16:36:34 +00:00
Felicity Chapman
9ef50a7876 Update logging information based on 'extractor-python.md' 2018-12-05 16:13:05 +00:00
Max Schaefer
13a9903c21 JavaScript: Remove redundant conjunct in MixedStaticInstanceThisAccess.
Minor cleanup, but might as well go into the release.
2018-12-05 15:11:32 +00:00
Max Schaefer
a1f210df67 JavaScript: Address review comments. 2018-12-05 14:10:06 +00:00
Max Schaefer
22502e7a10 JavaScript: Add query help for FileAccessToHttp query. 2018-12-05 13:12:52 +00:00
Max Schaefer
92c1e655dd JavaScript: Add query help for HttpToFileAccess query. 2018-12-05 12:58:38 +00:00
Tom Hvitved
733c7b0a8f Merge pull request #616 from felicity-semmle/1.19/c#-finalize-release-notes
1.19: Finalize release notes for C#
2018-12-05 11:17:19 +01:00
Anders Schack-Mulligen
697fd96ed7 Merge pull request #614 from felicity-semmle/1.19/java-finalize-change-notes
1.19: Finalize change notes for Java
2018-12-05 10:56:13 +01:00