@@ -2,13 +2,6 @@ import semmle.code.cpp.exprs.Expr
2
2
import semmle.code.cpp.Function
3
3
private import semmle.code.cpp.dataflow.EscapesTree
4
4
5
- /**
6
- * Gets the index of the `...` parameter, if any.
7
- */
8
- private int getEllipsisParameterIndex ( RoutineType type ) {
9
- type .getParameterType ( result ) instanceof UnknownType
10
- }
11
-
12
5
/**
13
6
* A C/C++ call.
14
7
*
@@ -85,32 +78,6 @@ abstract class Call extends Expr, NameQualifiableElement {
85
78
86
79
override string toString ( ) { none ( ) }
87
80
88
- /**
89
- * Gets the index of the `...` parameter, if any. This will be one greater than the index of the
90
- * last declared positional parameter.
91
- */
92
- abstract int getEllipsisParameterIndex ( ) ;
93
-
94
- /**
95
- * Gets the index of the parameter that will be initialized with the value of the argument
96
- * specified by `argIndex`. For ordinary positional parameters, the argument and parameter indices
97
- * will be equal. For a call to a varargs function, all arguments passed to the `...` will be
98
- * mapped to the index returned by `getEllipsisParameterIndex()`.
99
- */
100
- final int getParameterIndexForArgument ( int argIndex ) {
101
- exists ( getArgument ( argIndex ) ) and
102
- if argIndex >= getEllipsisParameterIndex ( )
103
- then result = getEllipsisParameterIndex ( )
104
- else result = argIndex
105
- }
106
-
107
- /**
108
- * Holds if the argument specified by `index` is an argument to the `...` of a varargs function.
109
- */
110
- final predicate isEllipsisArgumentIndex ( int index ) {
111
- exists ( getArgument ( index ) ) and index >= getEllipsisParameterIndex ( )
112
- }
113
-
114
81
/**
115
82
* Holds if this call passes the variable accessed by `va` by
116
83
* reference as the `i`th argument.
@@ -229,7 +196,7 @@ class FunctionCall extends Call, @funbindexpr {
229
196
* constructor calls, this predicate instead gets the `Class` of the constructor
230
197
* being called.
231
198
*/
232
- private Type getTargetType ( ) { result = Call .super .getType ( ) .stripType ( ) }
199
+ Type getTargetType ( ) { result = Call .super .getType ( ) .stripType ( ) }
233
200
234
201
/**
235
202
* Gets the expected return type of the function called by this call.
@@ -292,12 +259,6 @@ class FunctionCall extends Call, @funbindexpr {
292
259
else result = "call to unknown function"
293
260
}
294
261
295
- final override int getEllipsisParameterIndex ( ) {
296
- if getTargetType ( ) instanceof RoutineType
297
- then result = getEllipsisParameterIndex ( getTargetType ( ) )
298
- else result = getTarget ( ) .getEllipsisParameterIndex ( )
299
- }
300
-
301
262
override predicate mayBeImpure ( ) {
302
263
this .getChild ( _) .mayBeImpure ( ) or
303
264
this .getTarget ( ) .mayHaveSideEffects ( ) or
@@ -417,10 +378,6 @@ class ExprCall extends Call, @callexpr {
417
378
override string toString ( ) { result = "call to expression" }
418
379
419
380
override Function getTarget ( ) { none ( ) }
420
-
421
- final override int getEllipsisParameterIndex ( ) {
422
- result = getEllipsisParameterIndex ( getExpr ( ) .getType ( ) .stripType ( ) )
423
- }
424
381
}
425
382
426
383
/**
0 commit comments