Commit Graph

3597 Commits

Author SHA1 Message Date
Mathias Vorreiter Pedersen
cfb839a8f9 C++: Add test demonstrating the false positive 2020-01-02 15:48:01 +01:00
Jonas Jensen
4830e43b3e C++: Fix overlappingVariableMemoryLocations perf
The `overlappingVariableMemoryLocations` predicate was a helper
predicate introduced to fix a join-order issue in
`overlappingIRVariableMemoryLocations`. Unfortunately it caused a
performance issue of its own because it could grow too large. On the
small project (38MB zip) awslabs/s2n there were 181M rows in
`overlappingVariableMemoryLocations`, and it took 134s to evaluate.

The fix is to collapse the two predicates into one and fix join ordering
by including an extra column in the predicates being joined.

In addition, some parameters were reordered to avoid the overhead of
auto-generated `join_rhs` predicates.

Tuple counts of `overlappingVariableMemoryLocations` before:

    623285    ~176%     {2} r1 = JOIN AliasedSSA::isCoveredOffset#fff_120#join_rhs AS L WITH AliasedSSA::isCoveredOffset#fff_120#join_rhs AS R ON FIRST 2 OUTPUT L.<2>, R.<2>
    119138    ~3%       {2} r2 = SCAN AliasedSSA::VariableMemoryLocation::getVirtualVariable_dispred#ff AS I OUTPUT I.<1>, I.<0>
    172192346 ~0%       {2} r3 = JOIN r2 WITH AliasedSSA::hasUnknownOffset#ff_10#join_rhs AS R ON FIRST 1 OUTPUT R.<1>, r2.<1>
    172815631 ~0%       {2} r4 = r1 \/ r3
    172192346 ~0%       {2} r5 = JOIN r2 WITH AliasedSSA::hasUnknownOffset#ff_10#join_rhs AS R ON FIRST 1 OUTPUT r2.<1>, R.<1>
    345007977 ~87%      {2} r6 = r4 \/ r5
                        return r6

Tuple counts of `overlappingIRVariableMemoryLocations` after:

    117021 ~134%     {2} r1 = JOIN AliasedSSA::isCoveredOffset#ffff AS L WITH AliasedSSA::isCoveredOffset#ffff AS R ON FIRST 3 OUTPUT L.<3>, R.<3>
    201486 ~1%       {2} r2 = JOIN AliasedSSA::hasUnknownOffset#fff AS L WITH AliasedSSA::hasVariableAndVirtualVariable#fff AS R ON FIRST 2 OUTPUT L.<2>, R.<2>
    318507 ~26%      {2} r3 = r1 \/ r2
    201486 ~3%       {2} r4 = JOIN AliasedSSA::hasUnknownOffset#fff AS L WITH AliasedSSA::hasVariableAndVirtualVariable#fff AS R ON FIRST 2 OUTPUT R.<2>, L.<2>
    519993 ~92%      {2} r5 = r3 \/ r4
                     return r5
