Commit Graph

17948 Commits

Author SHA1 Message Date
Asger F
70cbecaf1b JS: Update more test outputs 2019-07-02 21:08:13 +01:00
Asger F
52a5bce10d TS: Update test affected by new stringification 2019-07-02 21:01:47 +01:00
Geoffrey White
e079406a5f Merge pull request #1536 from jbj/leap-year-sameBaseType-perf
C++: Fix performance of leap year queries
2019-07-02 17:04:00 +01:00
Taus Brock-Nannestad
a40f0e0d14 Python: Fix bad join ordering in ControlFlowNode::getAChild(). 2019-07-02 15:42:41 +02:00
Tom Hvitved
a54ee160a3 C#: Update change note 2019-07-02 14:17:28 +02:00
Tom Hvitved
b6bbe1a5c0 C#: Add DB upgrade script 2019-07-02 14:01:41 +02:00
Jonas Jensen
2a6000c270 C++: getter/setter performance in StructLikeClass
The predicates `getter` and `setter` in `StructLikeClass.qll` were very
slow on some snapshots. On https://github.com/dotnet/coreclr they had
this performance:

    StructLikeClass::getter#fff#antijoin_rhs ........... 3m55s
    Variable::Variable::getAnAssignedValue_dispred#bb .. 3m36s
    StructLikeClass::setter#fff#antijoin_rhs ........... 20.5s

The `getAnAssignedValue_dispred` predicate in the middle was slow due to
magic propagated from `setter`.

With this commit, performance is instead:

   StructLikeClass::getter#fff#antijoin_rhs ........... 497ms
   Variable::Variable::getAnAssignedValue_dispred#ff .. 617ms
   StructLikeClass::setter#fff#antijoin_rhs ........... 158ms

Instead of hand-optimizing the QL for performance, I simplified `setter`
and `getter` to require slightly stronger conditions. Previously, a
function was only considered a setter if it had no writes to other
fields on the same class. That requirement is now relaxed by dropping
the "on the same class" part. I made the corresponding change for what
defines a getter. I think that still captures the spirit of what getters
and setters are.

