Commit Graph

19777 Commits

Author SHA1 Message Date
Asger F
11c07a3217 TS: Update to TypeScript 3.4.5 2019-04-30 12:41:59 +01:00
semmle-qlci
3f70d91a11 Merge pull request #1288 from xiemaisi/js/fix-end-node-labels
Approved by asger-semmle
2019-04-30 07:32:29 +01:00
Ziemowit Laski
be77eb7367 [CPP-340] Add new test cases to test.c; this required the .expected
files to be regenerated.
2019-04-29 15:30:28 -07:00
Robert Marsh
514d405630 C++: Use CallInstruction as DataFlowCall 2019-04-29 14:18:09 -07:00
Ziemowit Laski
d14696729b [CPP-340] Fix end-of-line formatting for our change notes.
Bring back entry accidentally deleted during previous merge.
2019-04-29 14:05:58 -07:00
Tom Hvitved
5f6e9121b3 C++: Generalize FunctionCall to Call in data-flow library 2019-04-29 20:42:07 +02:00
Tom Hvitved
29e59e6d1e Address review comments 2019-04-29 20:19:31 +02:00
semmle-qlci
2ede941097 Merge pull request #1291 from jbj/backEdgeSuccessor-perf
Approved by dave-bartolomeo
2019-04-29 18:18:27 +01:00
semmle-qlci
0ffba8b4eb Merge pull request #1289 from jbj/dominanceFrontier-iterated-ir
Approved by dave-bartolomeo
2019-04-29 18:14:20 +01:00
semmle-qlci
d53f5aac13 Merge pull request #1228 from jbj/ir-result-type-docs
Approved by dave-bartolomeo
2019-04-29 18:07:22 +01:00
Ziemowit Laski
a0cfe826ee [CPP-340] Replace whitelist with f.getBlock() test. Fix doc comment. 2019-04-29 09:58:31 -07:00
Mark Shannon
d44ce4f1df Python points-to: Performance improvement. 2019-04-29 17:53:18 +01:00
Mark Shannon
15a7ac3680 Python: update failed inference query to use latest points-to. 2019-04-29 16:59:51 +01:00
Mark Shannon
dfc0a80cc5 Python points-to: Handle old-style classes correctly. 2019-04-29 16:40:46 +01:00
Max Schaefer
7ca5cc22d8 Merge pull request #1257 from asger-semmle/jsdoc
JS: Add common interface between TypeExpr and JSDocTypeExpr
2019-04-29 16:20:17 +01:00
Mark Shannon
3ca4524f7a Python points-to: Improve handling of __call__() a bit. 2019-04-29 15:15:01 +01:00
Jonas Jensen
5fd425ae95 C++: fix IRBlock::backEdgeSuccessor performance
The `IRBlock::backEdgeSuccessor` predicate, in its three copies, had
become slow:

    6:IRBlock::Cached::backEdgeSuccessor#fff ...... 1m1s
    7:IRBlock::Cached::backEdgeSuccessor#2#fff .... 52.3s
    8:IRBlock::Cached::backEdgeSuccessor#3#fff .... 26.4s

The slow part was finding all the nodes involved in cycles in the
`forwardEdgeRaw` graph. This was done with `forwardEdgeRaw+(pred, pred)`,
but that got compiled into a materialization of `forwardEdgeRaw+`, which
is a huge relation with 1,816,752,107 rows on Wireshark:

    (1474s) Starting to evaluate predicate IRBlock::Cached::backEdgeSuccessor#3#fff
    (1501s) Tuple counts:
    0          ~0%     {2} r1 = SELECT #IRBlock::Cached::forwardEdgeRaw#3#ffPlus ON FIELDS #IRBlock::Cached::forwardEdgeRaw#3#ffPlus.<0>=#IRBlock::Cached::forwardEdgeRaw#3#ffPlus.<1>
    0          ~0%     {1} r2 = SCAN r1 OUTPUT FIELDS {r1.<0>}
    0          ~0%     {3} r3 = JOIN r2 WITH IRBlock::Cached::blockSuccessor#6#fff ON r2.<0>=IRBlock::Cached::blockSuccessor#6#fff.<0> OUTPUT FIELDS {r2.<0>,IRBlock::Cached::blockSuccessor#6#fff.<1>,IRBlock::Cached::blockSuccessor#6#fff.<2>}
    12411      ~7%     {3} r4 = IRBlock::Cached::backEdgeSuccessorRaw#3#fff \/ r3
                       return r4
    (1501s)  >>> Relation IRBlock::Cached::backEdgeSuccessor#3#fff: 12411 rows using 0 MB

