File tree Expand file tree Collapse file tree 3 files changed +15
-15
lines changed
cpp/ql/src/Likely Bugs/Underspecified Functions Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -84,18 +84,18 @@ predicate hasZeroParamDecl(Function f) {
8484}
8585
8686// True if this file (or header) was compiled as a C file
87- predicate isCompiledAsC ( Function f ) {
88- exists ( File file | file .compiledAsC ( ) |
89- file = f . getFile ( ) or file . getAnIncludedFile + ( ) = f . getFile ( )
90- )
87+ predicate isCompiledAsC ( File f ) {
88+ f .compiledAsC ( )
89+ or
90+ exists ( File src | isCompiledAsC ( src ) | src . getAnIncludedFile ( ) = f )
9191}
9292
9393from FunctionCall fc , Function f , Parameter p
9494where
9595 f = fc .getTarget ( ) and
9696 p = f .getAParameter ( ) and
9797 hasZeroParamDecl ( f ) and
98- isCompiledAsC ( f ) and
98+ isCompiledAsC ( f . getFile ( ) ) and
9999 not f .isVarargs ( ) and
100100 not f instanceof BuiltInFunction and
101101 p .getIndex ( ) < fc .getNumberOfArguments ( ) and
Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ predicate hasZeroParamDecl(Function f) {
2424}
2525
2626// True if this file (or header) was compiled as a C file
27- predicate isCompiledAsC ( Function f ) {
28- exists ( File file | file .compiledAsC ( ) |
29- file = f . getFile ( ) or file . getAnIncludedFile + ( ) = f . getFile ( )
30- )
27+ predicate isCompiledAsC ( File f ) {
28+ f .compiledAsC ( )
29+ or
30+ exists ( File src | isCompiledAsC ( src ) | src . getAnIncludedFile ( ) = f )
3131}
3232
3333from FunctionCall fc , Function f
3636 not f .isVarargs ( ) and
3737 not f instanceof BuiltInFunction and
3838 hasZeroParamDecl ( f ) and
39- isCompiledAsC ( f ) and
39+ isCompiledAsC ( f . getFile ( ) ) and
4040 // There is an explicit declaration of the function whose parameter count is larger
4141 // than the number of call arguments
4242 exists ( FunctionDeclarationEntry fde | fde = f .getADeclarationEntry ( ) |
Original file line number Diff line number Diff line change @@ -25,18 +25,18 @@ predicate hasZeroParamDecl(Function f) {
2525}
2626
2727// True if this file (or header) was compiled as a C file
28- predicate isCompiledAsC ( Function f ) {
29- exists ( File file | file .compiledAsC ( ) |
30- file = f . getFile ( ) or file . getAnIncludedFile + ( ) = f . getFile ( )
31- )
28+ predicate isCompiledAsC ( File f ) {
29+ f .compiledAsC ( )
30+ or
31+ exists ( File src | isCompiledAsC ( src ) | src . getAnIncludedFile ( ) = f )
3232}
3333
3434from FunctionCall fc , Function f
3535where
3636 f = fc .getTarget ( ) and
3737 not f .isVarargs ( ) and
3838 hasZeroParamDecl ( f ) and
39- isCompiledAsC ( f ) and
39+ isCompiledAsC ( f . getFile ( ) ) and
4040 exists ( f .getBlock ( ) ) and
4141 // There must not exist a declaration with the number of parameters
4242 // at least as large as the number of call arguments
You can’t perform that action at this time.
0 commit comments