Commit Graph

21651 Commits

Author SHA1 Message Date
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
Mark Shannon
8558cb3f2f Python points-to: Update Overview.qll to reflect new object model. 2019-05-16 16:25:48 +01:00
Mark Shannon
2f940d013b Python points-to: Fully document object classes. 2019-05-16 16:18:54 +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
Luke Cartey
5e409a3eaa Python: Change invalid @kind. 2019-05-16 12:33:02 +01:00
Mark Shannon
d6d72dcef4 Python: Account for --respect-init when determining module name. 2019-05-16 11:46:47 +01: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
Asger F
b9ade67933 JS: Add change note 2019-05-16 10:56:47 +01:00
Asger F
9293010e4c JS: Fix some FPs in IncorrectSuffixCheck 2019-05-16 10:56:17 +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
Tom Hvitved
02ca09aa43 Data flow: performance improvements 2019-05-16 07:35:10 +02: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
Mark Shannon
d7558e8fe5 Python: Fix CP in pruner and cache to avoid re-evaluation. 2019-05-15 15:26:44 +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
Anders Schack-Mulligen
531d30f048 Java: Add SwitchExpr to Nullness::dereference. 2019-05-15 13:20:55 +02:00
Mark Shannon
2b72a50dbf Python points-to: Fix up re extension. 2019-05-15 11:24:40 +01:00
Mark Shannon
bf78c62594 Python points-to: Add objects representing missing modules and their attributes. 2019-05-15 11:24:01 +01: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
Asger F
682f2790cd JS: Address comments 2019-05-15 10:09:56 +01: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
Mark Shannon
b10a7cd3a4 Python points-to: Make behviour of instances more consistent. 2019-05-14 15:50:20 +01:00
Anders Schack-Mulligen
3eb3cd345d Java: Update qldoc and add callsImpl convenience wrapper. 2019-05-14 16:31:56 +02:00
Mark Shannon
8f74f918c7 Python points-to: Speed up call-points-to. 2019-05-14 14:49:29 +01:00
Anders Schack-Mulligen
f9e4512f32 Java: Update polyCalls to use virtual dispatch. 2019-05-14 15:36:12 +02:00
Mark Shannon
0afcb11a13 Python points-to: Make sure reachability can skip over if-statements. 2019-05-14 11:52:33 +01:00
Anders Schack-Mulligen
b71acd2ff9 Java: Deprecate RemoteUserInput 2019-05-14 12:33:36 +02:00
Mark Shannon
a5ff527ac2 Python: Remove test due to instability across minor versions. 2019-05-14 10:45:43 +01:00
Asger F
778244878a JS: Normalize whitespace 2019-05-14 10:31:28 +01: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
Mark Shannon
a8dc2908de Python: Update test results. 2019-05-13 17:32:29 +01:00
Asger F
fd9765b99f JS: Add qhelp 2019-05-13 17:31:12 +01:00
Mark Shannon
1c20336eb9 Python points-to. Fix attribute lookup for type. 2019-05-13 17:24:02 +01:00
Mark Shannon
a03e101e4f Python points-to: Improve performance. 2019-05-13 17:15:01 +01:00
Anders Schack-Mulligen
ebb63c8141 Java: Refactor Guard.controls in terms of dominating edges. 2019-05-13 16:35:30 +02:00
Asger F
0c715f7540 JS: Lower precision to medium 2019-05-13 15:20:40 +01:00
Asger F
aaf503837d JS: Move prototype pollution into real query 2019-05-13 15:20:25 +01:00