Commit Graph

12966 Commits

Author SHA1 Message Date
Anders Schack-Mulligen
a80cb262fc Java/C++/C#: Elaborate qldoc. 2019-08-05 16:28:25 +02:00
Anders Schack-Mulligen
9ebb83497d Java/C++/C#: Fix small mistake. 2019-08-05 15:34:12 +02:00
Anders Schack-Mulligen
2dc83c539c Java/C++/C#: Sync dataflow. 2019-08-05 12:07:32 +02:00
Anders Schack-Mulligen
d6e1ba6bed CPP: Autoformat cookbook examples. 2019-08-02 15:29:20 +02:00
Dave Bartolomeo
6370391dbd C++: Add sanity test for definitions that don't dominate their uses. 2019-08-01 15:01:42 -07:00
Dave Bartolomeo
912679ef8c C++: Two IR fixes
My original fix in https://github.com/Semmle/ql/pull/1661 fixed my minimal test case, but did not fix the original failure in a Linux snapshot. The real fix is to simply not create a `TranslatedDeclarationEntry` for an extern declaration, and have `TranslatedDeclStmt` skip any such declarations. I've added a regression test for that case (multiple extern declarations with same location in a macro expansion, with control flow between them). I did verify that it generates correct IR, and that it fixes all of the "use not dominated by definition" failures in Linux.

The underlying extractor bug, that caused the above issue also caused PrintAST to print garbage. I've worked around the bug in PrintAST.qll.

