Commit Graph

4763 Commits

Author SHA1 Message Date
yh-semmle
e5f4d475d0 Merge pull request #1320 from aschackmull/java/guardslogic-perf
Java: Fix join-order for GuardsLogic::conditionalAssign.
2019-05-19 22:23:18 -04:00
Esben Sparre Andreasen
8256f2e736 Merge pull request #1308 from asger-semmle/exceptional-flow
JS: Add flow through exceptions
2019-05-17 08:33:44 +02:00
Robert Marsh
762c977be7 Merge pull request #1326 from jbj/addressConstantVariable-isConstexpr
C++: Use isConstexpr instead of workaround in AddressConstantExpr
2019-05-16 15:18:56 -07:00
Robert Marsh
5f77ac4cf5 Merge pull request #1325 from jbj/reachableRecursive
C++: reachableRecursive refactor for performance
2019-05-16 14:05:57 -07:00
Asger F
9c1208e751 JS: Add change note 2019-05-16 17:50:10 +01:00
Asger F
65cbd47a2d Merge pull request #1314 from xiemaisi/js/fix-hardcoded-pw-fps
JavaScript: Further broaden the whitelist in `PasswordInConfigurationFile`.
2019-05-16 14:42:09 +01:00
Jonas Jensen
947aaa9e4e C++: reachableRecursive refactor for performance
The `reachable` predicate is large and slow to compute. It's part of a
mutual recursion that's non-linear, meaning it has a recursive call on
both sides of an `and`.

This change removes a part of the base case that has no effect on
recursive cases. The removed part is added back after the recursion has
finished.

Before, on Wireshark:

    ControlFlowGraph::Cached::reachable#f .......... 20.8s (executed 9800 times)
    ConstantExprs::successors_adapted#ff ........... 4.2s (executed 615 times)
    ConstantExprs::potentiallyReturningFunction#f .. 3.9s (executed 9799 times)
    ConstantExprs::possiblePredecessor#f ........... 2.9s (executed 788 times)

After, on Wireshark:

    ConstantExprs::reachableRecursive#f ............ 13.2s (executed 9800 times)
    ConstantExprs::successors_adapted#ff ........... 4.2s (executed 615 times)
    ConstantExprs::potentiallyReturningFunction#f .. 4.3s (executed 9799 times)
    ConstantExprs::possiblePredecessor#f ........... 2.6s (executed 788 times)

I've verified that this change doesn't change what's computed by
checking that the output of the following query is unchanged:

    import cpp
    import semmle.code.cpp.controlflow.internal.ConstantExprs

    select
      strictcount(ControlFlowNode n | reachable(n)) as reachable,
      strictcount(ControlFlowNode n1, ControlFlowNode n2 | n2 = n1.getASuccessor()) as edges,
      strictcount(FunctionCall c | aborting(c)) as abortingCall,
      strictcount(Function f | abortingFunction(f)) as abortingFunction
2019-05-16 13:39:23 +02:00
Calum Grant
c1e627d739 Merge pull request #1312 from hvitved/csharp/variable-preds
C#: Refactor predicates in `Variable` class to be defined by dispatch
2019-05-16 12:35:12 +01:00
Jonas Jensen
db6a807ff6 C++: Move same-stage predicates into cached module
This change only moves code around -- there are no changes to predicate
bodies or signatures.

