Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db33dad

Browse filesBrowse files
committed
C++: Add QLDoc. Also actually implement 'uninitializedNode' since there's no reason not to do so.
1 parent 1139059 commit db33dad
Copy full SHA for db33dad

2 files changed

+26-3Lines changed: 26 additions & 3 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll‎

Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll
+21-3Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -926,19 +926,25 @@ module Public {
926926
}
927927

928928
/**
929-
* DEPRECATED: See UninitializedNode.
930-
*
931929
* Gets the `Node` corresponding to the value of an uninitialized local
932930
* variable `v`.
933931
*/
934-
Node uninitializedNode(LocalVariable v) { none() }
932+
Node uninitializedNode(LocalVariable v) { result.asUninitialized() = v }
935933

934+
/**
935+
* Holds if `indirectOperand` is the dataflow node that represents the
936+
* indirection of `operand` with indirection index `indirectionIndex`.
937+
*/
936938
predicate hasOperandAndIndex(
937939
IndirectOperand indirectOperand, Operand operand, int indirectionIndex
938940
) {
939941
indirectOperand.hasOperandAndIndirectionIndex(operand, indirectionIndex)
940942
}
941943

944+
/**
945+
* Holds if `indirectInstr` is the dataflow node that represents the
946+
* indirection of `instr` with indirection index `indirectionIndex`.
947+
*/
942948
predicate hasInstructionAndIndex(
943949
IndirectInstruction indirectInstr, Instruction instr, int indirectionIndex
944950
) {
@@ -1054,12 +1060,24 @@ abstract private class PartialDefinitionNode extends PostUpdateNode {
10541060
class IndirectArgumentOutNode extends PostUpdateNodeImpl {
10551061
override ArgumentOperand operand;
10561062

1063+
/**
1064+
* Gets the index of the argument that is associated with this post-
1065+
* update node.
1066+
*/
10571067
int getArgumentIndex() {
10581068
exists(CallInstruction call | call.getArgumentOperand(result) = operand)
10591069
}
10601070

1071+
/**
1072+
* Gets the `Operand` that represents the address of the value that is being
1073+
* updated.
1074+
*/
10611075
Operand getAddressOperand() { result = operand }
10621076

1077+
/**
1078+
* Gets the `CallInstruction` that represents the call that updated the
1079+
* argument.
1080+
*/
10631081
CallInstruction getCallInstruction() { result.getAnArgumentOperand() = operand }
10641082

10651083
/**
Collapse file

‎cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/TaintTrackingUtil.qll‎

Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/TaintTrackingUtil.qll
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ cached
1414
private module Cached {
1515
private import DataFlowImplCommon as DataFlowImplCommon
1616

17+
/**
18+
* This predicate exists to collapse the `cached` predicates in this module with the
19+
* `cached` predicates in other C/C++ dataflow files, which is then collapsed
20+
* with the `cached` predicates in `DataFlowImplCommon.qll`.
21+
*/
1722
cached
1823
predicate forceCachingInSameStage() { DataFlowImplCommon::forceCachingInSameStage() }
1924

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.