CPP: Fix over-enthusiastic dataflow in allocExprOrIndirect.

This commit is contained in:
Geoffrey White
2019-03-19 17:57:30 +00:00
parent ea7e8927fe
commit 7d8886e30c
3 changed files with 7 additions and 5 deletions

View File

@@ -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)
)
)
)
}