Jonas Jensen
2324ce77ae
C++ IR: Fix soundness of ConstantAnalysis
...
Now that `PhiInstruction.getAnInput` only has results for congruent
operands, a previous optimization I made to `getConstantValue` is no
longer sound. We have to check that all phi inputs give the same value,
not just the congruent ones. After this change, if there are any
non-congruent operands on a phi instruction, the whole aggregate will
have no result.
2019-07-11 15:51:09 +02:00
Jonas Jensen
7fb43a5a03
C++ IR: getAnyDef -> getDef in RangeUtils.qll
...
As recommended by Dave in PR review.
2019-07-11 15:35:14 +02:00
Jonas Jensen
c831c4b58e
C++ IR: Fix SignAnalysis after getAnyDef -> getDef
...
In the `SignAnalysis` abstract interpretation, "unknown sign"
corresponds to the set of _all_ `Sign`, but using `getDef` leads to the
operand having _no_ `Sign`. To fix that, we assign all signs to inexact
operands.
2019-07-11 15:17:55 +02:00
Jonas Jensen
52cfbffb95
C++ IR: Fix calls to non-existent predicates
...
The last commit introduced calls to two predicates that did not exist. I
created `Instruction.getResultAddress` so it now exists and changed the
other call back to use the predicate that does exist.
2019-07-10 15:18:17 +02:00
Jonas Jensen
6d87c05155
Apply suggestions from code review
...
Co-Authored-By: Dave Bartolomeo <42150477+dave-bartolomeo@users.noreply.github.com>
2019-07-10 15:07:44 +02:00
Jonas Jensen
2111bf5387
C++ IR: getAnyDef -> getDef in RangeAnalysis
2019-07-03 11:05:06 +02:00
Jonas Jensen
c62f73e2a2
C++ IR: getAnyDef -> getDef in SignAnalysis
...
For signs that follow from guards, we want the guard and the guarded
access to overlap exactly.
2019-07-03 11:05:06 +02:00
Jonas Jensen
a16ed7d613
C++ IR: getAnyDef -> getDef in ValueNumbering
...
This change seems more in line with what users would expect.
2019-07-03 11:05:06 +02:00
Jonas Jensen
2ce8612a05
C++ IR: allow inexact defs in taint tracking
2019-07-03 11:05:06 +02:00
Jonas Jensen
984405be2e
C++ IR: Change many uses of getAnyDef to getDef
...
This changes all the getters on `Instruction` to use `getDef` instead of
`getAnyDef`, with the result that these getters now only have a result
if the definition is exact.
This is a backwards-INCOMPATIBLE change.
2019-07-03 11:04:57 +02:00
Jonas Jensen
e082451352
C++ IR: add getDef and deprecated predicates
...
These are the hand-written changes that complete the automatic changes
from the previous commit.
- Add deprecated compatibility wrappers for the renamed predicates.
- Add a new `Operand.getDef` predicate.
- Clarify the QLDoc for all these predicates.
2019-07-03 10:06:48 +02:00
Jonas Jensen
206a96df94
C++ IR: Rename getters for def/use on Operand
...
This renames `getDefinitionInstruction` to `getAnyDef`, reflecting that
it includes definitions without exact overlap. It renames
`getUseInstruction` to `getUse` for consistency.
perl -p -i -e 's/\bgetUseInstruction\b/getUse/g; s/\bgetDefinitionInstruction\b/getAnyDef/g' \
cpp/ql/src/semmle/code/cpp/ir/**/*.ql* \
cpp/ql/test/**/*.ql* \
cpp/ql/src/semmle/code/cpp/rangeanalysis/**/*.ql*
2019-07-03 10:06:48 +02:00
semmle-qlci
71c86fa69b
Merge pull request #1527 from esben-semmle/js/classify-more-generated-and-tests
...
Approved by asger-semmle
2019-07-02 07:38:10 +01:00
semmle-qlci
26fd1b91cf
Merge pull request #1485 from esben-semmle/js/fix-yaml-strings
...
Approved by xiemaisi
2019-07-02 07:00:43 +01:00
semmle-qlci
b0b152aaaa
Merge pull request #1529 from xiemaisi/js/getter-summaries
...
Approved by asger-semmle
2019-07-02 06:16:34 +01:00
Max Schaefer
7f95c20345
JavaScript: Add support for tracking flow into receivers of reflective calls.
2019-07-01 17:54:43 +01:00
semmle-qlci
3b126d9c4e
Merge pull request #1488 from asger-semmle/call-graph-metric
...
Approved by xiemaisi
2019-07-01 16:09:34 +01:00
Max Schaefer
a04c2c65cb
JavaScript: Add change note.
2019-07-01 15:45:57 +01:00
Max Schaefer
895055f30e
JavaScript: Avoid unhelpful magic.
...
The constraint `exists(callback.getParameter(i))` was getting pushed into `higherOrderCall`, which isn't a bad thing to do. However, this then led to a join on `i`, which is a very bad thing to do.
2019-07-01 15:45:57 +01:00
Max Schaefer
b5b89c0eac
JavaScript: Track flow into method receivers.
2019-07-01 15:45:57 +01:00
Esben Sparre Andreasen
062778bdd8
JS: heuristically recognize x.spec.y and x.test.y as test files
2019-07-01 15:49:17 +02:00
Esben Sparre Andreasen
7cab308205
fixup! JS: classify numeric file names as generated
2019-07-01 15:49:03 +02:00
Jonas Jensen
757ec97e7a
Merge pull request #1251 from zlaski-semmle/zlaski/cpp370
...
[CPP-370] Non-constant `format` arguments to `printf` and friends
2019-07-01 14:43:19 +02:00
Asger F
ff4d6ece80
JS: Rename metrics to ResolvableCallX
2019-07-01 12:34:48 +01:00
Asger F
16e6dd12d0
JS: Address review comments part 1
2019-07-01 12:30:51 +01:00
semmle-qlci
a4fa2982de
Merge pull request #1526 from xiemaisi/js/remove-TrackedExpr
...
Approved by esben-semmle
2019-07-01 11:10:44 +01:00
semmle-qlci
4f3cbe0029
Merge pull request #1521 from hvitved/csharp/constant-condition-fp
...
Approved by calumgrant
2019-07-01 10:52:14 +01:00
Esben Sparre Andreasen
2eb7e4a818
JS: classify `x.test.js` files with `test(...)` calls as jest tests
2019-07-01 10:28:10 +02:00
Esben Sparre Andreasen
5ebcef41fa
JS: classify numeric file names as generated
2019-07-01 10:25:38 +02:00
Tom Hvitved
e6e606232d
C#: Address review comments
2019-07-01 09:37:15 +02:00
semmle-qlci
ae3a48db58
Merge pull request #1510 from hvitved/csharp/date-queries-remove-precision
...
Approved by calumgrant
2019-07-01 08:28:08 +01:00
zlaski-semmle
bc98a80efe
Merge pull request #1 from jbj/NonConstantFormat-ArrayExpr
...
C++: NonConstantFormat taint only for string types
2019-06-28 12:03:31 -07:00
yh-semmle
a0dc84010a
Merge pull request #1518 from Semmle/rc/1.21
...
Merge rc/1.21 into master
2019-06-28 13:52:18 -04:00
Arthur Baars
af68fd4904
Merge pull request #1408 from calumgrant/cs/suppress-null-expr
...
C#: C#8 Nullable expressions and type annotations
2019-06-28 19:21:46 +02:00
yh-semmle
01028812a9
Merge pull request #1524 from aschackmull/java/dead-lambda
...
Java: Don't report lambdas (or other anonymous classes) as dead.
2019-06-28 10:48:17 -04:00
Taus
61a196d2d4
Merge pull request #1523 from markshannon/python-speed-up-get-a-child
...
Python speed up calculation of ControlFlowNode.getAChild()
2019-06-28 15:23:08 +02:00
Calum Grant
8130342062
Merge pull request #1520 from hvitved/csharp/mono-tracing
...
C#: Generalize `mono` pattern in tracer config
2019-06-28 14:21:35 +01:00
Calum Grant
4d383001ac
C#: Address review comment
2019-06-28 14:17:16 +01:00
Calum Grant
a5543699b2
Merge pull request #1460 from hvitved/csharp/cfg-last
...
C#: Refactor `last` predicate
2019-06-28 14:13:43 +01:00
Taus
fbe7615258
Merge pull request #1512 from markshannon/python-better-handling-decorators
...
Python: Add opaque 'decorated object' object.
2019-06-28 14:10:49 +02:00
Mark Shannon
8570b4117f
Python: Add opaque 'decorated function' for complex decorated functions. Allows finding calls in taint-tracking without contaminating points-to results.
2019-06-28 12:14:10 +01:00
Tom Hvitved
3d4316da1c
C#: Address review comments
2019-06-28 13:00:18 +02:00
Anders Schack-Mulligen
a93ecae1ae
Java: Don't report lambdas (or other anon classes) as dead.
2019-06-28 12:59:54 +02:00
Taus
8251553771
Merge pull request #1494 from markshannon/python-better-handling-calls-on-edge-of-context
...
Python: better handling calls on edge of context
2019-06-28 12:39:09 +02:00
Mark Shannon
775214e467
Python speed up calculation of ControlFlowNode.getAChild()
2019-06-28 11:19:25 +01:00
Tom Hvitved
db565c5a88
C#: Remove false positives in `cs/constant-condition`
2019-06-28 11:50:53 +02:00
Taus
1b98f248e5
Merge branch 'master' into python-better-handling-calls-on-edge-of-context
2019-06-28 11:27:42 +02:00
Max Schaefer
3c3422e221
JavaScript: Refactor unpromoted-candidate queries to no longer rely on tracked nodes.
2019-06-28 10:25:23 +01:00
Tom Hvitved
4da7a17f4b
C#: Add more tests for `cs/constant-condition`
2019-06-28 11:25:18 +02:00
Taus
fad37bd6c9
Merge pull request #1487 from markshannon/python-tuple-assignment-points-to
...
Python ESSA dataflow: better handling of tuple unpacking.
2019-06-28 11:05:03 +02:00