Commit Graph

510 Commits

Author SHA1 Message Date
Aditya Sharad
5e7b7818df Version: Bump to 1.18.1 release. 2018-10-29 18:02:58 +00:00
Aditya Sharad
c88db424fa Merge pull request #343 from geoffw0/av-35-1.18
CPP: Fix hasXMacro performance.
2018-10-23 10:24:16 +01:00
Max Schaefer
3522200e90 Merge pull request #342 from xiemaisi/rc/1.18-cherry-picks
JavaScript: 1.18.1 cherry-picks
2018-10-22 20:03:22 +01:00
Geoffrey White
de1556042a CPP: Fix hasXMacro performance. 2018-10-22 19:43:04 +01:00
Max Schaefer
25224cc4a0 Revert "TypeScript: disable queries that rely on token information"
This reverts commit 003b600e24.
2018-10-22 11:06:11 +01:00
Esben Sparre Andreasen
2e49cd117a JS: avoid flagging early returns in js/user-controlled-bypass
(cherry picked from commit ffbbb807f4)
2018-10-19 08:30:03 +01:00
Asger F
f9634040b0 TypeScript: add test case with mixed rescanned tokens
(cherry picked from commit 057af7c865)
2018-10-19 08:30:03 +01:00
Asger F
39c788f4f1 TypeScript: test case for tokens starting with ">"
(cherry picked from commit d3a1df644c)
2018-10-19 08:30:03 +01:00
Asger F
2abe34b2f9 TypeScript: test case for whitespace before a rescanned token
(cherry picked from commit a199035a05)
2018-10-19 08:30:03 +01:00
Asger F
cbf06ae74d TypeScript: test case for tokenization of template literals
(cherry picked from commit 9146cc26bd)
2018-10-19 08:30:03 +01:00
Asger F
4d7e762629 TS: test case for type expansion through type parameter bound
(cherry picked from commit 8bc92bd534)
2018-10-19 08:30:03 +01:00
Max Schaefer
374fd597d7 JavaScript: Reinstate override.
(cherry picked from commit df5a8651c3)
2018-10-19 08:30:03 +01:00
Max Schaefer
b0425a298c JavaScript: Eliminate slow antijoin predicate.
(cherry picked from commit 0cfd04dfa2)
2018-10-19 08:30:03 +01:00
Max Schaefer
5167d43fbc JavaScript: Refactor AnalyzedPropertyWrite::writes to enable correct modelling of variable exports.
(cherry picked from commit 080f974663)
2018-10-19 08:30:03 +01:00
Max Schaefer
898ba94837 JavaScript: Address review comments.
(cherry picked from commit 6835815673)
2018-10-19 08:30:03 +01:00
Max Schaefer
2b7d69aaf4 JavaScript: Add support for Google Cloud Spanner.
(cherry picked from commit cd284b2f97)
2018-10-19 08:30:03 +01:00
Tom Hvitved
b282444740 Revert "JavaScript: Patch CFG to improve support for non-top level import declarations."
This reverts commit f05e777e64.
2018-10-19 08:30:03 +01:00
Max Schaefer
5e75a62f5c JavaScript: Add test case for type inference in the presence of non-toplevel imports.
(cherry picked from commit 8b7bb8cecc)
2018-10-19 08:30:03 +01:00
Max Schaefer
e683b51611 JavaScript: Generalise code that assumes imports only appear at the toplevel.
(cherry picked from commit db32dc2bdf)
2018-10-19 08:30:03 +01:00
Max Schaefer
de108a843d JavaScript: Patch CFG to improve support for non-top level import declarations. 2018-10-19 08:30:03 +01:00
Max Schaefer
6a75ebbae2 JavaScript: Update model of DOMException.
cf. https://developer.mozilla.org/en-US/docs/Web/API/DOMException/DOMException

