We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 998bec1 commit 7169c4bCopy full SHA for 7169c4b
cpp/ql/lib/semmle/code/cpp/commons/Buffer.qll
@@ -92,12 +92,7 @@ private int getSize(VariableAccess va) {
92
// buffer is `12 - 4 = 8`.
93
c = getRootType(va) and
94
// we calculate the size based on the last field, to avoid including any padding after it
95
- trueSize =
96
- max(Field f |
97
- f.getDeclaringType*() = c
98
- |
99
- f.getOffsetInClass(c) + f.getUnspecifiedType().getSize()
100
- ) and
+ trueSize = max(Field f | | f.getOffsetInClass(c) + f.getUnspecifiedType().getSize()) and
101
result = trueSize - v.(Field).getOffsetInClass(c)
102
)
103
0 commit comments