Commit Graph

12782 Commits

Author SHA1 Message Date
Jonas Jensen
fb4dac597c C++: Minimal caching of the IR type system
This was the minimal amount of predicates I could easily cache without
introducing extra cached stages. The predicates that are not cached
here, like `CppType::getTypeSize` and `getCanonicalLanguageType`, appear
to be cheap.

I've tested that this avoids recomputation of the IR type system by
running

    grep -c 'Starting to evaluate predicate CppType::CppType::getIRType_dispred'

on the evaluator log for `IRSanity.ql`. It drops from 4 to 1. The
pretty-printed DIL drops from 79,175 lines to 76,326 lines.
2019-11-03 16:40:30 +01:00
Ziemowit Laski
2bad9394b7 [CPP-434] Squelch alerts for expressions inside macros; try to make Qhelp Jenkins-friendly. 2019-11-01 15:24:22 -07:00
Geoffrey White
c2812197a9 CPP: Further speedup. 2019-11-01 18:16:12 +00:00
Jonas Jensen
426565ae68 Merge pull request #2239 from DX-MON/master
Query cpp/unused-static-variable was producing incorrect results for constexpr variables
2019-11-01 18:59:52 +01:00
Geoffrey White
08293d0009 CPP: Simplify. 2019-11-01 17:58:29 +00:00
Geoffrey White
98b9afd83f CPP: Remove apparently irrelevant parts of the query.
This is not strictly behaviour preserving, but I believe the parts I've removed or simplified weren't intended to do what they were doing.
2019-11-01 17:54:13 +00:00
Geoffrey White
c08493670b CPP: Speed up ExistsAnyFlowConfig. 2019-11-01 17:40:44 +00:00
Geoffrey White
6a865ed580 CPP: De-duplicate TlsSettingsMisconfiguration.ql. 2019-11-01 17:40:41 +00:00
Geoffrey White
fa203254ce CPP: Add test cases. 2019-11-01 17:40:27 +00:00
Ziemowit Laski
3e1fd4a737 [CPP-434] Add table of constructs to Qhelp. Rewrite examples section. 2019-10-31 18:03:34 -07:00
Dave Bartolomeo
ea23c2daac Merge pull request #2188 from jbj/printast-override
C++: Add a sample class in PrintAST.ql
2019-10-31 17:02:20 -07:00
Dave Bartolomeo
e6f632b44e Merge pull request #2228 from jbj/DefaultTaintTracking-getASTVariable
C++: Use getASTVariable in DefaultTaintTracking
2019-10-31 17:00:49 -07:00
Rachel Mant
413f49bba5 Query cpp/unused-static-variable was producing incorrect results for constexpr variables 2019-10-31 22:50:44 +00:00
Robert Marsh
31f25c8cfc C++: primary instrs for constructor side effects 2019-10-31 11:43:47 -07:00
Robert Marsh
86b5e97f76 Merge branch 'master' of github.com:Semmle/ql into rdmarsh/cpp/ir-constructor-side-effects 2019-10-31 11:34:22 -07:00
Robert Marsh
9477bd5698 Merge branch 'master' of github.com:Semmle/ql into rdmarsh/cpp/ir-buffer-read-call-se 2019-10-31 11:00:01 -07:00
Robert Marsh
24c9b8b9b1 C++: fix unbound variables 2019-10-30 14:06:19 -07:00
Geoffrey White
ee3b49af3a Merge pull request #2219 from jbj/rangeanalysis-best-bound
C++: Restrict the output of IR Range Analysis to the best bounds
2019-10-30 17:18:59 +00:00
alistair
27d0b51c6b CPP & C#: Review of qhelp
PR #2151 got merged without a review of the qhelp
by a technical writer.
The current PR makes changes I would have suggested on that PR.
2019-10-30 16:10:03 +00:00
Jonas Jensen
1e6c983d62 C++: Use getASTVariable in DefaultTaintTracking
This library is not yet used in a query or test, so it broke silently
when `VariableAddressInstruction.getVariable` was removed.
2019-10-30 13:42:17 +01:00
Luke Cartey
d9d4aa30a9 Merge pull request #2214 from hmakholm/pr/upgrade-packs
Make each upgrade directory a QL pack
2019-10-29 16:45:02 +00:00
alexet
924d23f657 Cache the computation of core toString predicates. 2019-10-29 14:48:27 +00:00
Jonas Jensen
b6038f3caa C++: Remove best-bound logic from test
This logic, in an improved form, is now part of the library itself.
2019-10-29 11:54:32 +01:00
Jonas Jensen
311963906b C++: Only give the best delta in range analysis
This mirrors Java's 6b85fe087a.
2019-10-29 11:49:49 +01:00
Jonas Jensen
ff62afb575 C++: Rename parameter to b to match QLDoc 2019-10-29 10:38:23 +01:00
Jonas Jensen
0b2c2620cd Merge pull request #2184 from dave-bartolomeo/dave/AliasedUse
C++/C#: Add `AliasedUse` instruction to all functions
2019-10-29 08:37:57 +01:00
Robert Marsh
8076156cb1 Merge branch 'master' into rdmarsh/cpp/ir-callee-side-effects 2019-10-28 16:50:34 -07:00
Robert Marsh
120fa6c330 C++: alias fixes for ReturnIndirection 2019-10-28 15:09:35 -07:00
Robert Marsh
5e946cc9f3 C++: add param read side effects to IR exit blocks 2019-10-28 15:09:04 -07:00
Geoffrey White
3584c0b2e5 CPP: Speed up InitializationFunctions.qll's getTarget. 2019-10-28 19:54:10 +00:00
Geoffrey White
2d64fedeb0 CPP: Speed up VirtualDispatch.qll's getAViableTarget. 2019-10-28 19:54:10 +00:00
Geoffrey White
c40c88ec4b CPP: Add test cases for ConditionallyUninitializedVariables.ql. 2019-10-28 18:43:00 +00:00
Geoffrey White
d693eb8c20 CPP: Correct the ConditionallyUninitializedVariable examples. 2019-10-28 17:39:45 +00:00
Henning Makholm
ae554cf1e9 Make each upgrade directory a QL pack 2019-10-28 17:14:31 +01:00
Anders Schack-Mulligen
d0842fc35d Java/C++/C#: Minor refactor following review comment. 2019-10-28 16:31:22 +01:00
Jonas Jensen
b13535ac7d C++: Implement DataFlow::BarrierGuard for AST+IR
The change note is copied from the Java change note.
2019-10-28 16:22:23 +01:00
Anders Schack-Mulligen
379ef1d2f9 Java: Fix bad magic and join-order. 2019-10-28 10:40:06 +01:00
Ziemowit Laski
1500148c76 [CPP-434] Clarify Qhelp. 2019-10-27 11:23:54 -07:00
Ziemowit Laski
6ee3d7d788 [CPP-434] Address more comments re .cpp test cases. 2019-10-25 15:50:00 -07:00
Ziemowit Laski
7204e13746 [CPP-434] Address comments re .cpp test cases. 2019-10-25 14:37:28 -07:00
Dave Bartolomeo
cc5a689293 C++/C#: Fix up after merge from master 2019-10-25 14:11:34 -07:00
Ziemowit Laski
f964fe8b0e [CPP-434] Address comments regarding .ql and .qhelp. 2019-10-25 14:08:30 -07:00
Dave Bartolomeo
f5e320e988 Merge from master 2019-10-25 13:24:19 -07:00
Dave Bartolomeo
56cbd0c152 C++/C#: Make AliasedUse access only non-local memory
The `AliasedUse` instruction is supposed to represent future uses of aliased memory after the function returns. Since local variables from that function are no longer allocated after the function returns, the `AliasedUse` instruction should access only the set of aliased locations that does not include locals from the current stack frame.
2019-10-25 13:10:39 -07:00
Jonas Jensen
d63cc3d287 Merge remote-tracking branch 'upstream/master' into infinite-loops-visible
Moved the change note to 1.23.
2019-10-25 15:44:03 +02:00
Jonas Jensen
22de0efc58 Merge pull request #2008 from dave-bartolomeo/dave/IRType2
C++: Implement language-neutral IR type system
2019-10-25 09:42:23 +02:00
Dave Bartolomeo
80e29dce8b C++: Fix comment and remove unnecessary max() 2019-10-24 14:15:59 -07:00
Dave Bartolomeo
1223388ab6 C++: Fix test expectations 2019-10-24 13:54:21 -07:00
Dave Bartolomeo
956c18f976 C++/C#: Fix formatting 2019-10-24 13:54:09 -07:00
Ziemowit Łąski
01035f15cf Merge pull request #2123 from geoffw0/comparison2
CPP: Reword ComparisonPrecedence.ql query message.
2019-10-24 12:05:59 -07:00