Skip to content

Commit 8b17a38

Browse files
committed
C++: Add QLDoc. Also actually implement 'uninitializedNode' since there's no reason not to do so.
1 parent 1139059 commit 8b17a38

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

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

Lines 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
/**

0 commit comments

Comments
 (0)