(cherry picked from commit 8cc7f5c242)
2018-10-17 11:38:29 +01:00
Max Schaefer
d57e93d5c6 JavaScript: Fix typo in query help.
(cherry picked from commit 1ab943c16b)
2018-10-17 11:38:29 +01:00
Geoffrey White
e2a001f925 Merge pull request #285 from jbj/primitive-bb-joinorder
C++: Speed up primitive basic block calculation
2018-10-06 19:47:49 +01:00
Jonas Jensen
11e03b3161 C++: Fix primitive_basic_block_member join order
This predicate looked like a join of two already-computed predicates,
but it was a bit more complicated because the `*` operator expands into
two cases: the reflexive case and the transitive case. The join order
for the transitive case placed the `PrimitiveBasicBlock` charpred call
_after_ the `member_step+` call, which means that all the tuples of
`member_step+` passed through the pipeline.

This commit changes the implementation by fully writing out the
expansion of `*` into two cases, where the base case is manually
specialised to make sure the join orderer doesn't get tempted into
reusing the same strategy for both cases. This speeds up the predicate
from 2m38s to 1s on a snapshot of our own C/C++ code.
2018-10-05 14:26:04 +02:00
Jonas Jensen
265852058d C++: Faster implementation of BB entry node
The existing implementation of `primitive_basic_block_entry_node` was
"cleverly" computing two properties about `node` with a single
`strictcount`: whether `node` had multiple predecessors and whether any
of those predecessors had more than once successor. This was fast enough
on most snapshots, but on the snapshot of our own code it took 37
seconds to compute `primitive_basic_block_entry_node` and its auxiliary
predicates. This is likely to have affected other large snapshots too.

With this change, the property is computed like in our other languages,
and it brings the run time down to 4 seconds.
2018-10-05 14:20:03 +02:00
Jonas Jensen
7691c0a345 Merge pull request #280 from pavgust/imp/use-in-own-init
UseInOwnInitialiser: Refactor logic slightly.
2018-10-04 20:25:36 +02:00
Pavel Avgustinov
6d77a791ac UseInOwnInitialiser: Refactor logic slightly.
By pulling out the class `VariableAccessInInitialiser`, we can
avoid some redundant work on pathological databases, improving
performance.
2018-10-04 14:25:59 +01:00
Nick Rolfe
828d3cb138 Merge pull request #250 from adityasharad/version/1.18.1-dev
Version: Bump to 1.18.1 dev.
2018-10-01 10:59:52 +01:00
Aditya Sharad
1c71a856e1 Version: Bump to 1.18.1 dev. 2018-09-28 16:39:44 +01:00
Max Schaefer
b8b41a42fa Merge pull request #248 from adityasharad/fix/eclipse-versions-1.18
Version: Fix C# and JavaScript Eclipse plugins for 1.18.
v1.18.0
2018-09-28 14:17:40 +01:00
Aditya Sharad
f5bd737ada Version: Fix C# and JavaScript Eclipse plugins for 1.18. 2018-09-28 14:10:06 +01:00
ian-semmle
077ce6a4be Merge pull request #242 from jbj/unresolveCheckResult
C++: Make unresolve dispatch on `result`
2018-09-27 14:59:34 +01:00
Aditya Sharad
1f9da28647 Merge pull request #243 from jbj/CommentedOutCode-join-fix
C++: Fix join order in CommentedOutCode
2018-09-27 14:59:13 +01:00
Jonas Jensen
19435e07a1 C++: Fix join order in CommentedOutCode
After the recent inlining of `unresolveElement`, the join order in
`CommentedOutCode` became a problem. The join orderer was tempted to
join the two `hasLocationInfo` calls first because they had one column
in common. With this commit, they have no columns in common. It follows
from the other predicates in the same file that this column would be the
same, so there is no need to assert it in this predicate and risk that
the join orderer uses that information.