2019-12-27 16:06:24 +01:00
Jonas Jensen
618bf2e29e C++: IR data flow through total chi operands 2019-12-27 11:44:41 +01:00
Jonas Jensen
64c79bf9e1 C++: Deprecate UninitializedNode in IR data flow
It's not used outside of tests, and it's not useful. It will break the
tests when we start allowing flow through chi nodes.
2019-12-27 11:21:33 +01:00
Mathias Vorreiter Pedersen
c9fe3e4d2d C++: Updated upgrade script 2019-12-23 14:13:12 +01:00
Mathias Vorreiter Pedersen
bb282f403e Fix comments
Co-Authored-By: Jonas Jensen <jbj@github.com>
2019-12-23 12:37:18 +01:00
Mathias Vorreiter Pedersen
11a545e08e C++: Removed abstract classes from binary and assignment operations 2019-12-23 11:52:12 +01:00
Mathias Vorreiter Pedersen
6998336fb9 C++: Format .dbscheme file 2019-12-23 10:57:38 +01:00
Mathias Vorreiter Pedersen
46421efcef C++: Rename crement operations 2019-12-23 10:41:14 +01:00
Mathias Vorreiter Pedersen
1b29e6c082 Remove @prefix_crement_oper_expr and @postfix_crement_oper_expr clauses
Co-Authored-By: Jonas Jensen <jbj@github.com>
2019-12-23 10:28:35 +01:00
Jonas Jensen
7e84453ec9 Merge pull request #2542 from geoffw0/datetime
C++: Sort through the leap year and japanese era queries
2019-12-23 10:13:12 +01:00
Dave Bartolomeo
5b5d2f2b67 Merge pull request #2154 from rdmarsh2/rdmarsh/cpp/ir-callee-side-effects
C++: add InitializeIndirection for pointer params
2019-12-20 13:13:54 -07:00
Mathias Vorreiter Pedersen
cb22702908 C++: Added update script 2019-12-20 18:38:14 +01:00
Mathias Vorreiter Pedersen
006c8bb0cd C++: Remove abstract classes from unary operations 2019-12-20 18:38:09 +01:00
yo-h
cc7f98e0f6 Merge pull request #2555 from hvitved/csharp/xml-sync
C#: Sync `XML.qll` with other languages
2019-12-20 09:03:55 -05:00
Jonas Jensen
de55a6846f Merge pull request #2204 from alexet/cache-to-string
Cache the computation of core toString predicates for cpp c# and java.
2019-12-20 14:54:46 +01:00
Jonas Jensen
939979ddef Merge branch 'master' into overflowcalc 2019-12-19 14:12:00 +01:00
Jonas Jensen
a13748f484 Merge pull request #2259 from rdmarsh2/rdmarsh/cpp/default-taint-tracking-sources
C++: move sources into DefaultTaintTracking.qll
2019-12-19 14:09:41 +01:00
Jonas Jensen
4fffaabab9 Merge pull request #2551 from MathiasVP/argument-suppresion-c89-style
C++: Alert suppression through single-line /* */ style comments
2019-12-19 13:19:49 +01:00
Tom Hvitved
29cd6a9e30 Sync XML.qll 2019-12-19 10:29:30 +01:00
Mathias Vorreiter Pedersen
30822f1d98 C++: Alert suppresion through single-line /* */ style comments 2019-12-19 09:10:09 +01:00
Robert Marsh
33067c8e31 Merge pull request #2519 from jbj/ir-backedge-notc
C++: Get rid of a fastTC and noopt in IR
2019-12-18 14:20:43 -08:00
Jonas Jensen
e7283afa3e Merge pull request #2531 from dbartol/dbartol/MissingToString
C++: Fix `toString()` predicates that don't hold
2019-12-18 19:09:48 +01:00
Jonas Jensen
367827a2ef Merge pull request #2541 from max-schaefer/unify-xml-qlls
C++/Java/JavaScript/Python: Unify XML libraries.
2019-12-18 10:35:34 +01:00
Jonas Jensen
66d49a4a8a Merge pull request #2546 from MathiasVP/arguments-source-qltest
C++: Added test for 333d0a69
2019-12-18 09:11:11 +01:00
Robert Marsh
e209ed961a Merge branch 'master' into rdmarsh/cpp/ir-callee-side-effects 2019-12-17 15:11:02 -08:00
Robert Marsh
93ace5be35 C++: remove Chi node flow in DefaultTaintTracking 2019-12-17 14:23:11 -08:00
Dave Bartolomeo
240823019a Merge remote-tracking branch 'upstream/master' into dbartol/MissingToString 2019-12-17 11:50:36 -07:00
Geoffrey White
ab0be19cc5 C++: Autoformat. 2019-12-17 17:51:55 +00:00
Robert Marsh
7468facb34 C++: autoformat more 2019-12-17 09:06:52 -08:00
Geoffrey White
eaf00c6683 C++: Fix override related warning. 2019-12-17 15:39:29 +00:00
Geoffrey White
9986206dc6 C++: Placement new does not necessarily require a delete. 2019-12-17 15:28:21 +00:00
Mathias Vorreiter Pedersen
1d3ee71f73 C++: Added test for 333d0a69 2019-12-17 13:54:41 +01:00
Geoffrey White
520ff39349 C++: Update MemoryMayNotBeFreed.ql similarly. 2019-12-17 11:56:23 +00:00
Geoffrey White
9a944a947a C++: Update MemoryNeverFreed.ql to exclude alloca (and use the new allocation model directly). 2019-12-17 11:10:03 +00:00
Geoffrey White
a8c31c6590 C++: Add AllocationFunction/AllocationExpr.requiresDealloc(). 2019-12-17 11:07:08 +00:00
Anders Schack-Mulligen
ca08097b56 Java/C++/C#: Fix Java Content.getType and getContainerType to match C# and fix C# tests. 2019-12-17 11:51:58 +01:00
Geoffrey White
b2e2db1e5c CPP: Autoformat. 2019-12-17 10:39:52 +00:00
Max Schaefer
a17b615ae5 C++/Python: Deprecate XMLFile.getPath and XMLFile.getFolder.
Both can be expressed using predicates inherited from `File`.
2019-12-17 10:15:43 +00:00
Max Schaefer
47c1fc7358 C++/Python: Fix XMLFile.getPath and XMLFile.getFolder.
Previously, the former returned the file's stem (that is, basename without extension), and the latter never held.
2019-12-17 10:15:43 +00:00
Max Schaefer
bccdf59631 C++: Remove an unecessary unresolveElement.
As far as I can see, `@file` is not a `@usertype`, so this shouldn't be needed.
2019-12-17 10:15:43 +00:00
Max Schaefer
923e36ba4f C++/Java/JavaScript/Python: Make qldoc consistent. 2019-12-17 10:15:43 +00:00
Max Schaefer
a2fe678464 C++/Java/JavaScript/Python: Unify imports in XML.qll. 2019-12-17 10:15:43 +00:00
Geoffrey White
4d3fa3ac1d C++: Demote UnsafeArrayForDaysOfYear.ql. 2019-12-17 10:14:24 +00:00
Geoffrey White
c1be4c78af C++: Add tags to the leap year + japanese era queries. 2019-12-17 10:14:20 +00:00
Geoffrey White
6d516e0192 C++: Make some implementations in DatTime.qll more robust (and cope with 'const'). 2019-12-17 10:14:08 +00:00
Jonas Jensen
9193a81e1a Merge pull request #2534 from geoffw0/xml
C++: Fix characteristic predicate of `XMLParent`.
2019-12-17 10:57:40 +01:00
Robert Marsh
fdaa06ce92 C++:autoformat 2019-12-16 12:54:31 -08:00
Robert Marsh
3c9d7953b6 Merge branch 'master' into rdmarsh/cpp/default-taint-tracking-sources 2019-12-16 11:49:22 -08:00
Dave Bartolomeo
60c40adf31 C++: Fix formatting 2019-12-16 10:00:54 -07:00