C++: Replace minimum(any(...)) with a min aggregate. Also removed the min aggregate further down since it's no longer needed.

This commit is contained in:
Mathias Vorreiter Pedersen
2021-05-19 09:03:05 +02:00
parent 6103aabdce
commit 741eed93b2

View File

@@ -101,7 +101,7 @@ class CallWithBufferSize extends FunctionCall {
// result in this case we pick the minimum value obtainable from dataflow and range analysis.
result =
upperBound(statedSizeExpr())
.minimum(any(Expr statedSizeSrc |
.minimum(min(Expr statedSizeSrc |
DataFlow::localExprFlow(statedSizeSrc, statedSizeExpr())
|
statedSizeSrc.getValue().toInt()
@@ -112,7 +112,7 @@ class CallWithBufferSize extends FunctionCall {
predicate wrongBufferSize(Expr error, string msg) {
exists(CallWithBufferSize call, int bufsize, Variable buf, int statedSize |
staticBuffer(call.buffer(), buf, bufsize) and
statedSize = min(call.statedSizeValue()) and
statedSize = call.statedSizeValue() and
statedSize > bufsize and
error = call.statedSizeExpr() and
msg =