Commit Graph

419 Commits

Author SHA1 Message Date
Jonas Jensen
df948ecbbc C++: IR: designated initializer test 2018-09-11 19:43:02 +02:00
Jonas Jensen
bb49966395 C++: Fixup getEndOfValueInitializedRange 2018-09-11 15:19:18 +02:00
Jonas Jensen
b2571c8d63 C++: IR: Fix performance of value-init ranges
On a snapshot of Postgres, evaluation of
`getNextExplicitlyInitializedElementAfter#fff#antijoin_rhs#1` took
forever, preventing the computation of the IR. I haven't been able to
reproduce it with a small test case, but the implementation of
`getNextExplicitlyInitializedElementAfter` was fragile because it called
the inline predicate `ArrayAggregateLiteral.isInitialized`. It also
seemed inefficient that `getNextExplicitlyInitializedElementAfter` was
computed for many values of its parameters that were never needed by the
caller.

This commit replaces `getNextExplicitlyInitializedElementAfter` with a
new predicate named `getEndOfValueInitializedRange`, which should have
the same behavior but a more efficient implementation. It uses a helper
predicate `getNextExplicitlyInitializedElementAfter`, which shares its
name with the now-deleted predicate but has behavior that I think
matches the name.
2018-09-11 11:43:46 +02:00
Jonas Jensen
4051e348eb Merge pull request #169 from felicity-semmle/1.18/cpp-finalize-change-notes
LGTM 1.18: finalize change notes for C/C++
2018-09-09 15:39:40 +02:00
Felicity Chapman
a08177f16b Address initial feebback 2018-09-09 11:52:35 +01:00
Tom Hvitved
f3eed4aec7 Merge pull request #163 from calumgrant/cs/extractor-fixes
C#: Add tests for extractor fixes, and improve CFG for ConstCases
2018-09-07 17:37:40 +02:00
Felicity Chapman
3eab1de2f5 Remove non-LGTM queries from notes (will move to 'studio-cpp.md') 2018-09-07 13:56:55 +01:00
Felicity Chapman
2e0818d8e6 Text changes for consistency and clarity 2018-09-07 13:55:24 +01:00
Felicity Chapman
e7116f57a0 Add query identifiers 2018-09-07 13:24:41 +01:00
Felicity Chapman
6aa6b64b81 Remove placeholders and sort table 2018-09-07 12:05:40 +01:00
calum
58cf95b155 C#: Rewrite not using if. 2018-09-07 11:37:05 +01:00
calum
0cd4340ac3 C#: Address review comment: refactor last() predicate for ConstCase and TypeCase. 2018-09-07 10:15:16 +01:00
calum
d5eacf8c13 C#: Change expected output. Address review comments. 2018-09-06 18:20:01 +01:00
semmle-qlci
10329fa188 Merge pull request #134 from jbj/getOperandMemoryAccess-this
Approved by dave-bartolomeo
2018-09-06 09:18:57 +01:00
semmle-qlci
62e9946fe2 Merge pull request #150 from asger-semmle/ts-asi-bug
Approved by xiemaisi
2018-09-05 21:22:29 +01:00
calum
3718237acc C#: Implement CFG for ConstCase statements with a condition. 2018-09-05 18:15:47 +01:00
calum
c2f3cb6a2a C#: Update analysis change notes. 2018-09-05 17:48:45 +01:00
calum
cff00506ba C#: Implementation of case ... when ...: which was not previously handled. Move getCondition to CaseStmt. Implement the CFG and tests. 2018-09-05 17:47:31 +01:00
calum
8c2d773866 C#: Extractor test for join ... into 2018-09-05 17:19:04 +01:00
calum
7a77740979 C#: Extractor tests for
- While statements
- Object initializers
2018-09-05 17:19:04 +01:00
calumgrant
727ab94c4e Merge pull request #140 from hvitved/csharp/cfg/renaming
C#: Rename and restructure control flow graph entities
2018-09-05 17:18:08 +01:00
semmle-qlci
43e1e62d3a Merge pull request #133 from jbj/IRBlock-number-split
Approved by dave-bartolomeo
2018-09-05 14:58:15 +01:00
semmle-qlci
a70526f79f Merge pull request #123 from jbj/primitive-bb-number-split
Approved by dave-bartolomeo
2018-09-05 13:21:14 +01:00
Tom Hvitved
061b3d40ea C#: Fix typos in change note 2018-09-05 14:20:27 +02:00
Tom Hvitved
82b2c00c19 C#: Add change note 2018-09-05 14:20:27 +02:00
Tom Hvitved
42faabc552 C#: Rename and restructure control flow graph entities
Follow a naming structure similar to the data flow library:

