mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
Merge pull request #495 from geoffw0/returnvalue
CPP: Fix 'Missing return statement'
This commit is contained in:
@@ -38,6 +38,8 @@ predicate functionImperfectlyExtracted(Function f) {
|
||||
exists(CompilerError e | f.getBlock().getLocation().subsumes(e.getLocation()))
|
||||
or
|
||||
exists(ErrorExpr ee | ee.getEnclosingFunction() = f)
|
||||
or
|
||||
count(f.getType()) > 1
|
||||
}
|
||||
|
||||
from Stmt stmt, string msg, Function f, ControlFlowNode blame
|
||||
|
||||
@@ -84,3 +84,13 @@ int f12(int x)
|
||||
// ...
|
||||
}
|
||||
}
|
||||
|
||||
void f13()
|
||||
{
|
||||
f13_func(); // implicitly declared here
|
||||
}
|
||||
|
||||
void f13_func(int x)
|
||||
{
|
||||
if (x < 10) return; // GOOD
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user