6
6
* @problem.severity warning
7
7
* @precision medium
8
8
* @tags correctness
9
+ * maintainability
9
10
* security
10
11
* external/cwe/cwe-1041
11
12
*/
@@ -48,7 +49,7 @@ predicate conditionsOutsideWrapper(FunctionCall fcp) {
48
49
not exists ( ExprCall ectmp | fcp = ectmp .getAnArgument ( ) .getAChild * ( ) )
49
50
}
50
51
51
- /** Holds if the conditions for a call within the wrapper function are met. */
52
+ /** Held if the conditions for calling `fcp` inside the `fnp` wrapper function are met. */
52
53
pragma [ inline]
53
54
predicate conditionsInsideWrapper ( FunctionCall fcp , Function fnp ) {
54
55
not exists ( FunctionCall fctmp2 |
@@ -60,7 +61,7 @@ predicate conditionsInsideWrapper(FunctionCall fcp, Function fnp) {
60
61
fnp .getNumberOfParameters ( ) > 0 and
61
62
// the call arguments must be passed through the arguments of the wrapper function
62
63
forall ( int i | i in [ 0 .. fcp .getNumberOfArguments ( ) - 1 ] |
63
- fcp .getArgument ( i ) . ( VariableAccess ) . getTarget ( ) = fnp .getAParameter ( ) .getAnAccess ( ) . getTarget ( )
64
+ globalValueNumber ( fcp .getArgument ( i ) ) = globalValueNumber ( fnp .getAParameter ( ) .getAnAccess ( ) )
64
65
) and
65
66
// there should be no more than one required call inside the wrapper function
66
67
not exists ( FunctionCall fctmp |
@@ -119,8 +120,8 @@ predicate conditionsForWrapper(FunctionCall fcp, Function fnp) {
119
120
forall ( int i | i in [ 0 .. fnp .getNumberOfParameters ( ) - 1 ] |
120
121
fnp .getParameter ( i ) .getAnAccess ( ) .getTarget ( ) =
121
122
fcp .getAnArgument ( ) .( VariableAccess ) .getTarget ( ) or
122
- fnp .getParameter ( i ) .getType ( ) instanceof Class or
123
- fnp .getParameter ( i ) .getType ( ) .( ReferenceType ) .getBaseType ( ) instanceof Class or
123
+ fnp .getParameter ( i ) .getUnspecifiedType ( ) instanceof Class or
124
+ fnp .getParameter ( i ) .getUnspecifiedType ( ) .( ReferenceType ) .getBaseType ( ) instanceof Class or
124
125
fnp .getParameter ( i ) .getAnAccess ( ) .getTarget ( ) =
125
126
fctmp .getAnArgument ( ) .( VariableAccess ) .getTarget ( )
126
127
)
0 commit comments