File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
cpp/ql/src/semmle/code/cpp/controlflow/internal Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -419,12 +419,17 @@ library class ExprEvaluator extends int {
419419 )
420420 }
421421
422+ /** Holds if the function `f` is considered by the analysis and may return `ret`. */
423+ pragma [ noinline]
424+ private predicate interestingReturnValue ( Function f , Expr ret ) {
425+ interestingFunction ( _, f ) and
426+ returnStmt ( f , ret )
427+ }
428+
422429 private int getFunctionValue ( Function f ) {
423- interestingFunction ( _, f )
424- and
425430 // All returns must have the same int value
426431 // And it must have at least one return
427- forex ( Expr ret | returnStmt ( f , ret ) | result = getValueInternalNonSubExpr ( ret ) )
432+ forex ( Expr ret | interestingReturnValue ( f , ret ) | result = getValueInternalNonSubExpr ( ret ) )
428433 }
429434
430435 /**
You can’t perform that action at this time.
0 commit comments