Commit Graph

471 Commits

Author SHA1 Message Date
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
Jonas Jensen
b633ee1bc4 C++: Add more tests of resolveClass
These tests exercise the problematic cases where a variable can appear
to have multiple types because of how we fail to account for qualified
names when comparing type names.
2018-09-17 15:48:02 +02:00
Pavel Avgustinov
2b4da8d6a7 Parameter.qll: Tweak how effective declaration entries are computed
With the new formulation, we can join on function and index at the
same time, leading to significant performance gains on large code
bases that use templates extensively.
2018-09-14 12:22:01 +01:00
Dave Bartolomeo
c9cb2a0d14 Merge pull request #177 from jbj/ir-array-init-perf
C++: IR: Fix performance of value-init ranges
2018-09-14 00:14:45 -07:00
Geoffrey White
1459b981f3 Merge pull request #183 from jbj/unsafe-strcat-perf
C++: Restructure UnsafeUseOfStrcat for performance
2018-09-12 15:16:58 +01:00
Asger F
cc6edd4e23 Merge pull request #182 from felicity-semmle/1.18/js-change-notes
LGTM 1.18: finalize the JavaScript change notes
2018-09-12 14:00:42 +01:00
Jonas Jensen
9fb5fbd995 C++: Restructure UnsafeUseOfStrcat for performance
This query gets optimized badly, and it has started timing out when we
run it on our own code base. Most of the evaluation time is spent in an
RA predicate named `#select#cpe#1#f#antijoin_rhs#1`, which takes 1m36s a
Wireshark snapshot.

This restructuring of the code makes the problematic RA predicate go
away.
2018-09-12 09:37:17 +02:00
Felicity Chapman
4d512a5b01 Remove non-LGTM query (see following PR) 2018-09-11 22:54:37 +01:00
Felicity Chapman
7dd891d908 Further updates and addition of query @ids 2018-09-11 22:51:14 +01:00
Felicity Chapman
223bf6cf56 Updates for consistency 2018-09-11 22:31:32 +01:00
Jonas Jensen
df948ecbbc C++: IR: designated initializer test 2018-09-11 19:43:02 +02:00
semmle-qlci
b17aeb689c Merge pull request #118 from esben-semmle/js/request-forgery
Approved by asger-semmle
2018-09-11 16:28:59 +01:00
Asger F
5fef916683 Merge pull request #171 from asger-semmle/js-for-loop-cfg
JavaScript: fix CFG for EnhancedForStmt
2018-09-11 16:27:47 +01:00
Jonas Jensen
bb49966395 C++: Fixup getEndOfValueInitializedRange 2018-09-11 15:19:18 +02:00
Asger F
0a4a5da1f0 JavaScript: update output of CFG test 2018-09-11 12:15:01 +01:00
Asger F
3d444f3dc6 JavaScript: fix CFG for EnhancedForStmt 2018-09-11 12:15:01 +01:00
Jonas Jensen
b2571c8d63 C++: IR: Fix performance of value-init ranges
On a snapshot of Postgres, evaluation of
`getNextExplicitlyInitializedElementAfter#fff#antijoin_rhs#1` took
forever, preventing the computation of the IR. I haven't been able to
reproduce it with a small test case, but the implementation of
`getNextExplicitlyInitializedElementAfter` was fragile because it called
the inline predicate `ArrayAggregateLiteral.isInitialized`. It also
seemed inefficient that `getNextExplicitlyInitializedElementAfter` was
computed for many values of its parameters that were never needed by the
caller.

This commit replaces `getNextExplicitlyInitializedElementAfter` with a
new predicate named `getEndOfValueInitializedRange`, which should have
the same behavior but a more efficient implementation. It uses a helper
predicate `getNextExplicitlyInitializedElementAfter`, which shares its
name with the now-deleted predicate but has behavior that I think
matches the name.
2018-09-11 11:43:46 +02:00
Tom Hvitved
ec7beab9fa Merge pull request #176 from felicity-semmle/1.18/csharp-change-notes
LGTM 1.18: finalize change notes for C#
2018-09-11 09:57:16 +02:00
Felicity Chapman
f48317f381 Minor updates to prepare for publication 2018-09-11 08:27:20 +01:00
Felicity Chapman
620f99c5a3 Remove template text 2018-09-11 08:14:17 +01:00
Tom Hvitved
621d845722 Merge pull request #11 from calumgrant/cs/standalone-cfg-fixes
C#: Fix CFG for unknown expressions
2018-09-10 16:41:11 +02:00
semmle-qlci
35a83bf0cb Merge pull request #173 from aschackmull/java/mockito-verify2
Approved by yh-semmle
2018-09-10 14:31:43 +01:00
Anders Schack-Mulligen
4473ccdd5e Java: Add Mockito.verify to MockitoMockMethod. 2018-09-10 11:20:27 +02:00
Esben Sparre Andreasen
aaf1ac770d JS: reduce declared precision of js/request-forgery 2018-09-09 21:30:43 +02:00
Jonas Jensen
4051e348eb Merge pull request #169 from felicity-semmle/1.18/cpp-finalize-change-notes
LGTM 1.18: finalize change notes for C/C++
2018-09-09 15:39:40 +02:00
Felicity Chapman
a08177f16b Address initial feebback 2018-09-09 11:52:35 +01:00
calum
ecb3efba34 C#: Fix merge conflicts. 2018-09-07 18:12:28 +01:00
calum
9ec2172dca C#: Fix CFG for unknown expressions, and add a test that also covers object initializer lists fixed by the extractor. 2018-09-07 17:56:44 +01:00
Tom Hvitved
f3eed4aec7 Merge pull request #163 from calumgrant/cs/extractor-fixes
C#: Add tests for extractor fixes, and improve CFG for ConstCases
2018-09-07 17:37:40 +02:00
Felicity Chapman
3eab1de2f5 Remove non-LGTM queries from notes (will move to 'studio-cpp.md') 2018-09-07 13:56:55 +01:00
Felicity Chapman
2e0818d8e6 Text changes for consistency and clarity 2018-09-07 13:55:24 +01:00
Felicity Chapman
e7116f57a0 Add query identifiers 2018-09-07 13:24:41 +01:00
Felicity Chapman
6aa6b64b81 Remove placeholders and sort table 2018-09-07 12:05:40 +01:00
calum
58cf95b155 C#: Rewrite not using if. 2018-09-07 11:37:05 +01:00
calum
0cd4340ac3 C#: Address review comment: refactor last() predicate for ConstCase and TypeCase. 2018-09-07 10:15:16 +01:00
calum
d5eacf8c13 C#: Change expected output. Address review comments. 2018-09-06 18:20:01 +01:00
semmle-qlci
10329fa188 Merge pull request #134 from jbj/getOperandMemoryAccess-this
Approved by dave-bartolomeo
2018-09-06 09:18:57 +01:00
semmle-qlci
62e9946fe2 Merge pull request #150 from asger-semmle/ts-asi-bug
Approved by xiemaisi
2018-09-05 21:22:29 +01:00
calum
3718237acc C#: Implement CFG for ConstCase statements with a condition. 2018-09-05 18:15:47 +01:00
calum
c2f3cb6a2a C#: Update analysis change notes. 2018-09-05 17:48:45 +01:00