The predicates that go in `ConstantExprs.Cached` after this change were
already cached in the same stage or, in the case of the `aborting*`
predicates, did not need to be cached. This is a fortunate consequence
of how the mutual recursion between the predicates happens to work, and
it's not going to be the case after the next commit.
2019-05-16 13:34:50 +02:00
Mark Shannon
d1a711e459 Merge pull request #1296 from RasmusSemmle/master
Add pythagorean query
2019-05-16 11:02:56 +01:00
Calum Grant
6994ba904b Merge pull request #1309 from hvitved/csharp/get-explicit-arg-nomagic
Add `pragma[nomagic]` to `getExplicitArgument()`
2019-05-16 10:57:00 +01:00
semmle-qlci
649979de3e Merge pull request #1327 from asger-semmle/express-nomagic
Approved by esben-semmle
2019-05-16 10:43:10 +01:00
Robert Marsh
14795863e2 Merge pull request #1303 from jbj/hasQualifiedName
C++: Fix `getQualifiedName` performance issues
2019-05-15 12:42:57 -07:00
Asger F
8fe2319a23 JS: Fix lurking cartesian product in Express 2019-05-15 18:07:24 +01:00
Calum Grant
6a198ff7e1 Merge pull request #1306 from hvitved/csharp/dataflow/shared-implementation
C#: Adopt shared data flow implementation
2019-05-15 17:41:46 +01:00
Jonas Jensen
d820fc9cd2 C++: Address review comments about the comments 2019-05-15 14:55:26 +02:00
Jonas Jensen
f38253da89 C++: Use isConstexpr instead of workaround
The `addressConstantVariable` predicate was the slowest single predicate
when running the full LGTM suite on Chromium. Fortunately it's only
executed once, but it could be easily made faster by using the new
`Variable.isConstexpr` predicate instead of the slow workaround that was
in its place.
2019-05-15 14:41:05 +02:00
Jonas Jensen
8b012b2cab C++: Remove unneeded import 2019-05-15 14:35:05 +02:00
Tom Hvitved
949b3601d0 C#: Address review comments 2019-05-15 14:10:42 +02:00
Taus
1076c03016 Merge pull request #1323 from markshannon/hotfix-path-fix
Python QL: Use Module.getPath() to implement ModuleObject.getPath()
2019-05-15 11:46:36 +02:00
Mark Shannon
0035dc2982 Python QL: Use Module.getPath() to implement ModuleObject.getPath() 2019-05-15 10:09:00 +01:00
semmle-qlci
ec10b76d5a Merge pull request #1321 from aschackmull/java/polycalls
Approved by pavgust
2019-05-15 08:52:34 +01:00
Anders Schack-Mulligen
3eb3cd345d Java: Update qldoc and add callsImpl convenience wrapper. 2019-05-14 16:31:56 +02:00
Anders Schack-Mulligen
f9e4512f32 Java: Update polyCalls to use virtual dispatch. 2019-05-14 15:36:12 +02:00
Anders Schack-Mulligen
14cad57960 Java: Improve joinorder for GuardsLogic::conditionalAssign. 2019-05-14 11:28:18 +02:00
Tom Hvitved
89e60dc9bf C#: Simplify CallContext.qll 2019-05-14 11:24:23 +02:00
Tom Hvitved
0096024396 Merge pull request #1174 from calumgrant/cs/extractor-diagnostics
C#: Log compiler and extractor diagnostics
2019-05-13 12:53:12 +02:00
Asger F
4db7aa6ed2 JS: Relax type inference to account for overriding 2019-05-13 10:18:19 +01:00
Calum Grant
88b5719103 C#: Add DB upgrade script 2019-05-13 09:18:52 +01:00
Calum Grant
7a3b6575a5 C#: Update expected output following roslyn-3.0.0 update. 2019-05-13 09:18:52 +01:00
calum
7b19402b1f C#: Update DB stats. 2019-05-13 09:18:52 +01:00
calum
39bb3f2d52 C#: Fix elapsed timings and add a test for it. 2019-05-13 09:18:52 +01:00
calum
c67e441003 C#: Implement compilation_referencing_files and update comments for C#. 2019-05-13 09:18:52 +01:00
calum
1a99f4f253 C#: Fix unit tests due to qltest mangling output. 2019-05-13 09:18:52 +01:00
calum
2a484dc4ea C#: Fix alerts and tests. 2019-05-13 09:18:52 +01:00
calum
66b3df7f29 C#: Fix unit tests. 2019-05-13 09:18:52 +01:00
calum
3046cc494a C#: Code tidy. 2019-05-13 09:18:52 +01:00
calum
343cddcbb7 C#: Refactor extractor errors and log extractor errors to the database. 2019-05-13 09:18:52 +01:00
calum
e1158bb5e5 C#: Store compilations, compiler diagnostics and performance in the database. 2019-05-13 09:18:52 +01:00
Jonas Jensen
bb67ac9ad1 Merge pull request #1219 from geoffw0/msfix2
CPP: Fix FormatLiteral.isMicrosoft
2019-05-13 09:24:49 +02:00
Geoffrey White
4cc23cce13 CPP: Document. 2019-05-10 16:26:39 +01:00
Geoffrey White
581266c347 CPP: Alternative fix. 2019-05-10 16:26:38 +01:00
Max Schaefer
79e01a2de5 Merge pull request #1305 from aschackmull/java/abstract-flowsources
Java: Introduce an abstract class RemoteFlowSource to ease customization.
2019-05-10 11:42:15 +01:00
Max Schaefer
b478c0ddaa JavaScript: Further broaden the whitelist in PasswordInConfigurationFile. 2019-05-09 17:07:59 +01:00
Anders Schack-Mulligen
66813a91ef Java: Postpone deprecation to separate PR. 2019-05-09 13:40:25 +02:00
Tom Hvitved
e3b83d04f5 C#: Refactor predicates in Variable class to be defined by dispatch 2019-05-09 11:53:42 +02:00
semmle-qlci
9653fbd4f7 Merge pull request #1311 from emarteca/unreachableThrows
Approved by xiemaisi
2019-05-09 10:37:41 +01:00
Ellen Arteca
893f62f334 Stylistic issue: replace \"eg\" by \"example\", as requested 2019-05-09 09:30:12 +01:00
Ellen Arteca
a12d12d59a JavaScript: Update UnreachableStmt query so unreachable throws no longer gives an alert 2019-05-08 16:25:54 +01:00
semmle-qlci
13e04f459d Merge pull request #1310 from xiemaisi/js/fix-hardcoded-pw-fps
Approved by asger-semmle
2019-05-08 14:08:36 +01:00