1985 Commits

Author SHA1 Message Date
Jonas Jensen
3700a631a6 C++: Performance fix for existsCompleteWithName 2019-08-27 16:28:57 +02:00
Pavel Avgustinov
deacc23465 Merge pull request #1824 from jbj/sbb-perf
C++: Optimize SubBasicBlocks library
2019-08-26 13:02:43 +01:00
Jonas Jensen
5e674825e3 C++: Optimize SubBasicBlock::getPosInBasicBlock() 2019-08-26 12:47:40 +02:00
Jonas Jensen
d4f1cf97fd C++: Optimize SubBasicBlock::getNode(int) 2019-08-26 12:22:37 +02:00
Jonas Jensen
be24c6418b C++: Optimize SubBasicBlock::getNumberOfNodes() 2019-08-26 12:22:34 +02:00
Jonas Jensen
27b6ed3be4 Merge pull request #1822 from pavgust/fix/multiloc-defs
definitions.qll: Suppress multi-location links.
2019-08-26 10:50:21 +02:00
zlaski-semmle
c276d0b8ac Merge pull request #1770 from geoffw0/qldoceg7
CPP: Add syntax examples to QLDoc in various files
2019-08-25 20:15:51 -07:00
Pavel Avgustinov
b9b0c3bc5d definitions.qll: Suppress multi-location links. 2019-08-25 15:59:17 +01:00
Jonas Jensen
52e4058903 C++: Fix lambda_capture upgrade query join order
When this query was run as an upgrade script, the optimizer picked a bad
join order, making the upgrade very slow on large databases. It picked a
bad join order because upgrade scripts are run with no stats.
2019-08-24 15:33:50 +02:00
Geoffrey White
fbeb79729b CPP: Upgrade script. 2019-08-23 08:44:30 +01:00
Geoffrey White
cf6ada5758 CPP: Update stats. 2019-08-23 08:44:29 +01:00
Geoffrey White
29000c411c CPP: Make LambdaCapture an Element. 2019-08-23 08:44:29 +01:00
Geoffrey White
6462da736b CPP: Another test case. 2019-08-23 08:44:29 +01:00
Geoffrey White
19a0d4697e CPP: More thorough test of LambdaCapture. 2019-08-23 08:44:29 +01:00
Robert Marsh
23b74b5521 Merge pull request #1750 from dave-bartolomeo/dave/ZooKeeper
C++: Minimal IR support for `GNUVectorType`
2019-08-22 14:34:59 -07:00
Calum Grant
ff20a2ceb9 Merge pull request #1761 from hvitved/csharp/dataflow/fields
C#: Data flow through fields
2019-08-22 20:46:00 +01:00
Dave Bartolomeo
a84a7e8c8a C++: Fixup after rebase 2019-08-22 11:36:15 -07:00
Dave Bartolomeo
8a9528b1a8 C++: Accept test output after fixes for PointerAdd element sizes 2019-08-22 10:43:31 -07:00
Dave Bartolomeo
3108d97ea5 C++: Minimal IR support for GNUVectorType
Lack of support for the GCC vector extensions was causing a bunch of sanity failures in the syntax zoo. This PR adds minimal IR generation support for these types.

Added `VectorAggregateLiteral`, and factored most of `ArrayAggregateLiteral` out into the common base class `ArrayOrVectorAggregateLiteral`. I'd be happy to merge these all into `ArrayAggregateLiteral` if we don't care about the distinction.

Made a few tweaks to `TranslatedArrayExpr` to compute the element type by looking at the result type of the `ArrayExpr`, not the type of the base operand. Note that this means that for `T a[10]; a[i] = foo;`, the result of the `PointerAdd` for `a[i]` will now be `glvalue<T>`, not `T*`. This is actually more faithful to the source language, and has no semantic difference on the IR.

Added some missing `getInstructionElementSize()` overrides.

Added the new `BuiltIn` opcode, renamed the existing `BuiltInInstruction` to `BuiltInOperationInstruction`, and made any `BuiltInOperation` that we don't specifically handle translate to `BuiltIn`. `BuiltInOperationInstruction` now has a way to get the specific `BuiltInOperation`.

Added `getCanonicalQLClass()` overrides for `GNUVectorType` and `BuiltInOperation`.

Added a simple IR test for vector types.
2019-08-22 10:43:30 -07:00
Jonas Jensen
f5a63e3a91 Merge pull request #1801 from geoffw0/lambdar
CPP: Update taint test comments.
2019-08-22 18:45:41 +02:00
Nick Rolfe
bea1f687e7 Merge pull request #1796 from mgrettondann/enable-usingentry-getenclosingelement
C++: Add support for UsingEntry.getEnclosingElement
2019-08-22 17:01:57 +01:00
Geoffrey White
a70975f95f CPP: Update test comments. 2019-08-22 15:40:38 +01:00
Geoffrey White
c007d4ffd7 Merge pull request #1781 from jbj/dataflow-location-workaround
C++: Workaround for lambda expression locations
2019-08-22 15:36:22 +01:00
Matthew Gretton-Dann
855ce8dd9d C++: Add support for UsingEntry.getEnclosingElement 2019-08-22 14:23:38 +01:00
Tom Hvitved
0801e51175 Merge pull request #1790 from jbj/tainttracking-cross-language
C++/C#/Java: Shared TaintTrackingImpl.qll
2019-08-22 14:17:23 +02:00
Jonas Jensen
d38dbf0f63 C++: Workaround for lambda expression locations
See CPP-427.
2019-08-22 11:52:56 +02:00
Jonas Jensen
ad9ee54b65 C++/C#/Java: defaultAdditionalTaintStep 2019-08-22 11:14:06 +02:00
Robert Marsh
1b6339528c Merge pull request #1783 from jbj/taint-fields-structs
C++: Don't propagate taint between field and struct [CPP-410]
2019-08-21 11:20:26 -07:00
Tom Hvitved
a2ffddec5f Merge pull request #1785 from jbj/dataflow-recursion-prevention-shared
C++/C#/Java: Pyrameterize ConfigurationRecursionPrevention
2019-08-21 15:56:50 +02:00
Jonas Jensen
25701f203d C++/C#/Java: Shared TaintTrackingImpl.qll
This file is now identical in all languages. Unifying this file led to
the following changes:
- The documentation spelling fixes and example from the C++ version
  were copied to the other versions and updated.
