@@ -52,13 +52,13 @@ private predicate formattingFunctionCallAlternateType(
5252
5353/**
5454 * Holds if the argument corresponding to the `pos` conversion specifier
55- * of `ffc` is expected to have type `expected` and the corresponding
56- * argument `arg` has type `actual`.
55+ * of `ffc` is `arg` and has type `actual`.
5756 */
5857pragma [ noopt]
59- predicate formatArgType ( FormattingFunctionCall ffc , int pos , Type expected , Expr arg , Type actual ) {
58+ predicate formattingFunctionCallActualType (
59+ FormattingFunctionCall ffc , int pos , Expr arg , Type actual
60+ ) {
6061 exists ( Expr argConverted |
61- formattingFunctionCallExpectedType ( ffc , pos , expected ) and
6262 ffc .getConversionArgument ( pos ) = arg and
6363 argConverted = arg .getFullyConverted ( ) and
6464 actual = argConverted .getType ( )
@@ -90,7 +90,7 @@ class ExpectedType extends Type {
9090 ExpectedType ( ) {
9191 exists ( Type t |
9292 (
93- formatArgType ( _, _, t , _ , _ ) or
93+ formattingFunctionCallExpectedType ( _, _, t ) or
9494 formattingFunctionCallAlternateType ( _, _, t ) or
9595 formatOtherArgType ( _, _, t , _, _)
9696 ) and
@@ -111,10 +111,10 @@ class ExpectedType extends Type {
111111predicate trivialConversion ( ExpectedType expected , Type actual ) {
112112 exists ( Type exp , Type act |
113113 (
114- formatArgType ( _, _, exp , _ , _ ) or
114+ formattingFunctionCallExpectedType ( _, _, exp ) or
115115 formattingFunctionCallAlternateType ( _, _, exp )
116116 ) and
117- formatArgType ( _ , _, _, _, act ) and
117+ formattingFunctionCallActualType ( _, _, _, act ) and
118118 expected = exp .getUnspecifiedType ( ) and
119119 actual = act .getUnspecifiedType ( )
120120 ) and
@@ -169,10 +169,11 @@ int sizeof_IntType() { exists(IntType it | result = it.getSize()) }
169169from FormattingFunctionCall ffc , int n , Expr arg , Type expected , Type actual
170170where
171171 (
172- formatArgType ( ffc , n , expected , arg , actual ) and
172+ formattingFunctionCallExpectedType ( ffc , n , expected ) and
173+ formattingFunctionCallActualType ( ffc , n , arg , actual ) and
173174 not exists ( Type anyExpected |
174175 (
175- formatArgType ( ffc , n , anyExpected , arg , actual ) or
176+ formattingFunctionCallExpectedType ( ffc , n , anyExpected ) or
176177 formattingFunctionCallAlternateType ( ffc , n , anyExpected )
177178 ) and
178179 trivialConversion ( anyExpected .getUnspecifiedType ( ) , actual .getUnspecifiedType ( ) )
0 commit comments