On Wireshark, the `CommentBlock::hasLocationInfo` predicate goes from
taking 2m2s to taking 180ms. The query produces the same 7,448 alerts.
2018-09-27 14:07:13 +02:00
Jonas Jensen
0da452d59a C++: Revert object-orientation of unresolveElement
The change to make `unresolveElement` a member predicate was helpful for
the optimiser when it dispatched on `this`, but now that it "dispatches"
on `result` it's just an unnecessary pollution of the `ElementBase`
namespace.
2018-09-27 13:25:30 +02:00
Jonas Jensen
c61b311682 C++: Make unresolve dispatch on result, not this
This change means that there are no results for `unresolveElement(t)`
where `t` is a "junk type" -- a class definition that is not in the
image of `resolveClass`. These "junk types" still exist as `Element`s,
but they will never be returned by any predicate that goes through
`unresolveElement` to query the db.

We get a small reduction in DIL size and a significant speed
improvement. The DIL for `NewArrayDeleteMismatch.ql` is reduced from
27,630 lines to 27,507 lines, and the total analysis time for the LGTM
suite on jdk8u is reduced from 1158s to 984s.
2018-09-27 13:23:11 +02:00
Aditya Sharad
4767d85a96 Merge pull request #239 from ian-semmle/type_mention
C++: Update test output
2018-09-27 11:02:46 +01:00
Pavel Avgustinov
1248088519 Merge pull request #237 from adityasharad/version/1.18.0-release
Version: Bump to 1.18.0 release.
2018-09-27 11:01:06 +01:00
Ian Lynagh
fd91374b2f C++: Update test output 2018-09-26 18:22:20 +01:00
Aditya Sharad
51697f077c Version: Bump to 1.18.0 release. 2018-09-26 18:18:20 +01:00
Aditya Sharad
40c29263c4 Merge pull request #232 from jbj/resolveElement-member
C++: make `unresolve` a member of ElementBase
2018-09-26 18:09:48 +01:00
Jonas Jensen
3b2512fa0d C++: pragma[nomagic] in Overflow.qll
These two predicates were supposed to be fast but became slow after the
recent inlining of `unresolve`.
2018-09-26 14:39:44 +02:00
Jonas Jensen
6ccd208d4e C++: Prevent incomplete classes from being Types
Raw classes from the database that are incomplete and should be
represented by their complete twin are now allowed to be `Element`s for
performance reasons, but this commit prevents them from being `Type`s.
It was causing confusion in test results and might also cause confusion
in queries.
2018-09-26 14:02:15 +02:00
Jonas Jensen
0e0ab1ea97 C++: make unresolve a member of ElementBase
Also remove the charpred of ElementBase. This gets rid of many redundant
charpred checks. It means that incomplete classes from the db are now
`Element`s, which is maybe noisy but should not be harmful.

Together, these changes give a great reduction in DIL and should help
the optimiser. It brings the DIL of `UncontrolledFormatString.ql` down
from 43,908 lines to 35,400 lines.
2018-09-26 11:12:40 +02:00
Jonas Jensen
3470ebc583 Merge pull request #223 from pavgust/imp/no-instantiation-mentions
C++ definitions: Ignore type mentions of class inatantiations.
2018-09-25 09:31:10 +02:00
Pavel Avgustinov
fa698380e2 C++ definitions: Ignore type mentions of class inatantiations.
We currently erroneously keep mentions of class instantiations, which
can lead to bad performance on template-heavy code bases. We never
want to link those anyway, so we can simply suppress them.
2018-09-24 18:18:30 +01:00
ian-semmle
4b0ab602e7 Merge pull request #202 from jbj/resolveClass-conservative
C++: more conservative resolveClass
2018-09-19 11:35:45 +01:00
Jonas Jensen
dca93f58cc Merge pull request #196 from pavgust/fix/param-effective-decl-entry
Parameter.qll: Tweak how effective declaration entries are computed
2018-09-18 09:37:23 +02:00
Jonas Jensen
a7d897108a C++: Exclude non-toplevel items from resolveClass
Also exclude templates as their names are not canonical.

The test changes in `isfromtemplateinstantiation/` are the inverses of
what we got in 34c9892f7, which should be a good thing.
2018-09-17 15:55:34 +02:00
Jonas Jensen
d7f442b042 C++: Force unique resolveClass results 2018-09-17 15:52:38 +02:00