Commit Graph

41418 Commits

Author SHA1 Message Date
Taus
76b1bbc56a Merge pull request #565 from markshannon/python-analysis-queries-qhelp
Python: Delete some misleading qhelp and rename a couple of queries.
2018-12-03 14:42:03 +01:00
Geoffrey White
d8c7537557 CPP: * -> + 2018-12-03 13:11:52 +00:00
Geoffrey White
dfbccc4bcf CPP: Additional test cases. 2018-12-03 13:11:52 +00:00
calumgrant
43d14ce011 Merge pull request #586 from hvitved/csharp/cfg/field-split
C#: Handle multiple-field Boolean CFG splitting
2018-12-03 12:52:43 +00:00
Max Schaefer
8627ddbe4b JavaScript: Adjust alert message. 2018-12-03 12:38:00 +00:00
Nick Rolfe
fc91ff1a69 C++: we now process operands for vacuous destructor calls thru pointers 2018-12-03 12:16:35 +00:00
Jonas Jensen
8f60c09804 C++: Clarify cpp/virtual-destructor changelog 2018-12-03 13:04:24 +01:00
Mark Shannon
d32e6b8501 Python tests: Make sure stdlib can be found. 2018-12-03 11:55:57 +00:00
Asger F
1130d0c6f9 JS: add comment about arrays 2018-12-03 11:23:02 +00:00
Asger F
374f7ab65d JS: address comments 2018-12-03 11:23:02 +00:00
Asger F
c4d7672ea7 JS: fix typo in method name 2018-12-03 11:23:02 +00:00
Asger F
0462eb4b50 JS: add IncorrectSuffixCheck query 2018-12-03 11:23:02 +00:00
Mark Shannon
fb90d2a5a6 Python points-to: Update test results for fixed ESSA computation. 2018-12-03 11:13:18 +00:00
Mark Shannon
08b99944b1 Python ESSA: Fix definition of Essa non-local variables. 2018-12-03 11:12:35 +00:00
Geoffrey White
a3a5829fd0 Merge pull request #598 from jbj/AlwaysTrueUponEntryLoop-perf
C++: data flow AlwaysTrueUponEntryLoop perf fix
2018-12-03 10:59:50 +00:00
Esben Sparre Andreasen
2cc235d61b Merge pull request #556 from xiemaisi/js/invalid-entity-transcoding
JavaScript: Add new query `InvalidEntityTranscoding`.
2018-12-03 10:31:41 +01:00
Esben Sparre Andreasen
104eafec2f JS: cleanup for all HTTP::RouteHandlerCandidates 2018-12-03 10:13:08 +01:00
Max Schaefer
1a3e3baf80 JavaScript: Add change note. 2018-12-03 09:06:48 +00:00
Esben Sparre Andreasen
88c69e2c9c JS: change note for tracked Hapi route handlers 2018-12-03 09:24:55 +01:00
Esben Sparre Andreasen
a3bd072590 JS: add Hapi::RouteHandlerCandidate 2018-12-03 09:22:21 +01:00
Esben Sparre Andreasen
fd489271b7 JS: refactor Hapi::RouteSetup 2018-12-03 09:22:21 +01:00
Dave Bartolomeo
2822d14588 C++: Add missing changes to test_ir.expected 2018-12-02 22:22:34 -08:00
Mark Shannon
8e6c16d59f Python: Fix import root computation for windows and 3.7 2018-12-01 16:53:41 +00:00
Mark Shannon
f11b5ab42f Python ESSA: Fix performance of PythonSsaSourceVariable.hasRefinementEdge() 2018-12-01 16:36:49 +00:00
Jonas Jensen
d14cf34cc6 C++: data flow AlwaysTrueUponEntryLoop perf fix
The predicate `AlwaysTrueUponEntryLoop.getARelevantVariable` was very
sensitive to join ordering, and with the 1.19 QL engine it got an
unfortunate join order that made it explode on certain snapshots. With
this change, it goes from taking minutes to taking less than a second on
a libretro-uae snapshot.
2018-12-01 10:07:08 +01:00
Dave Bartolomeo
7eb47f3f82 C++: A few more IR dataflow tweaks
Made `Node::getType()`, `Node::asParameter()`, and `Node::asUninitialized()` operate directly on the IR. This actually fixed several diffs compared to the AST dataflow, because `getType()` wasn't holding for nodes that weren't `Exprs`.

Made `Uninitialized` a `VariableInstruction`. This makes it consistent with `InitializeParameter`.
2018-11-30 16:53:45 -08:00
Dave Bartolomeo
309b703e47 C++: Models for side-effect-free functions
This commit adds a new model interface that describes the known side effects (or lack thereof) of a library function. Does it read memory, does it write memory, and do any of its parameters escape? Initially, we have models for just two Standard Library functions: `std::move` and `std::forward`, which neither read nor write memory, and do not escape their parameter.