The problem is the `SELECT`. It's fast to join on a fastTC result once
we know what we're looking for, so this fix materializes the identity
relation on `IRBlock` and joins with that so the fastTC ends up on the
RHS of a join, where it's fast. I had to introduce a helper predicate
because even with `noopt` I couldn't get `pred = pred2` to come _before_
`forwardEdgeRaw+(pred, pred2)`. The predicate now takes less than a
second to evaluate:

    (539s) Starting to evaluate predicate IRBlock::Cached::backEdgeSuccessor#fff
    (539s)  >>> Relation IRBlock::Cached::blockImmediatelyDominates#ff: 574677 rows using 0 MB
    (539s) 	 ... created with 574677 rows and 2 columns.
    (539s) Tuple counts:
    702445     ~1%     {2} r1 = SELECT IRBlock::Cached::blockIdentity#ff ON FIELDS IRBlock::Cached::blockIdentity#ff.<0>=IRBlock::Cached::blockIdentity#ff.<1>
    702445     ~1%     {2} r2 = SCAN r1 OUTPUT FIELDS {r1.<0>,r1.<0>}
    0          ~0%     {1} r3 = JOIN r2 WITH #IRBlock::Cached::forwardEdgeRaw#ffPlus ON r2.<0>=#IRBlock::Cached::forwardEdgeRaw#ffPlus.<0> AND r2.<1>=#IRBlock::Cached::forwardEdgeRaw#ffPlus.<1> OUTPUT FIELDS {r2.<0>}
    0          ~0%     {3} r4 = JOIN r3 WITH IRBlock::Cached::blockSuccessor#2#fff ON r3.<0>=IRBlock::Cached::blockSuccessor#2#fff.<0> OUTPUT FIELDS {r3.<0>,IRBlock::Cached::blockSuccessor#2#fff.<1>,IRBlock::Cached::blockSuccessor#2#fff.<2>}
    20487      ~0%     {3} r5 = IRBlock::Cached::backEdgeSuccessorRaw#fff \/ r4
                       return r5
    (539s)  >>> Relation IRBlock::Cached::backEdgeSuccessor#fff: 20487 rows using 0 MB
2019-04-29 15:44:50 +02:00
Mark Shannon
65a30ab392 Adjust a couple of query tests to work with latest points-to. 2019-04-29 14:28:51 +01:00
Max Schaefer
8a34ea8b71 Merge pull request #1284 from esben-semmle/js/fix-azure-performance
JS: fix azure performance
2019-04-29 13:15:16 +01:00
Mark Shannon
6a5ec51623 Update IsComparisons.qll to account for not tracking attributes in detail. 2019-04-29 12:22:48 +01:00
Mark Shannon
55511430cb Python points-to. Don't let unknown values escape refersTo(). 2019-04-29 12:22:17 +01:00
Jonas Jensen
cd7ba176ab C++: iterated dominance frontier algorithm for IR
Use the iterated dominance frontier algorithm to speed up dominance
frontier calculations. The implementation is copied from d310338c9b.

Before this change, the SSA calculations for unaliased and aliased SSA
used 169.9 seconds in total on these predicates:

    7:Dominance::getDominanceFrontier#2#ff .. 49s
    7:Dominance::blockDominates#2#ff ........ 47.5s
    8:Dominance::getDominanceFrontier#ff .... 44.4s
    8:Dominance::blockDominates#ff .......... 29s

