mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
CPP: Fix over-enthusiastic dataflow in allocExprOrIndirect.
This commit is contained in:
@@ -46,7 +46,11 @@ predicate allocExprOrIndirect(Expr alloc, string kind) {
|
||||
alloc.(FunctionCall).getTarget() = rtn.getEnclosingFunction() and
|
||||
(
|
||||
allocExprOrIndirect(rtn.getExpr(), kind) or
|
||||
allocReaches0(rtn.getExpr(), _, kind)
|
||||
exists(SsaDefinition def, LocalScopeVariable v |
|
||||
// alloc via SSA
|
||||
allocExprOrIndirect(def.getAnUltimateDefiningValue(v), kind) and
|
||||
rtn.getExpr() = def.getAUse(v)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user