IR construction has been updated to insert the correct side effect instruction (or no side effect instruction) based on the model.
2018-11-30 12:15:23 -08:00
Dave Bartolomeo
af443569d9 C++: Fix handling of accesses to escaped variables in Aliased SSA
This fixes a subtle bug in the construction of aliased SSA. `getResultMemoryAccess` was failing to return a `MemoryAccess` for a store to a variable whose address escaped. This is because no `VirtualIRVariable` was being created for such variables. The code was assuming that any access to such a variable would be via `UnknownMemoryAccess`. The result is that accesses to such variables were not being modeled in SSA at all.

Instead, the way to handle this is to have a `VariableMemoryAccess` even when the variable being accessed has escaped, and to have `VariableMemoryAccess::getVirtualVariable()` return the `UnknownVirtualVariable` for escaped variables. In the future, this will also let us be less conservative about inserting `Chi` nodes, because we'll be able to determine that there's an exact overlap between two accesses to the same escaped variable in some cases.
2018-11-30 12:15:19 -08:00
Dave Bartolomeo
ae8f18c0b5 C++: Treat all Convert instructions as dataflow
The AST dataflow library essentially ignores conversions, which is probably the right behavior. Converting an `int` to a `long` preserves the value, even if the bit pattern might be different. It's arguable whether narrowing conversions should be treated as dataflow, but we'll do so for now. We can revisit that if we see it cause problems.
2018-11-30 12:15:15 -08:00
Dave Bartolomeo
58f7596519 C++: IR-based dataflow 2018-11-30 12:15:11 -08:00
Aditya Sharad
b638961a4f Merge pull request #596 from Semmle/dll-binary
.gitattributes: DLLs are binary
2018-11-30 18:06:13 +00:00
Nick Rolfe
b173752de9 .gitattributes: DLLs are binary 2018-11-30 18:05:02 +00:00
Max Schaefer
52b8a6bb56 Merge branch 'master' into js/invalid-entity-transcoding 2018-11-30 16:49:20 +00:00
Tom Hvitved
d25bd598db C#: Add change note 2018-11-30 17:44:48 +01:00
Tom Hvitved
3b0d1599ad C#: Teach guards library about unique assignments
For example, in

```
void M(object x)
{
    var y = x == null ? 1 : 2;
    if (y == 2)
        x.ToString();
}
```

the guard `y == 2` implies that the guard `x == null` must be false,
as the assignment of `2` to `y` is unique.
2018-11-30 17:43:10 +01:00
Tom Hvitved
ab9aa7d338 C#: Teach guards library about conditional assignments
For example, in

```
void M(object x)
{
    var y = x != null ? "" : null;
    if (y != null)
        x.ToString();
}
```

the guard `y != null` implies that the guard `x != null` must be true.
2018-11-30 17:41:36 +01:00
Tom Hvitved
80144a00c8 C#: Update nullness analyses
Port the SSA-based logic from the Java nullness analyses.
2018-11-30 17:41:31 +01:00
james
bebac21e19 add qhelp style-guide 2018-11-30 16:27:01 +00:00
Aditya Sharad
ec0663e587 Merge pull request #584 from jbj/mergeback-20181130
Mergeback master -> next
2018-11-30 16:15:21 +00:00
Max Schaefer
3351650895 JavaScript: Make InconsistentNew give fewer results. 2018-11-30 16:13:46 +00:00
Tom Hvitved
d2a431e6f3 C#: Add more nullness tests
Port many of the nullness test from Java, as well as add new tests.
2018-11-30 17:02:05 +01:00
Max Schaefer
b17518a5eb JavaScript: Refactor InconsistentNew to improve performance.
All the filtering is now done in `getALikelyCallee`, to which I have also added an additional parameter that improves the join in the `select` clause.

I've also simplified the alert message to no longer use `toString`, which isn't meant for alert messages anyway. (This is an old query.)
2018-11-30 15:40:45 +00:00
Kevin Backhouse
939db5a7cd Merge pull request #583 from jbj/bbStrictlyDominates-nomagic
C++: pragma[nomagic] on bbStrictlyDominates
2018-11-30 15:12:24 +00:00
calumgrant
1c2dd3e7b9 Merge pull request #570 from hvitved/csharp/ssa/split-to-string
C#: Include CFG splits in `Ssa::Definition::toString()`
2018-11-30 15:04:36 +00:00
Max Schaefer
dfcf767090 Merge pull request #440 from asger-semmle/range-analysis
JS: Range analysis for dead code detection
2018-11-30 15:01:34 +00:00
semmle-qlci
dbeb2dfa0e Merge pull request #585 from xiemaisi/js/join-order-fiddling
Approved by esben-semmle
2018-11-30 14:59:53 +00:00
calumgrant
08f5c2b6a6 Merge pull request #567 from hvitved/csharp/guards-splitting
C#: Account for split SSA definitions in guards library
2018-11-30 14:57:57 +00:00
Jonas Jensen
60076cb734 Merge pull request #532 from geoffw0/query-tags-3
CPP: Query Tags 3 (JPL_C queries)
2018-11-30 15:45:01 +01:00
Jonas Jensen
148c79a0e6 C++: Deprecate RecursionPrevention 2018-11-30 15:41:43 +01:00
Jonas Jensen
9532ee5177 C++: Add more detail to change notes for libraries 2018-11-30 14:29:08 +01:00