Jonas Jensen
88a251c05a
C++: Delete library-tests/qlcfg/cfg.ql
...
This test was intended to catch regressions in the CFG, but it looks
like it's just catching insignificant extractor changes. The test has
started failing after some recent extractor changes, but I have no way
to pinpoint the failure and understand whether it's a problem or not, so
I think it's better to delete this test.
The remaining tests check whether the QL-based CFG generates the same
graph as the extractor-based CFG. Furthermore, the `successor-tests`
check that the extractor-based CFG works as intended.
2019-01-11 08:24:07 +01:00
Robert Marsh
c455db9e59
C++: update test expectations
2019-01-10 11:24:13 -08:00
Geoffrey White
87569d14b9
CPP: QLDoc comments.
2019-01-10 17:38:42 +00:00
Geoffrey White
ba3bc1596b
CPP: Manual fixup.
2019-01-10 15:28:13 +00:00
Geoffrey White
c4b01d0816
CPP: Autoformat some other untidy source files.
2019-01-10 15:28:13 +00:00
Geoffrey White
28261d6787
Merge pull request #737 from jbj/cfg-perf
...
C++: QL CFG performance and tweaks
2019-01-10 14:45:53 +00:00
Geoffrey White
f2e68da322
CPP: Use dataflow to find wrapped rounding functions.
2019-01-10 14:44:11 +00:00
Geoffrey White
207c4d365a
CPP: Test wrapped rounding functions more thoroughly.
2019-01-10 14:39:23 +00:00
Geoffrey White
4f002291c5
CPP: Add exception for builtins.
2019-01-10 14:16:57 +00:00
Ian Lynagh
e5b6e61d45
C++: Update stats to include namespace_inline
2019-01-10 11:35:49 +00:00
Geoffrey White
346bc1ac62
CPP: Autoformat some code from Critical.
2019-01-10 10:40:39 +00:00
Geoffrey White
b7febb06af
CPP: Autoformat some Power of 10 queries.
2019-01-10 10:40:39 +00:00
Jonas Jensen
92fbea4e41
C++: UsingStrcpyAsBoolean.ql: use getName
...
We agreed in the review of the original PR that `getName` is more
appropriate here than `getQualifiedName`. Using `getName` ensures that
we also match the `std::`-prefixed versions of these functions as well
as user-defined versions.
2019-01-10 08:35:54 +01:00
Jonas Jensen
aa0f2f2da3
C++: Support ?: in UsingStrcpyAsBoolean.ql
...
I removed some unnecessary parentheses for symmetry, causing whitespace
changes.
2019-01-10 08:35:54 +01:00
Jonas Jensen
0f88a4b312
C++: Test ?: support in UsingStrcpyAsBoolean.ql
...
This test shows that the query only supports the ternary operator in
C++, not C.
2019-01-10 08:35:54 +01:00
Jonas Jensen
4dd36772ef
C++: Remove UsingStrcpyAsBoolean.ql duplicates
2019-01-10 08:35:54 +01:00
Jonas Jensen
3a6a515a1d
C++: Tabs to spaces and // Bug comments in test
...
This changes the column numbers in the expected test output.
2019-01-10 08:35:53 +01:00
Jonas Jensen
aafb4abc3d
C++: Use more specific predicates than getChild
...
This commit doesn't change any behavior but just uses the preferred
high-level predicates. The `getChild` predicate inspects the raw
database more or less directly, and the database layout could change in
the future.
2019-01-10 08:35:53 +01:00
Jonas Jensen
657fe0eda3
C++: Tweak docs of UsingStrcpyAsBoolean.ql
...
This should make the documentation more in line with the documentation
for our other queries. The @name of the query is changed to "Use of
string copy function in a condition".
2019-01-10 08:35:53 +01:00
Jonas Jensen
563f8158d7
C++: Autoformat UsingStrcpyAsBoolean.ql
2019-01-10 08:35:53 +01:00
Jonas Jensen
9219214d64
Merge pull request #695 from raulgarciamsft/users/raulga/c6324
...
cpp - Using the return value of a strcpy or related string copy function in an if statement
2019-01-10 08:34:17 +01:00
Geoffrey White
7a877bfe14
CPP: Add exception for wrapped whitelisted functions.
2019-01-09 18:30:19 +00:00
Geoffrey White
f983391cbf
CPP: Add exception for pow.
2019-01-09 15:06:23 +00:00
Geoffrey White
11013b0ec6
CPP: Add a few more test cases.
2019-01-09 14:58:25 +00:00
Ian Lynagh
7a0ed57916
C++: Add namespace_inline
2019-01-09 14:47:27 +00:00
Geoffrey White
82e54568a5
CPP: Add qhelp.
2019-01-09 14:03:28 +00:00
Jonas Jensen
9146b8e32e
C++: Add example of conditional destruction
...
The QL CFG and extractor CFG are the same, so the test passes. Neither
of them model that `ref` may or may not be destructed.
2019-01-09 15:02:25 +01:00
Jonas Jensen
8ac826a62a
C++: Factor out base case of normalGroupMember
...
This recursive predicate is made faster by working around a known
optimizer problem (QL-796) that causes the optimizer to insert extra
type checks in recursive case even when they are only needed in the
base case.
2019-01-09 15:02:25 +01:00
Geoffrey White
cbe69f2daf
CPP: Fix false positive.
2019-01-09 13:59:24 +00:00
Geoffrey White
e26c709dbf
CPP: Add a test for LossyFunctionResultCast.ql.
2019-01-09 13:59:24 +00:00
Geoffrey White
0e092ae88d
CPP: Tag LossyFunctionResultCast.ql. Will be run on LGTM.
2019-01-09 13:59:24 +00:00
Jonas Jensen
c74b89119e
C++: Reorder parameters to subEdge relations
...
This improves performance slightly by putting the parameters in the
order in which they'll be needed in `qlCFGSuccessor`.
2019-01-09 14:58:43 +01:00
ian-semmle
b3bcabf7c6
Merge pull request #724 from jbj/cfg-pr
...
C++: Construct a CFG with QL
2019-01-09 13:12:39 +00:00
Geoffrey White
6088ca5d5b
CPP: Update our uses of MacroInvocationExpr.
2019-01-09 12:17:29 +00:00
Geoffrey White
b59c2868cd
CPP: Add test cases for the macro logic and other details of ArithmeticUncontrolled.ql.
2019-01-09 12:17:29 +00:00
Geoffrey White
a1caa85172
CPP: Deprecate MacroInvocationExpr.
2019-01-09 11:45:08 +00:00
Geoffrey White
75b1fb36ec
CPP: Deprecate MacroInvocationStmt.
2019-01-09 11:45:08 +00:00
Robert Marsh
c39de75d3d
C++: change in-predicate comment formatting
2019-01-08 09:34:29 -08:00
Robert Marsh
af8a3f2522
C++: expand a comment
2019-01-08 09:34:28 -08:00
Robert Marsh
0040a2d123
C++: respond to further PR comments
2019-01-08 09:34:28 -08:00
Robert Marsh
8c9c316e1b
C++: performance and termination fixes
2019-01-08 09:34:27 -08:00
Robert Marsh
567eee1114
C++: allow phi nodes to self-bound
2019-01-08 09:34:27 -08:00
Robert Marsh
b2cd9a29f2
C++: add test for false comparisons
2019-01-08 09:34:26 -08:00
Robert Marsh
2f8ca8802b
C++: switch to using ValueNumbers as bounds
...
This reduces the number of bounds computed, and will simplify use of the
library. The resulting locations in the tests may be slightly strange,
because the example `Instruction` for a `ValueNumber` is the first
appearing in the IR, regardless of source order, and may not be the most
closely related `Instruction` to the bounded value. I think that's worth
doing for the performance and usability benefits.
2019-01-08 09:34:26 -08:00
Robert Marsh
89148a9ec7
C++: respond to further PR comments
2019-01-08 09:34:26 -08:00
Robert Marsh
ae4ffd9166
C++: respond to PR comments, add some TODOs
2019-01-08 09:34:25 -08:00
Robert Marsh
fe32aea31f
C++: fix/add comments
2019-01-08 09:34:25 -08:00
Robert Marsh
ed68f9150a
C++: Initial implementation of new range analysis
2019-01-08 09:34:23 -08:00
Robert Marsh
a06a20dbab
C++: move SimpleRangeAnalysis tests
2019-01-08 09:34:23 -08:00
Jonas Jensen
1be91b5df5
C++: Use IPA for Pos and Spec
...
This is cleaner than extending `int` and working with magic numbers.
Performance appears to be unaffected.
2019-01-08 16:23:11 +01:00