66 * @problem.severity warning
77 * @precision medium
88 * @tags correctness
9+ * maintainability
910 * security
1011 * external/cwe/cwe-1041
1112 */
@@ -48,7 +49,7 @@ predicate conditionsOutsideWrapper(FunctionCall fcp) {
4849 not exists ( ExprCall ectmp | fcp = ectmp .getAnArgument ( ) .getAChild * ( ) )
4950}
5051
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. */
5253pragma [ inline]
5354predicate conditionsInsideWrapper ( FunctionCall fcp , Function fnp ) {
5455 not exists ( FunctionCall fctmp2 |
@@ -60,7 +61,7 @@ predicate conditionsInsideWrapper(FunctionCall fcp, Function fnp) {
6061 fnp .getNumberOfParameters ( ) > 0 and
6162 // the call arguments must be passed through the arguments of the wrapper function
6263 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 ( ) )
6465 ) and
6566 // there should be no more than one required call inside the wrapper function
6667 not exists ( FunctionCall fctmp |
@@ -119,8 +120,8 @@ predicate conditionsForWrapper(FunctionCall fcp, Function fnp) {
119120 forall ( int i | i in [ 0 .. fnp .getNumberOfParameters ( ) - 1 ] |
120121 fnp .getParameter ( i ) .getAnAccess ( ) .getTarget ( ) =
121122 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
124125 fnp .getParameter ( i ) .getAnAccess ( ) .getTarget ( ) =
125126 fctmp .getAnArgument ( ) .( VariableAccess ) .getTarget ( )
126127 )
0 commit comments