mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #17694 from jketema/multiple-entry-point
C++: Do not generate IR for functions with multiple entry points
This commit is contained in:
@@ -196,6 +196,8 @@ private predicate isInvalidFunction(Function func) {
|
|||||||
expr.getEnclosingFunction() = func and
|
expr.getEnclosingFunction() = func and
|
||||||
not exists(expr.getType())
|
not exists(expr.getType())
|
||||||
)
|
)
|
||||||
|
or
|
||||||
|
count(func.getEntryPoint().getLocation()) > 1
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/**
|
||||||
|
* @kind graph
|
||||||
|
*/
|
||||||
|
|
||||||
|
private import cpp
|
||||||
|
private import semmle.code.cpp.ir.implementation.raw.PrintIR
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
int foo(int i);
|
||||||
|
|
||||||
|
int foo(int i) {
|
||||||
|
return 42;
|
||||||
|
}
|
||||||
|
|
||||||
|
int bar();
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
int foo(int i) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user