Skip to content

Commit bc22e0d

Browse files
committed
C++: Update comments on memberMayBeVarSize
1 parent f202ddc commit bc22e0d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cpp/ql/lib/semmle/code/cpp/commons/Buffer.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ predicate memberMayBeVarSize(Class c, MemberVariable v) {
3333
) and
3434
// If the size is taken, then arithmetic is performed on the result at least once
3535
(
36+
// `sizeof(c)` is not taken
3637
not exists(SizeofOperator so |
37-
// `sizeof(c)` is taken
3838
so.(SizeofTypeOperator).getTypeOperand().getUnspecifiedType() = c or
3939
so.(SizeofExprOperator).getExprOperand().getUnspecifiedType() = c
4040
)
4141
or
42+
// or `sizeof(c)` is taken
4243
exists(SizeofOperator so |
43-
// `sizeof(c)` is taken
4444
so.(SizeofTypeOperator).getTypeOperand().getUnspecifiedType() = c or
4545
so.(SizeofExprOperator).getExprOperand().getUnspecifiedType() = c
4646
|
47-
// arithmetic is performed on the result
47+
// and arithmetic is performed on the result
4848
so.getParent*() instanceof AddExpr
4949
)
5050
)

0 commit comments

Comments
 (0)