mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
C++: Only create variables in FunctionIRs
The previous commit had the side effect that `IRVariable`s were created for all `Functions`, including those that did not have IR. This commit restricts all `TIRVariable` constructors to functions that have IR.
This commit is contained in:
@@ -4,10 +4,12 @@ private import semmle.code.cpp.ir.implementation.raw.internal.IRConstruction as
|
||||
|
||||
newtype TIRVariable =
|
||||
TIRAutomaticUserVariable(LocalScopeVariable var, Function func) {
|
||||
Construction::functionHasIR(func) and
|
||||
var.getFunction() = func or
|
||||
var.(Parameter).getCatchBlock().getEnclosingFunction() = func
|
||||
} or
|
||||
TIRStaticUserVariable(Variable var, Function func) {
|
||||
Construction::functionHasIR(func) and
|
||||
(
|
||||
var instanceof GlobalOrNamespaceVariable or
|
||||
var instanceof MemberVariable and not var instanceof Field
|
||||
|
||||
Reference in New Issue
Block a user