File tree Expand file tree Collapse file tree 2 files changed +8
-20
lines changed
cpp/ql/src/semmle/code/cpp/ir/dataflow/internal Expand file tree Collapse file tree 2 files changed +8
-20
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,7 @@ private class PrimaryArgumentNode extends ArgumentNode {
2929 PrimaryArgumentNode ( ) { exists ( CallInstruction call | op = call .getAnArgumentOperand ( ) ) }
3030
3131 override predicate argumentOf ( DataFlowCall call , int pos ) {
32- op = call .getPositionalArgumentOperand ( pos )
33- or
34- op = call .getThisArgumentOperand ( ) and pos = - 1
32+ op = call .getPositionalOrThisArgumentOperand ( pos )
3533 }
3634
3735 override string toString ( ) {
@@ -110,10 +108,10 @@ class ReturnIndirectionNode extends ReturnNode {
110108 override ReturnIndirectionInstruction primary ;
111109
112110 override ReturnKind getKind ( ) {
113- result = TIndirectReturnKind ( - 1 ) and
114- primary .isThisIndirection ( )
115- or
116- result = TIndirectReturnKind ( primary . getParameter ( ) . getIndex ( ) )
111+ exists ( int index |
112+ primary .isParameterOrThisIndirection ( index ) and
113+ result = TIndirectReturnKind ( index )
114+ )
117115 }
118116}
119117
Original file line number Diff line number Diff line change @@ -266,10 +266,8 @@ class ParameterIndirectionNode extends ParameterNode {
266266
267267 override predicate isParameterOf ( Function f , int pos ) {
268268 exists ( int index |
269- f .getParameter ( index ) = instr .getParameter ( )
270- or
271- index = - 1 and
272- instr .getIRVariable ( ) .( IRThisVariable ) .getEnclosingFunction ( ) = f
269+ instr .getEnclosingFunction ( ) = f and
270+ instr .isParameterOrQualifierIndex ( index )
273271 |
274272 pos = getArgumentPosOfSideEffect ( index )
275273 )
@@ -476,16 +474,8 @@ class DefinitionByReferenceNode extends InstructionNode {
476474 instr
477475 .getPrimaryInstruction ( )
478476 .( CallInstruction )
479- .getPositionalArgument ( instr .getIndex ( ) )
477+ .getPositionalOrThisArgument ( instr .getIndex ( ) )
480478 .getUnconvertedResultExpression ( )
481- or
482- result =
483- instr
484- .getPrimaryInstruction ( )
485- .( CallInstruction )
486- .getThisArgument ( )
487- .getUnconvertedResultExpression ( ) and
488- instr .getIndex ( ) = - 1
489479 }
490480
491481 /** Gets the parameter through which this value is assigned. */
You can’t perform that action at this time.
0 commit comments