I've also fixed a bug in the control flow for `try`/`catch`, where there was missing flow from the `CatchByType` of the last handler of a `try` to the enclosing handler (or `Unwind`). Hat tip to @AndreiDiaconu1 for spotting this bug.
2019-08-01 14:38:19 -07:00
zlaski-semmle
2bc66ae553 Merge pull request #1661 from dave-bartolomeo/dave/ExternDeclarations
C++: Stop generating `NoOp` instructions for declarations of externs
2019-07-31 19:09:06 -07:00
semmle-qlci
1d806971ed Merge pull request #1634 from aibaars/cookbook
Approved by aschackmull, dave-bartolomeo, hvitved, markshannon, xiemaisi, yh-semmle
2019-07-31 14:31:28 +01:00
Dave Bartolomeo
972f0d97d3 C++: Stop generating NoOp instructions for declarations of externs
Previously, where we had a function-scoped `DeclarationEntry` for an extern variable or function, we would generate a `NoOp` instruction for it. There's nothing wrong with this by itself, although it was unnecessary. However, I've hit an extractor issue (Jira ticket already opened) that commonly causes multiple `DeclStmt`s to share a single `DeclarationEntry` child on extern declarations, so removing the `NoOp` instructions is an easy way to work around the extractor issue.
2019-07-30 16:49:24 -07:00
Ziemowit Laski
78ebdad1ea Add a __builtin_va_list type, to complement __builtin_va_*
expressions.
2019-07-30 16:36:37 -07:00
Ian Lynagh
8d8a2201b7 C++: Accept changes to getValueText 2019-07-30 23:24:52 +01:00
semmle-qlci
07fa55f331 Merge pull request #1647 from zlaski-semmle/zlaski/builtin-types-compatible-p
Approved by dave-bartolomeo
2019-07-30 20:43:39 +01:00
zlaski-semmle
075e4ab159 Update cpp/ql/src/semmle/code/cpp/exprs/BuiltInOperations.qll
Co-Authored-By: Dave Bartolomeo <42150477+dave-bartolomeo@users.noreply.github.com>
2019-07-30 11:39:42 -07:00
Ian Lynagh
96a21238d1 C++: Add an upgrade script 2019-07-30 14:07:35 +01:00
Ian Lynagh
5d9d289eb7 C++: Add stats for 'constexpr if' 2019-07-30 14:07:35 +01:00
Ian Lynagh
6cce7ef2b7 C++: Add CFG test for constexpr_if 2019-07-30 14:07:35 +01:00
Ian Lynagh
7c763cc3bd C++: Add a test for constexpr if 2019-07-30 14:07:35 +01:00
Ian Lynagh
f705c25c74 C++: Add support for constexpr if 2019-07-30 14:07:35 +01:00
Ziemowit Laski
2abf7681e0 Point the old BuiltInOperationBuiltInTypes at our new BuiltInOperationBuiltInTypesCompatibleP,
for backward compatibility.
2019-07-29 19:43:18 -07:00
Ziemowit Laski
889408be8f Add test case. 2019-07-29 17:17:42 -07:00
Ziemowit Laski
80ca950ae7 Change __builtin_types to __builtin_types_compatible_p 2019-07-29 15:41:41 -07:00
Robert Marsh
6bd22b01b3 Merge pull request #1607 from dave-bartolomeo/dave/CrossLanguageIR
C++: Start preparing IR for supporting multiple languages
2019-07-29 12:34:21 -07:00
Ian Lynagh
b2a68d7eaa C++: Update stats following lambda change 2019-07-26 20:39:22 +01:00
Ian Lynagh
cff1bb0b96 C++: Update lambda test output
Indexes are now 0-based.
2019-07-26 20:39:22 +01:00
Ian Lynagh
6c21fbaade C++: Add an upgrade script 2019-07-26 20:39:22 +01:00
Ian Lynagh
4385ca1ab6 C++: Follow changes to how lambdas are extracted 2019-07-26 20:39:22 +01:00
Arthur Baars
ccde7cf6cf Add @id to example queries 2019-07-26 17:47:11 +02:00
Arthur Baars
bdce7d07c1 Move 'snippet' queries to 'snippets' folders 2019-07-26 17:47:11 +02:00
Arthur Baars
30860daac4 Add cookbook queries 2019-07-26 17:47:11 +02:00
Anders Schack-Mulligen
6d022aa359 Java/C++/C#: Sync dataflow. 2019-07-26 13:17:12 +02:00
yh-semmle
a42d9b1f96 Merge pull request #1616 from aschackmull/java/dataflow-prunetype-bugfix
Java: Bugfix for flow through methods with taint step and upcast.
2019-07-24 22:28:05 -04:00
Robert Marsh
05cad96086 Merge pull request #1605 from geoffw0/bitwiseneg
CPP: Make BitwiseSignCheck.ql more accurate
2019-07-24 12:33:40 -07:00
Robert Marsh
fa43ae241d Merge pull request #1615 from geoffw0/exprowninit
CPP: Test + workaround for UseInOwnInitializer.ql
2019-07-24 12:13:24 -07:00
Geoffrey White
75f77b5f47 Merge pull request #1532 from zlaski-semmle/zlaski/cpp386
[CPP-386] Add `getCanonicalQLClass()` for AST QL elements.
2019-07-24 09:38:39 +01:00
Ziemowit Laski
e989eabc0a Update test case (remove references to MacroInvocationStmt and MacroInvocationExpr) 2019-07-22 11:09:30 -07:00
Ziemowit Laski
f8d52a3bea Remove getCanonicalQLClass() from MacroInvocationExpr and MacroInvocationStmt. 2019-07-22 11:04:30 -07:00
Anders Schack-Mulligen
cd8d16183c Java/CPP/C#: Sync dataflow. 2019-07-22 15:41:37 +02:00
Geoffrey White
d39d9bf1f0 CPP: Workaround FPs. 2019-07-22 11:48:25 +01:00
Geoffrey White
185ca590f2 CPP: Test exposing UseInOwnInitializer FPs. 2019-07-22 11:34:01 +01:00
Ziemowit Laski
dbf655253f Get rid of tabs. 2019-07-19 17:01:34 -07:00
Ziemowit Laski
a0570213d7 [CPP-386] Separate printing of casts and conversion, per Dave's request. 2019-07-19 16:56:22 -07:00
Dave Bartolomeo
8456bdd6eb C++: Move IR files that are now pyrameterized into implementation. 2019-07-19 15:37:45 -07:00
Dave Bartolomeo
832807401b C++: Move imports from instantiated pyrameterized modules into separate file
Rather than have IR.qll (which depends on the flavor) import EdgeKind.qll (which does not) with an non-relative import, I've moved these imports into internal.IRImports relative to IR.qll. These imports files can be shared across flavors within one language, but are different between C# and C++ due to the difference in paths.
2019-07-19 13:09:36 -07:00
Dave Bartolomeo
ac6e0cedaf Merge pull request #1614 from rdmarsh2/rdmarsh/cpp/ir-overlap-speedup
C++: further optimization of overlap computation
2019-07-18 19:48:59 -07:00
Ziemowit Laski
45d944411f [CPP-386] Fix Local{Class,Struct,Union}, macro invocations,
printing of member functions and operators.
2019-07-18 16:09:04 -07:00
Robert Marsh
2f27c1c2f5 C++: further optimization of overlap computation 2019-07-18 14:57:48 -07:00
Dave Bartolomeo
8d8c66fc49 C++: Delete unused file ValueCategory.qll 2019-07-18 13:55:34 -07:00
Dave Bartolomeo
add1702bf6 C++: Fix test breaks due to private imports of cpp 2019-07-18 12:29:41 -07:00
Dave Bartolomeo
5d1d082a4f C++: Pull a bunch of language-dependent code that the IR depends on out into a separate module 2019-07-17 17:05:06 -07:00
Dave Bartolomeo
1fdce43484 Merge pull request #1587 from rdmarsh2/rdmarsh/cpp/ir-overlap-speedup
C++: improve performance of overlap computation
2019-07-17 16:54:41 -07:00