@@ -32,19 +32,19 @@ class AttributeFormattingFunction extends FormattingFunction {
3232 * A standard function such as `vprintf` that has a format parameter
3333 * and a variable argument list of type `va_arg`.
3434 */
35- predicate primitiveVariadicFormatter ( TopLevelFunction f , int formatParamIndex , boolean wide ) {
35+ predicate primitiveVariadicFormatter ( TopLevelFunction f , int formatParamIndex ) {
3636 f .getName ( ) .regexpMatch ( "_?_?va?[fs]?n?w?printf(_s)?(_p)?(_l)?" )
3737 and (
3838 if f .getName ( ) .matches ( "%\\_l" )
3939 then formatParamIndex = f .getNumberOfParameters ( ) - 3
4040 else formatParamIndex = f .getNumberOfParameters ( ) - 2
41- ) and if f . getName ( ) . matches ( "%w%" ) then wide = true else wide = false
41+ )
4242}
4343
4444private
45- predicate callsVariadicFormatter ( Function f , int formatParamIndex , boolean wide ) {
45+ predicate callsVariadicFormatter ( Function f , int formatParamIndex ) {
4646 exists ( FunctionCall fc , int i |
47- variadicFormatter ( fc .getTarget ( ) , i , wide )
47+ variadicFormatter ( fc .getTarget ( ) , i )
4848 and fc .getEnclosingFunction ( ) = f
4949 and fc .getArgument ( i ) = f .getParameter ( formatParamIndex ) .getAnAccess ( )
5050 )
@@ -54,11 +54,11 @@ predicate callsVariadicFormatter(Function f, int formatParamIndex, boolean wide)
5454 * Holds if `f` is a function such as `vprintf` that has a format parameter
5555 * (at `formatParamIndex`) and a variable argument list of type `va_arg`.
5656 */
57- predicate variadicFormatter ( Function f , int formatParamIndex , boolean wide ) {
58- primitiveVariadicFormatter ( f , formatParamIndex , wide )
57+ predicate variadicFormatter ( Function f , int formatParamIndex ) {
58+ primitiveVariadicFormatter ( f , formatParamIndex )
5959 or (
6060 not f .isVarargs ( )
61- and callsVariadicFormatter ( f , formatParamIndex , wide )
61+ and callsVariadicFormatter ( f , formatParamIndex )
6262 )
6363}
6464
@@ -68,12 +68,10 @@ predicate variadicFormatter(Function f, int formatParamIndex, boolean wide) {
6868 */
6969class UserDefinedFormattingFunction extends FormattingFunction {
7070 UserDefinedFormattingFunction ( ) {
71- isVarargs ( ) and callsVariadicFormatter ( this , _, _ )
71+ isVarargs ( ) and callsVariadicFormatter ( this , _)
7272 }
7373
74- override int getFormatParameterIndex ( ) { callsVariadicFormatter ( this , result , _) }
75-
76- override predicate isWideCharDefault ( ) { callsVariadicFormatter ( this , _, true ) }
74+ override int getFormatParameterIndex ( ) { callsVariadicFormatter ( this , result ) }
7775}
7876
7977/**
0 commit comments