File tree Expand file tree Collapse file tree
cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -443,7 +443,7 @@ newtype TPosition =
443443private 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
Original file line number Diff line number Diff 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`
Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ private module SourceVariables {
7070
7171import 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+ */
7378predicate hasIndirectOperand ( Operand op , int indirectionIndex ) {
7479 exists ( CppType type , int m |
7580 not ignoreOperand ( op ) and
You can’t perform that action at this time.
0 commit comments