Commit Graph

3471 Commits

Author SHA1 Message Date
Calum Grant
8012dacd69 Merge pull request #1104 from hvitved/csharp/dispatch/performance
C#: Dispatch library performance tweaks
2019-03-28 11:57:19 +00:00
Tom Hvitved
7634973bb4 C#: Handle named attribute arguments 2019-03-27 11:10:24 +01:00
semmle-qlci
59285be0b8 Merge pull request #1167 from hvitved/csharp/icrypto-qhelp
Approved by aibaars
2019-03-26 18:49:43 +00:00
Tom Hvitved
273e77e800 C#: Fix qhelp for ICryptoTransform queries 2019-03-26 14:38:29 +01:00
Calum Grant
2229409180 Merge pull request #1088 from hvitved/csharp/no-qname-for-local-scope-vars
C#: No qualified names for local scope variables
2019-03-26 12:58:20 +00:00
Calum Grant
01aa4ecf2f Merge pull request #1075 from hvitved/csharp/get-location-to-string
C#: Simplify dispatch hierarchy for `getLocation()` and `toString()`
2019-03-26 12:56:29 +00:00
Tom Hvitved
e01246acc8 C#: Autoformat 2019-03-26 13:38:47 +01:00
Tom Hvitved
1994f00495 C#: Introduce isBranch() predicate
We already have `isJoin()`, so it makes sense to have `isBranch()` for symmetry.
2019-03-25 09:51:26 +01:00
Tom Hvitved
1d05bccd87 Merge pull request #952 from calumgrant/cs/non-null-functions
C#: Better call analysis using CIL
2019-03-23 10:47:22 +01:00
Tom Hvitved
6c182564e7 C#: Adjustments to CIL/nullness analyses
- Cache predicates in the same stage using a cached module.
- Introduce `DefUse::defUseVariableUpdate()` and use in `CallableReturns.qll`.
  The updated file `csharp/ql/test/library-tests/cil/dataflow/Nullness.expected`
  demonstrates why this is needed.
- Utilize CIL analysis in `Guards::nonNullValue()`.
- Analyze SSA definitions in `AlwaysNullExpr`, similar to `NonNullExpr`.
2019-03-22 15:11:31 +01:00
Max Schaefer
8c460ae385 Merge remote-tracking branch 'upstream/master' into rc/1.20-merge-master
Conflict in `javascript/extractor/src/com/semmle/js/extractor/Main.java` resolved
in favour of `master`.
2019-03-21 14:46:29 +00:00
Tom Hvitved
414b7243c2 C#: More performance tweaks 2019-03-20 15:43:38 +01:00
Max Schaefer
6fbf487524 Merge remote-tracking branch 'upstream/rc/1.20' into mergeback-2019-03-19 2019-03-19 14:09:03 +00:00
calum
d5a4dcebd6 C#: Fix bug in dataflow library. 2019-03-18 17:59:56 +00:00
calum
e1e657c1e8 C#: Address review comments and update tests. 2019-03-18 17:59:56 +00:00
calum
dd64cd2dbe C#: Fix CIL::Method::canReturn() to ignore stubs and only consider the best implementation. 2019-03-18 17:59:56 +00:00
calum
d1ada9594c C#: Implement Type::isRefType() and Type::isValueType() 2019-03-18 17:59:48 +00:00
Tom Hvitved
6cd87757f6 C#: Fix a few minor performance regressions 2019-03-18 14:36:41 +01:00
Calum Grant
5a3cf2c5bb Merge pull request #1054 from raulgarciamsft/users/raulga/ICryptoTransformLambda
2n part of ICryptoTransform.
2019-03-15 12:55:09 +00:00
Raul Garcia
2521848322 Merging the scenarios. 2019-03-14 10:57:22 -07:00
Tom Hvitved
84c3073c2a C#: Fix performance regression in cs/user-controlled-bypass 2019-03-14 10:36:50 +01:00
Calum Grant
a547fbea14 Merge pull request #1073 from hvitved/csharp/get-an-indexer-call
C#: Improve performance and correctness of `IndexerProperty::getAnIndexerCall()`
2019-03-13 17:10:52 +00:00
Tom Hvitved
638af39aa0 C#: Dispatch library performance tweaks
- Restrict `OverridableCallable::getAnOverrider(ValueOrRefType t)` to types `t`
  that are sub types of the callable's declaring type.