- `ControlFlowNode` -> `ControlFlow::Node`.
- `CallableEntryNode` -> `ControlFlow::Nodes::EntryNode`.
- `CallableExitNode` -> `ControlFlow::Nodes::ExitNode`.
- `ControlFlowEdgeType` -> `ControlFlow::SuccessorType`.
- `ControlFlowEdgeSuccessor` -> `ControlFlow::SuccessorTypes::NormalSuccessor`.
- `ControlFlowEdgeConditional -> ControlFlow::SuccessorTypes::ConditionalSuccessor`.
- `ControlFlowEdgeBoolean` -> `ControlFlow::SuccessorTypes::BooleanSuccessor`.
- `ControlFlowEdgeNullness` -> `ControlFlow::SuccessorTypes::NullnessSuccessor`.
- `ControlFlowEdgeMatching` -> `ControlFlow::SuccessorTypes::MatchingSuccessor`.
- `ControlFlowEdgeEmptiness` -> `ControlFlow::SuccessorTypes::EmptinessSuccessor`.
- `ControlFlowEdgeReturn` -> `ControlFlow::SuccessorTypes::ReturnSuccessor`.
- `ControlFlowEdgeBreak` -> `ControlFlow::SuccessorTypes::BreakSuccessor`.
- `ControlFlowEdgeContinue` -> `ControlFlow::SuccessorTypes::ContinueSuccessor`.
- `ControlFlowEdgeGotoLabel` -> `ControlFlow::SuccessorTypes::GotoLabelSuccessor`.
- `ControlFlowEdgeGotoCase` -> `ControlFlow::SuccessorTypes::GotoCaseSuccessor`.
- `ControlFlowEdgeGotoDefault` -> `ControlFlow::SuccessorTypes::GotoDefaultSuccessor`.
- `ControlFlowEdgeException` -> `ControlFlow::SuccessorTypes::ExceptionSuccessor`
2018-09-05 14:20:26 +02:00
calumgrant
8263b248b7 Merge pull request #152 from hvitved/csharp/base-ssa
C#: Fix bug in BaseSsa library
2018-09-05 13:02:56 +01:00
semmle-qlci
50b5a3bd71 Merge pull request #151 from asger-semmle/ts-ambient-toplevel
Approved by xiemaisi
2018-09-05 10:52:08 +01:00
semmle-qlci
6c1098d170 Merge pull request #120 from hvitved/csharp/query/useless-upcast
Approved by calumgrant
2018-09-05 08:39:25 +01:00
Jonas Jensen
e0c073360b C++: Remove CP in getOperandMemoryAccess
The overrides of `Instruction.getOperandMemoryAccess` did not relate
`this` to any of its other parameters, which made it attempt to compute
the Cartesian product of `Instruction` and `TPhiOperand`. This happened
only during computation of aliased SSA. Perhaps the optimizer was able
to eliminate the CP for the non-aliased SSA computation.