I also changed the double-negation with `exists` into a `forall`.
2019-07-02 13:49:52 +02:00
Tom Hvitved
16b6791914 C#: Minor performance rewrite 2019-07-02 13:11:27 +02:00
Geoffrey White
01ce34449d Merge pull request #1530 from Semmle/getExpr-qldoc
C++: expand MacroInvocation.getExpr QLDoc
2019-07-02 11:00:57 +01:00
Jonas Jensen
5ea69601c3 Merge pull request #1525 from aibaars/drop-import-additional-libraries
Drop ImportAdditionalLibraries.ql
2019-07-02 11:26:31 +02:00
Jonas Jensen
5ad0b39f0c C++: Fix performance of leap year queries
The `sameBaseType` predicate was fundamentally quadratic, and this blew
up on large C++ code bases. Replacing it with calls to `Type.stripType`
fixes performance and does not affect the qltests. It looks like
`sameBaseType` was used purely an ad hoc heuristic, so I'm not worried
about the slight semantic difference between `sameBaseType` and
`stripType`.
2019-07-02 11:17:18 +02:00
Asger F
329ff0db1b JS: Add an use getAPropertySource() 2019-07-02 10:09:06 +01:00
Asger F
5ce08e2c78 JS: Address review comments 2019-07-02 10:09:06 +01:00
Asger F
408fd3e106 JS: Augment call graph using type-tracked class instances 2019-07-02 10:09:06 +01:00
Asger F
779d98a143 JS: Prevent bad join in hasOwnProperty 2019-07-02 10:09:05 +01:00
Tom Hvitved
9a24d3a69c C#: Remove libraries and queries related to version history
The VCS relations are no longer populated, so there is no reason to keep them,
and the queries/libraries that use the relations.
2019-07-02 10:43:38 +02:00
Max Schaefer
bfb236f56d JavaScript: Add more default source nodes.
In particular, `await`, `yield` and dynamic `import` expressions are now source nodes, as well as a few other experimental and legacy language features involving non-local flow.
2019-07-02 08:10:28 +01:00
semmle-qlci
71c86fa69b Merge pull request #1527 from esben-semmle/js/classify-more-generated-and-tests
Approved by asger-semmle
2019-07-02 07:38:10 +01:00
semmle-qlci
26fd1b91cf Merge pull request #1485 from esben-semmle/js/fix-yaml-strings
Approved by xiemaisi
2019-07-02 07:00:43 +01:00
semmle-qlci
b0b152aaaa Merge pull request #1529 from xiemaisi/js/getter-summaries
Approved by asger-semmle
2019-07-02 06:16:34 +01:00
Ziemowit Laski
ef7e051b50 [CPP-370] Add change note for the 1.22 release. 2019-07-01 13:47:53 -07:00
Jonas Jensen
bf99a0ee15 C++: expand MacroInvocation.getExpr QLDoc 2019-07-01 20:22:24 +02:00
Max Schaefer
7f95c20345 JavaScript: Add support for tracking flow into receivers of reflective calls. 2019-07-01 17:54:43 +01:00
semmle-qlci
3b126d9c4e Merge pull request #1488 from asger-semmle/call-graph-metric
Approved by xiemaisi
2019-07-01 16:09:34 +01:00
Max Schaefer
a04c2c65cb JavaScript: Add change note. 2019-07-01 15:45:57 +01:00
Max Schaefer
895055f30e JavaScript: Avoid unhelpful magic.
The constraint `exists(callback.getParameter(i))` was getting pushed into `higherOrderCall`, which isn't a bad thing to do. However, this then led to a join on `i`, which is a very bad thing to do.
2019-07-01 15:45:57 +01:00
Max Schaefer
b5b89c0eac JavaScript: Track flow into method receivers. 2019-07-01 15:45:57 +01:00
Esben Sparre Andreasen
062778bdd8 JS: heuristically recognize x.spec.y and x.test.y as test files 2019-07-01 15:49:17 +02:00
Esben Sparre Andreasen
7cab308205 fixup! JS: classify numeric file names as generated 2019-07-01 15:49:03 +02:00
Jonas Jensen
757ec97e7a Merge pull request #1251 from zlaski-semmle/zlaski/cpp370
[CPP-370] Non-constant `format` arguments to `printf` and friends
2019-07-01 14:43:19 +02:00
Asger F
0c04580b5e JS: fix typo in doc 2019-07-01 13:25:55 +01:00
Asger F
ff4d6ece80 JS: Rename metrics to ResolvableCallX 2019-07-01 12:34:48 +01:00
Asger F
16e6dd12d0 JS: Address review comments part 1 2019-07-01 12:30:51 +01:00
Esben Sparre Andreasen
41e568d1f7 JS: classify files with many short variables as minified 2019-07-01 13:25:07 +02:00
Asger F
2ab72c4eef JS: Support line breaks in types 2019-07-01 11:46:30 +01:00
Asger F
625cdb8765 JS: Update test output 2019-07-01 11:29:55 +01:00
Asger F
4f05eab3fd JS: Make docs match reality 2019-07-01 11:29:55 +01:00
Asger F
2822e493ae JS: Switch to absolute offsets 2019-07-01 11:29:55 +01:00
Asger F
d6ba1ffa8a JS: Some loc() fixes 2019-07-01 11:29:55 +01:00
Asger F
fd0791bd8c JS: Parse types from original source string 2019-07-01 11:29:55 +01:00
Asger F
a3c7b631f4 JS: Extract type source text with substring 2019-07-01 11:29:55 +01:00
Asger F
edd96b056e JS: Remove redundant source field 2019-07-01 11:29:55 +01:00
Asger F
9403834af5 JS: Include leading star in parsed source 2019-07-01 11:29:55 +01:00
Asger F
9b4bdaecce JS: Remove unneeded replace call 2019-07-01 11:29:55 +01:00
semmle-qlci
a4fa2982de Merge pull request #1526 from xiemaisi/js/remove-TrackedExpr
Approved by esben-semmle
2019-07-01 11:10:44 +01:00
semmle-qlci
4f3cbe0029 Merge pull request #1521 from hvitved/csharp/constant-condition-fp
Approved by calumgrant
2019-07-01 10:52:14 +01:00
Esben Sparre Andreasen
2eb7e4a818 JS: classify x.test.js files with test(...) calls as jest tests 2019-07-01 10:28:10 +02:00
Esben Sparre Andreasen
5ebcef41fa JS: classify numeric file names as generated 2019-07-01 10:25:38 +02:00
Tom Hvitved
e6e606232d C#: Address review comments 2019-07-01 09:37:15 +02:00
semmle-qlci
ae3a48db58 Merge pull request #1510 from hvitved/csharp/date-queries-remove-precision
Approved by calumgrant
2019-07-01 08:28:08 +01:00