From 56efff99bdb6d55e26de8e5501f979559df813d5 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 8 Oct 2024 16:11:27 +0200 Subject: [PATCH] C++: Do not generate IR for functions with multiple entry points in different locations --- .../ir/implementation/raw/internal/TranslatedElement.qll | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll index 0f9bc370f7a50..abbbb22c9f034 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll @@ -196,6 +196,12 @@ private predicate isInvalidFunction(Function func) { expr.getEnclosingFunction() = func and not exists(expr.getType()) ) + or + exists(Location l1, Location l2 | + l1 = func.getEntryPoint().getLocation() and l2 = func.getEntryPoint().getLocation() + | + l1 != l2 + ) } /**