- The steps through `NonLocalJumpNode` from C# were abstracted into a
  `globalAdditionalTaintStep` predicate that's empty for C++ and Java.
- The `defaultTaintBarrier` predicate from Java is now present but empty
  on C++ and C#.
- The C++ `isAdditionalFlowStep` predicate on
  `TaintTracking::Configuration` no longer includes `localFlowStep`.
  That should avoid some unnecessary tuple copying.
2019-08-21 14:55:54 +02:00
Jonas Jensen
863bf523d6 C++/C#/Java: Autoformat 2019-08-21 13:24:01 +02:00
Jonas Jensen
fdd3b901f7 C/C#/Java: Share ConfigurationRecursionPrevention
This class was copy-pasted in all `DataFlowN.qll` files without using
the identical-files system to keep the copies in sync. The class is now
moved to the `DataFlowImplN.qll` files.

This also has the effect of preventing recursion through first data flow
library copy for C/C++. Such recursion has been deprecated for over a
year, and some forms of recursions are already ruled out by the library
implementation.
2019-08-21 13:04:10 +02:00
Jonas Jensen
2f4ed45dac C++: No taint between field and struct
To compensate for the lack of field flow, the taint tracking library has
previously considered taint to flow from fields to their containing
structs and back again from the structs to any of their fields. This
leads to false flow between unrelated fields and is not needed now that
we have proper flow through fields.
2019-08-21 11:57:12 +02:00
Jonas Jensen
6fc3a62edb C++/C#/Java: Change another caller of localFlow
There was also a use of `localFlowStep` in `DataFlowImplCommon` that
should now be `simpleLocalFlowStep`.
2019-08-21 10:20:15 +02:00
Jonas Jensen
4b7813b98e C++/C#/Java: Split localFlowStep predicate in two
There's now a `localFlowStep` predicate for use directly in queries and
other libraries and a `simpleLocalFlowStep` for use only by the global
data flow library. The former predicate is intended to include field
flow, but the latter may not.

This will let Java and C# (and possibly C++ IR) avoid getting two kinds
of field flow at the same time, both from SSA and from the global data
flow library. It should let C++ AST add some form of field flow to
`localFlowStep` without making it an input to the global data flow
library.
2019-08-21 09:27:01 +02:00
zlaski-semmle
c2d1a52b39 Merge pull request #1732 from geoffw0/qldoceg6
CPP: Add syntax examples to QLDoc in Block.qll, Stmt.qll
2019-08-20 16:34:35 -07:00
Geoffrey White
675e1cc349 CPP: Add a reverse-link for consistency between Field and MemberVariable. 2019-08-20 15:38:02 +01:00
Tom Hvitved
7ab9c8b90d Java/C++/C#: flowCandFwdRead() refactor 2019-08-20 14:44:04 +02:00
Tom Hvitved
14378ee41a Java/C++/C#: Remove some unbind() calls from shared data flow implementation 2019-08-20 13:59:01 +02:00
Jonas Jensen
d65b09d94a C++: Proper fix for TaintTracking2 parameter 2019-08-20 13:45:37 +02:00
Jonas Jensen
b1cd64bbf4 C++: Fix mismatch between taint and dataflow copy 2019-08-20 13:45:37 +02:00
Jonas Jensen
d388be7d3b C++: Use pyrameterized modules for TaintTracking 2019-08-20 13:45:37 +02:00
Tom Hvitved
a0c834c83d Java/C++/C#: Improve data flow join orders for field flow 2019-08-20 10:14:08 +02:00
Geoffrey White
f045035f5d CPP: Examples Include.qll. 2019-08-19 15:58:44 +01:00
Anders Schack-Mulligen
6ff4fe38ec Java/C++/C#: Add field flow support for stores in nested fields. 2019-08-19 14:41:06 +02:00
Geoffrey White
a889a79816 CPP: Examples Field.qll. 2019-08-19 11:48:58 +01:00
Geoffrey White
f6ccaa5caf CPP: Examples FriendDecl.qll. 2019-08-19 11:31:33 +01:00
Geoffrey White
b69df9113a CPP: Examples Comments.qll. 2019-08-19 11:29:24 +01:00
Geoffrey White
bc3e4e4143 CPP: Examples Lambda.qll. 2019-08-19 09:59:26 +01:00
Geoffrey White
d29eefd235 CPP: Examples Macro.qll. 2019-08-19 09:59:26 +01:00