There was an error while loading. Please reload this page.
2 parents 19f238a + bfa4c30 commit 4939db1Copy full SHA for 4939db1
1 file changed
cpp/ql/src/semmle/code/cpp/controlflow/internal/ConstantExprs.qll
@@ -419,12 +419,17 @@ library class ExprEvaluator extends int {
419
)
420
}
421
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
+
429
private int getFunctionValue(Function f) {
- interestingFunction(_, f)
- and
430
// All returns must have the same int value
431
// And it must have at least one return
- forex(Expr ret | returnStmt(f, ret) | result = getValueInternalNonSubExpr(ret))
432
+ forex(Expr ret | interestingReturnValue(f, ret) | result = getValueInternalNonSubExpr(ret))
433
434
435
/**
0 commit comments