@@ -52,13 +52,13 @@ private predicate formattingFunctionCallAlternateType(
52
52
53
53
/**
54
54
* 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`.
57
56
*/
58
57
pragma [ 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
+ ) {
60
61
exists ( Expr argConverted |
61
- formattingFunctionCallExpectedType ( ffc , pos , expected ) and
62
62
ffc .getConversionArgument ( pos ) = arg and
63
63
argConverted = arg .getFullyConverted ( ) and
64
64
actual = argConverted .getType ( )
@@ -90,7 +90,7 @@ class ExpectedType extends Type {
90
90
ExpectedType ( ) {
91
91
exists ( Type t |
92
92
(
93
- formatArgType ( _, _, t , _ , _ ) or
93
+ formattingFunctionCallExpectedType ( _, _, t ) or
94
94
formattingFunctionCallAlternateType ( _, _, t ) or
95
95
formatOtherArgType ( _, _, t , _, _)
96
96
) and
@@ -111,10 +111,10 @@ class ExpectedType extends Type {
111
111
predicate trivialConversion ( ExpectedType expected , Type actual ) {
112
112
exists ( Type exp , Type act |
113
113
(
114
- formatArgType ( _, _, exp , _ , _ ) or
114
+ formattingFunctionCallExpectedType ( _, _, exp ) or
115
115
formattingFunctionCallAlternateType ( _, _, exp )
116
116
) and
117
- formatArgType ( _ , _, _, _, act ) and
117
+ formattingFunctionCallActualType ( _, _, _, act ) and
118
118
expected = exp .getUnspecifiedType ( ) and
119
119
actual = act .getUnspecifiedType ( )
120
120
) and
@@ -169,10 +169,11 @@ int sizeof_IntType() { exists(IntType it | result = it.getSize()) }
169
169
from FormattingFunctionCall ffc , int n , Expr arg , Type expected , Type actual
170
170
where
171
171
(
172
- formatArgType ( ffc , n , expected , arg , actual ) and
172
+ formattingFunctionCallExpectedType ( ffc , n , expected ) and
173
+ formattingFunctionCallActualType ( ffc , n , arg , actual ) and
173
174
not exists ( Type anyExpected |
174
175
(
175
- formatArgType ( ffc , n , anyExpected , arg , actual ) or
176
+ formattingFunctionCallExpectedType ( ffc , n , anyExpected ) or
176
177
formattingFunctionCallAlternateType ( ffc , n , anyExpected )
177
178
) and
178
179
trivialConversion ( anyExpected .getUnspecifiedType ( ) , actual .getUnspecifiedType ( ) )
0 commit comments