File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
cpp/ql/src/utils/modelgenerator/internal Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ private import semmle.code.cpp.ir.dataflow.internal.TaintTrackingImplSpecific
1313private import semmle.code.cpp.dataflow.new.TaintTracking as Tt
1414private import semmle.code.cpp.dataflow.new.DataFlow as Df
1515private import codeql.mad.modelgenerator.internal.ModelGeneratorImpl
16+ private import semmle.code.cpp.models.interfaces.Taint as Taint
17+ private import semmle.code.cpp.models.interfaces.DataFlow as DataFlow
1618
1719/**
1820 * Holds if `f` is a "private" function.
@@ -45,6 +47,19 @@ private predicate isUninterestingForModels(Callable api) {
4547 api = any ( Cpp:: LambdaExpression lambda ) .getLambdaFunction ( )
4648 or
4749 api .isFromUninstantiatedTemplate ( _)
50+ or
51+ // No need to generate models for functions modeled by hand in QL
52+ api instanceof Taint:: TaintFunction
53+ or
54+ api instanceof DataFlow:: DataFlowFunction
55+ or
56+ // Don't generate models for main functions
57+ api .hasGlobalName ( "main" )
58+ or
59+ // Don't generate models for system-provided functions. If we want to
60+ // generate models for these we should use a database containing the
61+ // implementations of those system-provided functions in the source root.
62+ not exists ( api .getLocation ( ) .getFile ( ) .getRelativePath ( ) )
4863}
4964
5065private predicate relevant ( Callable api ) {
You can’t perform that action at this time.
0 commit comments