Commit Graph

2357 Commits

Author SHA1 Message Date
Geoffrey White
fb5d02a634 CPP: Remove a redundant line. 2019-06-18 11:40:12 +01:00
Geoffrey White
bdb495d58a CPP: Fix AV Rule 95 performance issue. 2019-06-18 11:25:48 +01:00
Geoffrey White
83ec5f1ae9 Merge pull request #1354 from denislevin/denisl/cpp/MishandlingJapaneseDatesAndLeapYear
C++: Mishandling Japanese Era and Leap Year in calculations
2019-06-18 09:26:35 +01:00
Geoffrey White
b9a57a46d2 CPP: More accurate qldoc comment. 2019-06-18 08:56:52 +01:00
Geoffrey White
ce29047840 CPP: Resolve performance issue in CastArrayPointerArithmetic.ql's 'introducesNewField' predicate. 2019-06-17 16:33:48 +01:00
Geoffrey White
413788ae2d CPP: Fix qhelp. 2019-06-17 11:55:24 +01:00
Geoffrey White
415655ac23 CPP: Remove precision (for now) from a query that I've seen time out. 2019-06-17 10:07:34 +01:00
Geoffrey White
df230d2ba6 CPP: Make precision/severity more conservative for now. 2019-06-17 10:07:32 +01:00
Geoffrey White
93c4f1eea5 CPP: Autoformat. 2019-06-17 10:07:22 +01:00
Geoffrey White
8ebc0b9c39 CPP: Add basic .qhelp for Adding365daysPerYear.ql. 2019-06-14 14:25:02 +01:00
Geoffrey White
f1b76be57f CPP: Fix LeapYear.qhelp. 2019-06-14 14:25:01 +01:00
Jonas Jensen
41d5d5ab86 Merge pull request #1438 from geoffw0/assignedvalue
CPP: Support for aggregate initializers in getAnAssignedValue()
2019-06-14 00:37:46 -07:00
Denis Levin
7ff8fcd50e Some more typo fixes and a fix to test files 2019-06-13 17:16:30 -07:00
Denis Levin
ad489db815 Corrections related to the review comments. 2019-06-13 13:04:42 -07:00
Geoffrey White
37a1c48071 CPP: Optimize AV Rule 71.ql. 2019-06-13 15:30:56 +01:00
Ziemowit Laski
88a39d9454 [CPP-370] Fix up // GOOD and // BAD test annotations so that they're consistent. 2019-06-12 12:56:11 -07:00
Esben Sparre Andreasen
3f11ae7eaa Merge remote-tracking branch 'rc/1.21' into master 2019-06-12 12:57:55 +02:00
Jonas Jensen
32122e86b0 C++: use plain recursion in PrimitiveBasicBlocks
It's sometimes faster but sometimes up to 2x slower to use plain
recursion here. On the other hand, plain recursion won't run out of Java
heap space, and it won't make unrelated computation slower by forcing
all RAM data out to disk.
2019-06-11 14:30:21 +02:00
Geoffrey White
bf680161fd CPP: Optimize. 2019-06-11 11:00:45 +01:00
Jonas Jensen
16b151745b C++: use shortestDistances in PrimitiveBasicBlocks
The use of transitive closure for BB index calculation has been the
cause of an out-of-memory error. This commit switches the calculation to
use the `shortestDistances` HOP, which still has the problem that the
result needs to fit in RAM, but at least the RAM requirements are sure
to be linear in the size of the result. The `shortestDistances` HOP is
already used for BB index calculation for the C++ IR and for C#.

We could guard even better against OOM by switching the calculation to
use manual recursion, but that would undo the much-needed performance
improvements we got from #123.

This change improves performance on Wireshark, which is notorious for
having long basic blocks. When I benchmarked `shortestDistances`
for #123, it was slower than TC. With the current evaluator, it looks
like `shortestDistances` is faster. Performance before was:

    PrimitiveBasicBlocks::Cached::getMemberIndex#ff ................... 9.7s (executed 8027 times)
    #PrimitiveBasicBlocks::Cached::member_step#ffPlus ................. 6.6s
    PrimitiveBasicBlocks::Cached::primitive_basic_block_entry_node#f .. 3.5s
    PrimitiveBasicBlocks::Cached::primitive_basic_block_member#fff .... 2.3s

Performance with this commit is:

    PrimitiveBasicBlocks::Cached::primitive_basic_block_entry_node#f ................................................................... 3.5s
    shortestDistances@PrimitiveBasicBlocks::Cached::primitive_basic_block_entry_node#1@PrimitiveBasicBlocks::Cached::member_step#2#fff . 3s
    PrimitiveBasicBlocks::Cached::primitive_basic_block_member#fff ..................................................................... 963ms
