Commit Graph

7071 Commits

Author SHA1 Message Date
Mathias Vorreiter Pedersen
af364e66fc C++/C#: Move sanity check inside InstructionSanity module and accept tests 2020-02-23 20:53:49 +01:00
Dave Bartolomeo
170331b105 C++: Better fix for void type on buffer access
Fixes issue https://github.com/github/codeql-c-analysis-team/issues/20

This change undoes the workaround in https://github.com/Semmle/ql/pull/2736, and replaces it with a fix for the underlying cause. The problem was that the IR construction code for side effects incorrectly assumed that `BufferAccessOpcode` included `SizedBufferAccessOpcode`. I think that was actually a perfectly reasonable assumption to make, so I changed the `Opcode` hierarchy to make it true.
2020-02-21 18:46:32 -07:00
Anders Schack-Mulligen
771cb754c2 Merge pull request #2822 from hvitved/dataflow/node-cand-simple-call-context
Data flow: Track simple call contexts in `nodeCand[Fwd]1`
2020-02-21 10:02:06 +01:00
Tom Hvitved
0cc3218115 Merge pull request #2872 from aschackmull/dataflow/pathstep-localflow-join
Java/C++/C#: Improve join-order in pathStep predicate
2020-02-21 09:39:17 +01:00
Mathias Vorreiter Pedersen
780010d8f9 C++/C#: Sync identical files 2020-02-20 22:15:06 +01:00
Mathias Vorreiter Pedersen
4545ad0f93 C++: Add sanity check to Instruction.qll 2020-02-20 22:09:02 +01:00
Mathias Vorreiter Pedersen
76e5bd59df C++: Change edge to DefaultEdge 2020-02-20 22:08:16 +01:00
Tom Hvitved
a772b82fea Address review comments 2020-02-20 19:48:49 +01:00
Mathias Vorreiter Pedersen
c5f38eecfe C++: Fix IR generation and accept output 2020-02-20 15:37:02 +01:00
Jonas Jensen
97035aeb63 Merge pull request #2848 from geoffw0/model-sideeffects
C++: Disambiguate SideEffectFunction QLDoc.
2020-02-20 10:30:53 +01:00
Robert Marsh
bed6d2b225 Merge branch 'master' into rdmarsh/cpp/malloc-alias-locations 2020-02-19 16:44:13 -08:00
Dave Bartolomeo
4f1a23e248 "Fix" spelling 2020-02-19 15:57:31 -07:00
Dave Bartolomeo
5263222dc2 "Fix" spelling 2020-02-19 15:57:19 -07:00
Anders Schack-Mulligen
91166431d2 Java/C++/C#: s/Callable/DataFlowCallable/ 2020-02-19 17:23:01 +01:00
Geoffrey White
4e2a45cd3e C++: Correct SideEffectFunction model for PureStrFunction. 2020-02-19 14:38:43 +00:00
Geoffrey White
22cba0f26e C++: Delete TODO. 2020-02-19 14:38:43 +00:00
Geoffrey White
5f7085937e C++: Improve the SideEffect library QLDoc. 2020-02-19 14:38:43 +00:00
Anders Schack-Mulligen
c6016bb08c Java/C++/C#: Improve join-order in pathStep predicate 2020-02-19 14:47:39 +01:00
Mathias Vorreiter Pedersen
59a19679ea C++/C#: Sync identical files after merge 2020-02-19 11:06:00 +01:00
Mathias Vorreiter Pedersen
bbcc1e1c37 Merge branch 'master' into sync-ir-valuenumbering-internals 2020-02-19 10:43:48 +01:00
Robert Marsh
adfe5f30a1 Merge branch 'master' into rdmarsh/cpp/ir-flow-through-outparams 2020-02-18 08:42:27 -08:00
Mathias Vorreiter Pedersen
cc4c780573 Merge pull request #2860 from jbj/isInCycle-neighbors
C++: Manual magic for `isInCycle`
2020-02-18 17:41:19 +01:00
Robert Marsh
aaf6926c34 Merge pull request #2851 from jbj/ir-enable-only
C++: Use IR for security.TaintTracking and GVN
2020-02-18 11:37:34 -05:00
Jonas Jensen
0d239e8bd2 C++: Manual magic for isInCycle
The `isInCycle` predicate would take a long time on Wireshark with 6GB
RAM, sometimes OOMing in the fastTC HOP. Analyzing wireshark with 6GB is
important because that's the standard configuration on our Jenkins
workers. With this commit, I can analyze Wireshark with 6GB on my
laptop.

