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:
Jeroen Ketema
2024-10-31 16:16:03 +01:00
committed by GitHub
5 changed files with 18 additions and 0 deletions

View File

@@ -196,6 +196,8 @@ private predicate isInvalidFunction(Function func) {
expr.getEnclosingFunction() = func and
not exists(expr.getType())
)
or
count(func.getEntryPoint().getLocation()) > 1
}
/**

View File

@@ -0,0 +1,6 @@
/**
* @kind graph
*/
private import cpp
private import semmle.code.cpp.ir.implementation.raw.PrintIR

View File

@@ -0,0 +1,7 @@
int foo(int i);
int foo(int i) {
return 42;
}
int bar();

View File

@@ -0,0 +1,3 @@
int foo(int i) {
return i;
}