2019-06-11 09:44:50 +02:00
Ziemowit Laski
0f5a4a7089 [CPP-370] Improve handling of _ macros by using taint sanitizers. 2019-06-10 15:50:53 -07:00
Geoffrey White
a842ed56cf CPP: Integrate and produce full results. 2019-06-10 15:33:12 +01:00
Geoffrey White
e143870b65 CPP: Pavel's sketch implementation. 2019-06-10 15:33:12 +01:00
Geoffrey White
2f36d81137 CPP: Add cases for fields. 2019-06-10 15:07:52 +01:00
Geoffrey White
d3f98a5a74 CPP: Create a direct test of Variable.getAnAssignedValue(). 2019-06-10 14:33:14 +01:00
Geoffrey White
3deff9c578 CPP: Fix in dataflow. 2019-06-10 12:01:14 +01:00
Geoffrey White
d51f870053 CPP: Add test cases. 2019-06-10 12:01:13 +01:00
Nick Rolfe
2622df0262 Merge pull request #1411 from ian-semmle/qlcfg3
C++: QL CFG: Use synthetic_destructor_call table rather than SyntheticDestructorCalls
2019-06-07 16:22:24 +01:00
Ian Lynagh
46cce36552 C++: Add an upgrade script 2019-06-07 14:00:52 +01:00
Ian Lynagh
fa604a393b C++: Some tidyups following review comments 2019-06-07 14:00:52 +01:00
Ian Lynagh
896e64b987 C++: Update stats 2019-06-07 14:00:52 +01:00
Ian Lynagh
a14379b860 C++: Document external package tables in dbscheme 2019-06-07 14:00:52 +01:00
Ian Lynagh
79b08d2792 C++: Remove SyntheticDestructorCalls
It is now replace by the synthetic_destructor_call table.
2019-06-07 14:00:52 +01:00
Ian Lynagh
03f555dda5 C++: Update test output following QLCFG changes 2019-06-07 14:00:52 +01:00
Ian Lynagh
93afadf09a C++: Add and use synthetic_destructor_call table 2019-06-07 14:00:52 +01:00
Jonas Jensen
cf96035d8c C++: Suspicious pointer scaling: @precision medium
This query is not producing good enough results to justify `@precision
high`. It's fundamentally looking for a pattern that should correlate
with memory management errors, but it doesn't look for the errors
themselves.
2019-06-06 21:08:20 -07:00
Ziemowit Laski
8f79cdb1fb [CPP-370] Add an additional test case. 2019-06-04 16:19:01 -07:00
Ziemowit Laski
d86557cfcb Adjust .expected output. 2019-06-04 12:57:43 -07:00
Ziemowit Laski
37fe68c656 Improve Element::toString() performance by removing recursion
in TypeMention::toString().
2019-06-04 12:57:43 -07:00
zlaski-semmle
51e543a41d Merge branch 'master' into zlaski/cpp370 2019-06-04 09:47:30 -07:00
Nick Rolfe
8e7521d6b8 C++: add missing close-paragraph tag to qhelp 2019-06-04 11:27:34 +01:00
Max Schaefer
5f32e1f637 CPP: Fix name of example file in qhelp.
This seems to have been missed in https://github.com/Semmle/ql/pull/1315.
2019-06-03 08:54:54 +01:00
semmle-qlci
79406f8387 Merge pull request #987 from rdmarsh2/rdmarsh/cpp/ir-asm-stmt
Approved by dave-bartolomeo
2019-06-03 07:03:28 +01:00
Jonas Jensen
c9a0eed6e8 Merge pull request #1379 from geoffw0/ctime-repair
CPP: Add DangerousFunctionOverflow.ql to the security suite.
2019-06-02 09:56:01 +02:00
Robert Marsh
4371d02a1f C++: accept SignAnalysis.expected 2019-05-31 13:35:05 -07:00
Robert Marsh
5dd8c9cd4e C++: revert InlineAsm subclassing SideEffectOpcode 2019-05-31 13:28:26 -07:00
Robert Marsh
2770b2a9b9 C++: respond to PR comments 2019-05-31 13:19:40 -07:00
Robert Marsh
98d6f5919f C++: Treat asmStmt operands as input/output in IR 2019-05-31 12:51:44 -07:00
Robert Marsh
66d1efdb97 C++: respond to PR comments 2019-05-31 12:42:04 -07:00
Dave Bartolomeo
0bfc559cb1 Apply suggestions from code review
Co-Authored-By: rdmarsh2 <rdmarsh2@gmail.com>
2019-05-31 12:29:23 -07:00