The `getNonPhiOperandDef` predicate on Wireshark is 34M tuples, while
`getDefIfHasNeighbors` is 11M tuples, and the TC of
`getDefIfHasNeighbors` is 23M tuples (487 MB).
2020-02-18 08:33:43 +01:00
Tom Hvitved
a695b567ec Data flow: Sync files 2020-02-17 19:39:52 +01:00
semmle-qlci
ecad925101 Merge pull request #2631 from hvitved/dataflow/generalize-flow-summaries
Approved by aschackmull
2020-02-17 18:22:46 +00:00
Tom Hvitved
0e7838aca5 Data flow: Sync files 2020-02-17 15:08:26 +01:00
Tom Hvitved
28307399f8 Data flow: Sync files 2020-02-17 10:45:35 +01:00
Jonas Jensen
0aba965a9e C++: Don't mention deprecated class
The language tests were failing because they don't tolerate mentioning a
deprecated class anywhere.
2020-02-16 09:43:25 +01:00
Jonas Jensen
f4ba56f0c0 C++: Use IR for security.TaintTracking and GVN 2020-02-15 21:10:29 +01:00
Jonas Jensen
0628625a76 Merge pull request #2835 from MathiasVP/value-number-perf
C++: Value number performance fix
2020-02-15 20:40:53 +01:00
Mathias Vorreiter Pedersen
8cda847dbc C++: Add TLoadTotalOverlapValueNumber to getKind predicate in AST GVN wrapper 2020-02-15 09:37:45 -07:00
Jonas Jensen
49d2f5a60b C++: autoformat 2020-02-15 09:41:27 +01:00
Dave Bartolomeo
867581df91 Merge pull request #2844 from MathiasVP/value-numbering-performance-fix-2
C++: Ensure that there is just one overlap for an operand in value numbering
2020-02-14 16:40:03 -07:00
Robert Marsh
7abd289d7d C++: reinclude IRType in total load value numbers 2020-02-14 13:34:29 -08:00
Mathias Vorreiter Pedersen
8b8a8cae5b C++/C#: Sync identical files 2020-02-14 16:11:57 +01:00
Mathias Vorreiter Pedersen
4a7b865dc0 C++: Move overlap fix into SSAConstruction 2020-02-14 16:11:00 +01:00
Mathias Vorreiter Pedersen
121c5e436d C++: Check that there is only one overlap 2020-02-14 11:13:53 +01:00
Jonas Jensen
928bdbacb0 C++: Change import order for stable cache checksum
Without this fix, running the full LGTM suite would get the IR evaluated
twice. That's because we have multiple IPA types and constructors with
the same name (like `TInstruction` and `MkIRFunction`), and the QL
compiler chooses how to disambiguate those names differently depending
on import order.

I've tested that the IR is only evaluated once now by running the whole
suite on a tiny project (jbj/magicrescue) and looking at the output of

    perl -ne 'print if /^RESULTS IN:/ .. /^\[/ and not /^\[/' runSnapshotQueries-debug.log | sort |uniq -c |sort -n |less
2020-02-14 10:28:52 +01:00
Robert Marsh
b4ff1216cc C++: sync identical files 2020-02-13 17:02:00 -08:00
Robert Marsh
0f58887396 C++: unique value number for filtered instructions
Instructions that are removed from the normal value numbering recursion
because they have a duplicated type or AST element get unique value
numbers rather than going unnumbered. This ensures comparisons of value
numbers using `!=` hold for filtered instructions.
2020-02-13 15:36:42 -08:00
Mathias Vorreiter Pedersen
d4c6f487bc C++/C#: Fix sync config file for value numbering sharing 2020-02-13 22:32:52 +01:00
Mathias Vorreiter Pedersen
ed7888c612 C++: Sync identical files 2020-02-13 21:50:03 +01:00
Mathias Vorreiter Pedersen
57613d5507 C++: Reintroduce the type in TConstantValueNumber to avoid giving constant with different signed-ness the same value number. Instead filter those with more than one type out. 2020-02-13 21:49:40 +01:00
Dave Bartolomeo
9e1ea01be8 Fix typo 2020-02-13 13:01:09 -07:00
Mathias Vorreiter Pedersen
cb510edcf0 C++: Sync up identical files and restore imports 2020-02-13 18:02:56 +01:00
Mathias Vorreiter Pedersen
04c5f1cbb4 C++: Perf fix for value numbering 2020-02-13 18:02:56 +01:00
Jonas Jensen
24396905a5 WIP: Try to reduce ambiguous value numbers
This is not enough to get genome/breakdancer working.
2020-02-13 18:02:56 +01:00
Jonas Jensen
8054cde9fc WIP: Switch on IR 2020-02-13 18:02:56 +01:00
Tom Hvitved
332733a92e Java/C++: Follow-up changes 2020-02-13 16:34:06 +01:00