With this change, I'm able to compute aliased SSA for medium-sized
snapshots.
2018-09-05 08:52:39 +02:00
Jonas Jensen
5541b9fbf1 C++: Split IRBlock index from IRBlock membership
Instead of computing these two things in one predicate, they are
computed in separate predicates and then joined. This splits the
predicate `getInstruction`, which took 81s before, into predicates that
together take 20s on a medium-sized db.
2018-09-05 08:50:36 +02:00
Jonas Jensen
1bcae97447 Merge pull request #114 from geoffw0/samate-realloc
CPP: Handle 'realloc' better in MemoryMayNotBeFreed.ql
2018-09-05 08:35:13 +02:00
semmle-qlci
8225daf94d Merge pull request #122 from dave-bartolomeo/dave/IRShuffle
Approved by jbj
2018-09-04 23:56:38 +01:00
Tom Hvitved
124a00ba10 C#: Update expected output in SSA tests 2018-09-04 20:15:33 +02:00
Dave Bartolomeo
4a1d04b423 C++: Fix deprecated predicate warnings 2018-09-04 10:30:48 -07:00
Dave Bartolomeo
4086a8909b C++: Fix a couple IR-related tests to handle new directory tree
Also moved those tests under the IR test directory, so I'm less likely to forget them next time.
2018-09-04 09:05:33 -07:00
Dave Bartolomeo
fce7a5fccb C++: Final IR reshuffle
Moved IR flavors into "implementation", with internal files under "implementation/internal". Made `IRBlockConstruction` just a nested module of `IRConstruction`/`SSAConstruction`, so it gets picked up from the `Construction` parameter of the `IR` module, rather than being picked up just from being in the same directory as `IRBlock`.
2018-09-04 09:05:27 -07:00
Dave Bartolomeo
aa4436fa22 C++: More IR reshuffling
Remove redundant "_ir" suffix.
Move non-user-importable modules into "implementation" directory.
2018-09-04 09:05:21 -07:00
Dave Bartolomeo
97cfbd9488 C++: "IR" means "Aliased SSA IR"
This change makes the public IR.qll module resolve to the flavor of the IR that we want queries to use. Today, this is the aliased SSA flavor of the IR. Should we add additional IR iterations in the future, we'll update IR.qll to resolve to whichever one we consider the default.

I moved the PrintIR.ql and IRSanity.ql queries into the internal directories of the corresponding flavors. There's still a PrintIR.ql and an IRSanity.ql in the public IR directory, which use the same IR flavor as the public IR.qll.
2018-09-04 09:05:15 -07:00
Dave Bartolomeo
9fd5f26e2e C++: Remove unnecessary Impl suffix from some files 2018-09-04 09:05:10 -07:00
Dave Bartolomeo
aacee8fecf C++: Reshuffle IR files into a consistent directory structure
There are no real code changes here, other than to fix up `import`s. All tests still hae the same output, as expected.

A future commit will hide the IR flavors other than the one we want queries to use directly.
2018-09-04 09:05:03 -07:00
Asger F
4e9c52a3c3 TypeScript: add change note 2018-09-04 15:20:16 +01:00
Tom Hvitved
6a4dbfce8f Address review comment 2018-09-04 16:07:49 +02:00
Asger F
6ceb10371a TypeScript: rephrase change note 2018-09-04 15:06:04 +01:00
Tom Hvitved
919203a071 Address review comment 2018-09-04 16:04:21 +02:00
Max Schaefer
fdc20e830a Merge pull request #153 from asger-semmle/ts-typescript3.0-changenote
TypeScript: update change note to mention TypeScript 3.0 support
2018-09-04 14:45:29 +01:00
Asger F
f7827b72ab TypeScript: update change note to mention TypeScript 3.0 support 2018-09-04 14:30:16 +01:00
semmle-qlci
3cdaed2e3e Merge pull request #141 from jbj/ql-warnings-1.18
Approved by ian-semmle
2018-09-04 14:27:18 +01:00
Asger F
2b8bc63b01 TypeScript: add change note 2018-09-04 14:23:37 +01:00
Tom Hvitved
9a7746e9b5 C#: Fix bug in BaseSsa library 2018-09-04 15:16:20 +02:00