Tamas Vajk
b66a3141f6
Extract functions using their name from JvmName annotation
2022-05-10 19:51:30 +01:00
Ian Lynagh
b35b74779a
Revert "Fix CFG construction of ExprStmt and StmtExpr"
...
This reverts commit db8d718cdbf0bef9cdf246221a921b99d4b22bea.
It broke ql/java/ql/test/library-tests/successors/TestDeclarations
2022-05-10 19:51:28 +01:00
Ian Lynagh
d2f6871868
Revert "Fix ExprStmt and StmtExpr in Boolean context"
...
This reverts commit 8a42837578e1c4361ed25682312ea5497ad0a12e.
2022-05-10 19:51:28 +01:00
Tamas Vajk
037d66de15
Fix ExprStmt and StmtExpr in Boolean context
2022-05-10 19:51:28 +01:00
Tamas Vajk
8282e57db5
Fix CFG construction of ExprStmt and StmtExpr
2022-05-10 19:51:28 +01:00
Tamas Vajk
47799ae040
Code quality improvements + add dedicated DeadRefTypes test
2022-05-10 19:51:28 +01:00
Tamas Vajk
cdc7ed0e14
Extract container of adapter function as compiler generated
2022-05-10 19:51:28 +01:00
Tamas Vajk
22af7f0e89
Remove duplications of locatable and element in the DB scheme
2022-05-10 19:51:27 +01:00
Ian Lynagh
ff35088b49
Java: Add an upgrade script
2022-05-10 19:51:27 +01:00
Ian Lynagh
843310c466
Kotlin: Remove incorrect upgrade
2022-05-10 19:51:27 +01:00
Tamas Vajk
a1842f9f17
Remove ExtensionMethodAccess and revert all dataflow changes
2022-05-10 19:51:27 +01:00
Tamas Vajk
95cb0149a3
Fix data flow through ExtensionMethodAccess
2022-05-10 19:51:27 +01:00
Tamas Vajk
38ab7acf3e
Revert "Remove ExtensionMethodAccess to see extension method flows"
...
This reverts commit 9df4f2074379ba4668054a2a66eaaaaf5cb9b6c8.
2022-05-10 19:51:27 +01:00
Tamas Vajk
a9711b8c88
Remove ExtensionMethodAccess to see extension method flows
2022-05-10 19:51:27 +01:00
Ian Lynagh
fac3699a5b
Kotlin: Generate stats
2022-05-10 19:51:27 +01:00
Ian Lynagh
19270369c8
Java: Add an upgrade script
2022-05-10 19:51:27 +01:00
Tamás Vajk
48b6c61fdb
Quality improvement: add explicit this in QL
...
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com >
2022-05-10 19:51:26 +01:00
Tamas Vajk
e0afaa462e
Fix Parameter.getACallArgument for parameters of extension methods
2022-05-10 19:51:26 +01:00
Tamas Vajk
c89f3163f9
Revert PrintAst changes related to wrong locations
2022-05-10 19:51:26 +01:00
Ian Lynagh
77fec17a36
Kotlin: Autoformat QL
2022-05-10 19:51:25 +01:00
Tony Torralba
3920b64d62
Add support for live literals
2022-05-10 19:51:25 +01:00
Ian Lynagh
f138ba5246
C#/Kotlin: Sync SignAnalysisCommon.qll
2022-05-10 19:51:24 +01:00
Tamas Vajk
b26044b327
Change extension receiver this access to be a parameter access
2022-05-10 19:51:23 +01:00
Tony Torralba
4eb1e3a47b
Update ExtensionMethodAccess QLDoc
2022-05-10 19:51:23 +01:00
Tony Torralba
fcb334180d
Create ExtensionMethodAccess class
2022-05-10 19:51:23 +01:00
Tamas Vajk
a6f036d94e
Extract property references with only backing field
2022-05-10 19:51:23 +01:00
Tony Torralba
a6326b69dc
Update java/ql/lib/config/semmlecode.dbscheme
...
Apply suggestion by @igfoo
Co-authored-by: Ian Lynagh <igfoo@github.com >
2022-05-10 19:51:22 +01:00
Tony Torralba
64531dd717
Fix AST representation of WhenExpr and WhenBranch
2022-05-10 19:51:22 +01:00
Tony Torralba
4b22e1a378
Extract WhenBranch as Stmt
2022-05-10 19:51:22 +01:00
Tony Torralba
10ab11cdf7
Handle WhenBranch CFG properly
2022-05-10 19:51:22 +01:00
Tony Torralba
9735423c79
Fix WhenExpr flow
2022-05-10 19:51:22 +01:00
Tamas Vajk
d4701d72d9
Add DelegatedProperty QL class and use it in tests
2022-05-10 19:51:22 +01:00
Tamas Vajk
0ba2daf31a
Adjust extraction to reuse KtProperty* relations
2022-05-10 19:51:22 +01:00
Tamas Vajk
f8343b8cc7
Extract local delegated properties
2022-05-10 19:51:22 +01:00
Tony Torralba
2da98148dc
Add NotNullExpr flow
2022-05-10 19:51:20 +01:00
Chris Smowton
dc64b536b3
Ensure that initializers are only printed once in a PrintAst run
...
Otherwise the output becomes a DAG not a tree. Java achieves the same by omitting all PrintAst of `<obinit>` routines.
2022-05-10 19:51:20 +01:00
Chris Smowton
13cd145a76
Retain Member.getInitializer for Kotlin programs
...
I opt to identify any syntactic initializer. These are broader in scope than Java's member initializers, which are necessarily context-free, whereas in Kotlin the primary constructor's parameters can be referred to.
2022-05-10 19:51:20 +01:00
Tamas Vajk
18812c810c
Add PropertyRefExpr QL class, change extraction to use it, and add tests
2022-05-10 19:51:19 +01:00
Chris Smowton
5fe65ed983
Extract no-when-branch-found calls
...
These are extracted as "throw new kotlin.NoWhenBranchFoundException();", which is the Java lowering of the intrinsic.
In the process, amend the control-flow graph to let when branches propagate `throw`s outwards, and similarly statement expressions.
2022-05-10 19:51:19 +01:00
Ian Lynagh
6c19409804
Java/Kotlin: Add Diagnostics.qll
2022-05-10 19:51:18 +01:00
Ian Lynagh
0e689a9d35
Kotlin: Avoid name clash
2022-05-10 19:51:18 +01:00
Tony Torralba
c4c254587e
Add StmtExpr flow
2022-05-10 19:51:18 +01:00
Chris Smowton
96f3ea460f
Make varargs extraction more Java-like:
...
* Extract varargs as if they are ordinary positional arguments
* Adapt the QL that distinguishes varargs from ordinary arguments to account for Kotlin's varargs which can occur in the middle of the arg list
* Add a test checking dataflow through varargs which doesn't work yet due to array-get and array-set not being extracted as IndexExprs
* Extract the special case arrayOf(*x) as a clone call, which is (equivalent to) the Java lowering of that operation
2022-05-10 19:51:17 +01:00
Chris Smowton
7dec3f4835
Use EqualityTest for either value or ref comparions, and ReferenceEqualityTest for strictly ref comparison.
2022-05-10 19:51:17 +01:00
Chris Smowton
f95effcf82
Always extract ValueEQ/NEExpr for Kotlin ==/!=
...
I introduce AnyEqualsExpr for either reference or value equality and AnyEqualityTest for the same concept including not-equals operators, and use them wherever the written QL clearly doesn't care about the difference between reference and value comparison, typically because it is concerned with testing against null or against a primitive constant.
2022-05-10 19:51:17 +01:00
Chris Smowton
a120fab9f7
Complete implementation of equality tests
...
- Create a new operator representing an infix value [in]equality test, equivalent to Objects.equals(lhs, rhs)
- Continue to use simple equality where it is clearly possible at the callsite
- Note that ieee754equals is the same as Java's == and != operators
2022-05-10 19:51:17 +01:00
Tony Torralba
6bd6097ed1
Add taint step for StringTemplateExpr
2022-05-10 19:51:16 +01:00
Tamas Vajk
d495badc1e
Rename companion object QL class
2022-05-10 19:51:16 +01:00
Tamas Vajk
b4beddf2f9
Introduce cast for <unsafe-coerce> calls
2022-05-10 19:51:15 +01:00
Ian Lynagh
8d754f5129
Kotlin: Fix bug in, and performance of, NullGuards::clearlyNotNullExpr
2022-05-10 19:51:15 +01:00