Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5caa49a

Browse files
committed
C++: Remove unused case for now, and add QLDoc.
1 parent 2bea0ad commit 5caa49a

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ newtype TPosition =
443443
private newtype TReturnKind =
444444
TNormalReturnKind(int indirectionIndex) {
445445
Ssa::hasIndirectOperand(any(ReturnValueInstruction ret).getReturnAddressOperand(),
446-
indirectionIndex + 1) // We subtract one because the return loads the value.
446+
indirectionIndex + 1) // `indirectionIndex` is one less than the argument because the return loads the value.
447447
or
448448
indirectionIndex = 0 // TODO: very much a bodge so that it works on the test that has no return statements
449449
} or

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ private newtype TIRDataFlowNode =
5656
hasFinalParameterNode(_, p, indirectionIndex)
5757
} or
5858
TFinalGlobalValue(Ssa::GlobalUse globalUse) or
59-
TInitialGlobalValue(Ssa::GlobalDef globalUse) or
60-
FlowSummaryNode(FlowSummaryImpl::Private::SummaryNode sn)
59+
TInitialGlobalValue(Ssa::GlobalDef globalUse)
6160

6261
/**
6362
* Holds if `(p, indirectionIndex)` should define a `TFinalParameterNode`

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ private module SourceVariables {
7070

7171
import SourceVariables
7272

73+
/**
74+
* Holds if `indirectionIndex` is a valid non-zero indirection index for
75+
* operand `op`. That is, `indirectionIndex` is between 1 and the maximum
76+
* indirection for the operand's type.
77+
*/
7378
predicate hasIndirectOperand(Operand op, int indirectionIndex) {
7479
exists(CppType type, int m |
7580
not ignoreOperand(op) and

0 commit comments

Comments
 (0)