- Use explicit recursion in `OverridableCallable::getInherited()`.
2019-03-13 13:59:46 +01:00
Raul Garcia
af6588eaa9 Replacing tabs for spaces 2019-03-12 11:47:38 -07:00
Raul Garcia
5be19d7da4 Separating some reusable code into QLL libraries.
Fixing bugs from code review.
2019-03-12 09:48:15 -07:00
calum
e00ada443a C#: Improve nullness and control flow by using CIL for null and throwing callables. 2019-03-12 16:13:29 +00:00
calum
3da8d3e82d C#: Identify CIL methods that are stubs, and exclude them from dataflow. 2019-03-12 16:13:29 +00:00
Tom Hvitved
089ad75a7b C#: Do not extend Element in ExternalArtifact.qll 2019-03-12 15:22:04 +01:00
Tom Hvitved
78b4df933b C#: Remove toString() override from Expr class 2019-03-12 09:10:08 +01:00
Tom Hvitved
6d5330b01e C#: Replace getLocation() with hasLocationInfo() in Attributable 2019-03-12 09:09:43 +01:00
Raul Garcia
4ad9163fa8 I fixed the typos, and added support for Parallel.Invoke.
Please let em know if this pattern works, and I can add other mechanisms to start new threads with a shared object.
Please also let me know what other mechanisms would you like me to add, I would like to focus on the most commonly used ones first. Thanks
2019-03-11 16:25:49 -07:00
Calum Grant
242f8f2b43 Merge pull request #1058 from hvitved/csharp/dataflow/performance
C#: Data flow performance improvements
2019-03-11 18:23:21 +00:00
Tom Hvitved
94adcc9520 C#: Improve performance and correctness of IndexerProperty::getAnIndexerCall()
Performance has been improved via suitable predicate folding, and correctness
has been improved as the line

```
result = getType().(RefType).getAnIndexer().getAnAccessor().getACall()
```

was missing a `getABaseType*()` (now using the simpler `hasMember()` predicate
instead).
2019-03-11 13:30:20 +01:00
Tom Hvitved
10491e6497 C#: More data flow performance tweaks 2019-03-11 10:54:07 +01:00
calum
3fd10ec994 C#: Address review comment. 2019-03-11 09:38:23 +00:00
calum
d6c315bbdf C#: Model NHibernate framework. 2019-03-11 09:38:22 +00:00
Tom Hvitved
b48576d7b9 C#: Address review comments 2019-03-10 15:45:31 +01:00
Tom Hvitved
8959d528a1 Merge remote-tracking branch 'upstream/rc/1.20' into csharp/dataflow/performance 2019-03-10 15:07:18 +01:00
Tom Hvitved
548a28ff7d Merge pull request #912 from calumgrant/cs/ef
C#: Model EntityFrameworkCore
2019-03-08 22:13:13 +01:00
Tom Hvitved
6f44384db9 C#: No qualified name for local scope variables 2019-03-08 15:02:07 +01:00
Calum Grant
f6828fa5e5 Merge pull request #1053 from hvitved/csharp/dispatch-tweak
C#: `Dispatch.qll` performance tweaks
2019-03-07 16:21:29 +00:00
calum
b358f87570 C#: Improve performance. 2019-03-07 14:56:07 +00:00
calum
6cf2aee2ce C#: Fix failed CIL test. 2019-03-07 12:58:50 +00:00
Tom Hvitved
397cc56a6f C#: Cache DataFlow::Node::getLocation() 2019-03-07 12:16:12 +01:00
Tom Hvitved
e6f7632d4c C#: Introduce data flow return nodes
Before this change,

```
flowOutOfCallableStep(CallNode call, ReturnNode ret, OutNode out, CallContext cc)
```

would compute all combinations of call sites `call` and returned expressions `ret`
up front.

Now, we instead introduce explicit return nodes, so each callable has exactly
one return node (as well as one for each `out`/`ref` parameter). There is then
local flow from a returned expression to the relevant return node, and
`flowOutOfCallableStep()` computes combinations of call sites and return nodes.

Not only does this result in better performance, it also makes `flowOutOfCallableStep()`
symmetric to `flowIntoCallableStep()`, where each argument is mapped to a parameter,
and not to all reads of that parameter.
2019-03-07 12:16:06 +01:00
Tom Hvitved
e6630cda6b C#: Use explicit recursion in data flow predicate 2019-03-07 12:16:01 +01:00
Tom Hvitved
738d1117f2 C#: Avoid recomputing flowThroughCallableLibraryOutRef() between queries 2019-03-07 12:15:53 +01:00
Tom Hvitved
397ff84898 C#: Cache Ssa::ExplicitDefinition::getADefinition() 2019-03-07 12:15:44 +01:00
Raul Garcia
2e0c337a94 2n part of ICryptoTransform.
Detecting potential unsafe usage (object shared across multiple threads) on variables captured by Lambda
2019-03-06 17:12:33 -08:00
Calum Grant
c087394917 Merge pull request #1030 from hvitved/csharp/structural-comparison
C#: Speedup structural comparison library
2019-03-06 15:47:44 +00:00