After this change, the above predicates are replaced by two copies of
`getDominanceFrontier`, each of which takes less than a second.
2019-04-29 13:01:37 +02:00
ian-semmle
5fd10b56a2 Merge pull request #1280 from jbj/noTarget-workaround
C++: Work around extractor issue CPP-383
2019-04-29 10:47:06 +01:00
Calum Grant
11c1fc8512 Merge pull request #1281 from felicity-semmle/1.20/SD-3391-csharp-version-ql-support
1.20 release: Update supported versions for C#
2019-04-29 09:27:54 +01:00
Tom Hvitved
58babdd425 Merge pull request #1187 from calumgrant/cs/expression-null
C#: Fix FP in cs/constant-condition
2019-04-29 09:37:30 +02:00
Jonas Jensen
c112a4dd20 Merge pull request #1285 from geoffw0/rnperf
CPP: Improve performance of RedundantNullCheckSimple.ql
2019-04-29 08:41:43 +02:00
semmle-qlci
52d6626547 Merge pull request #1242 from esben-semmle/js/whitelist-trailing-newline-removal
Approved by xiemaisi
2019-04-29 07:35:15 +01:00
Ziemowit Laski
4a760b1561 [CPP-340] Delete ArgumentsToImplicit.ql and associated files.
Reduce MistypedFunctionArguments.ql precision to `medium`.
2019-04-28 13:49:46 -07:00
Asger F
3e7bac465b JS: fix join ordering in SimpleParameter.getJSDocTag 2019-04-26 16:56:04 +01:00
Asger F
db3060d336 JS: Add missing override 2019-04-26 16:56:04 +01:00
Asger F
a17756c3d5 JS: Fix formatting 2019-04-26 16:56:04 +01:00
Asger F
2f98acaf6e JS: upgrade script 2019-04-26 16:56:04 +01:00
Asger F
f99db08542 JS: Update trap files 2019-04-26 16:56:04 +01:00
Asger F
393a9fd7b0 JS: Add change notes 2019-04-26 16:56:04 +01:00
Asger F
9086dfdc6f JS: TypeAnnotation.getType() for backwards compatibility 2019-04-26 16:56:04 +01:00
Asger F
e9fcb670ff JS: Provide source locations for JSDocTypeExpr 2019-04-26 16:56:04 +01:00
Asger F
cf8c327a10 JS: make TypeAnnotation extend Locatable 2019-04-26 16:56:04 +01:00
Max Schaefer
c44f99a204 Update javascript/ql/src/semmle/javascript/Variables.qll
Co-Authored-By: asger-semmle <42069257+asger-semmle@users.noreply.github.com>
2019-04-26 16:56:04 +01:00
Asger F
6eb8c692b1 JS: Add partial backwards compatibility with ASTNode 2019-04-26 16:56:04 +01:00
Asger F
e295c3a224 JS: Add JSDoc test 2019-04-26 16:56:04 +01:00
Asger F
6b2b64cb2e JS: test case with unresolved types in TS 2019-04-26 16:56:04 +01:00
Asger F
c9c9a32a37 JS: hasQualifiedName 2019-04-26 16:56:04 +01:00
Asger F
454fff1398 JS: Implement getAnUnderlyingType(). 2019-04-26 16:56:04 +01:00
Asger F
8458a64642 JS: implement isXXX methods in JSDocTypeExpr classes 2019-04-26 16:56:04 +01:00
Asger F
c92a6b72b5 JS: Update getTypeAnnotation() to return TypeAnnotations 2019-04-26 16:56:04 +01:00
Asger F
be5d90d4e7 JS: Make use of JSDocParamTag 2019-04-26 16:56:04 +01:00
Asger F
967752c6c1 JS: Add TypeAnnotations class 2019-04-26 16:56:04 +01:00
Mark Shannon
abf0347fce Python points-to: Split strings into bytes and unicode. 2019-04-26 16:21:47 +01:00
Mark Shannon
48c0cbe51a Python: improve handling of __all__ 2019-04-26 16:21:47 +01:00
Mark Shannon
3bb61e7410 Python points-to: Improve handling of subscripts and sequence inequalities. 2019-04-26 16:21:47 +01:00