@@ -10,7 +10,7 @@ private newtype TNode =
10
10
MkInstructionNode ( IR:: Instruction insn ) or
11
11
MkSsaNode ( SsaDefinition ssa ) or
12
12
MkGlobalFunctionNode ( Function f ) or
13
- MkImplicitVarargsSlice ( CallExpr c ) { c .getTarget ( ) . isVariadic ( ) and not c . hasEllipsis ( ) } or
13
+ MkImplicitVarargsSlice ( CallExpr c ) { c .hasImplicitVarargs ( ) } or
14
14
MkSummarizedParameterNode ( SummarizedCallable c , int i ) {
15
15
FlowSummaryImpl:: Private:: summaryParameterNodeRange ( c , i )
16
16
} or
@@ -572,13 +572,9 @@ module Public {
572
572
* predicate `getArgument` on `CallExpr`, which gets the syntactic arguments.
573
573
*/
574
574
Node getArgument ( int i ) {
575
- exists ( SignatureType t , int lastParamIndex |
576
- t = this .getACalleeIncludingExternals ( ) .getType ( ) and
577
- lastParamIndex = t .getNumParameter ( ) - 1
578
- |
575
+ exists ( int lastParamIndex | lastParamIndex = expr .getCalleeType ( ) .getNumParameter ( ) - 1 |
579
576
if
580
- not this .hasEllipsis ( ) and
581
- t .isVariadic ( ) and
577
+ expr .hasImplicitVarargs ( ) and
582
578
i >= lastParamIndex
583
579
then
584
580
result .( ImplicitVarargsSlice ) .getCallNode ( ) = this and
@@ -598,11 +594,10 @@ module Public {
598
594
* the varargs parameter of the target of this call (if there is one).
599
595
*/
600
596
Node getImplicitVarargsArgument ( int i ) {
601
- not this .hasEllipsis ( ) and
602
597
i >= 0 and
603
- exists ( Function f | f = this . getTarget ( ) |
604
- f . isVariadic ( ) and
605
- result = this .getSyntacticArgument ( f . getNumParameter ( ) - 1 + i )
598
+ expr . hasImplicitVarargs ( ) and
599
+ exists ( int lastParamIndex | lastParamIndex = expr . getCalleeType ( ) . getNumParameter ( ) - 1 |
600
+ result = this .getSyntacticArgument ( lastParamIndex + i )
606
601
)
607
602
}
608
603
0 commit comments