mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
C++: Use localExprFlow in existing queries
This shortens the queries a bit and ensures test coverage of the new predicate.
This commit is contained in:
@@ -47,7 +47,7 @@ predicate allocExprOrIndirect(Expr alloc, string kind) {
|
||||
or
|
||||
exists(Expr e |
|
||||
allocExprOrIndirect(e, kind) and
|
||||
DataFlow::localFlow(DataFlow::exprNode(e), DataFlow::exprNode(rtn.getExpr()))
|
||||
DataFlow::localExprFlow(e, rtn.getExpr())
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -95,7 +95,7 @@ class CallWithBufferSize extends FunctionCall {
|
||||
|
||||
int statedSizeValue() {
|
||||
exists(Expr statedSizeSrc |
|
||||
DataFlow::localFlow(DataFlow::exprNode(statedSizeSrc), DataFlow::exprNode(statedSizeExpr())) and
|
||||
DataFlow::localExprFlow(statedSizeSrc, statedSizeExpr()) and
|
||||
result = statedSizeSrc.getValue().toInt()
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user