File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
cpp/ql/lib/semmle/code/cpp/commons Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -33,18 +33,18 @@ predicate memberMayBeVarSize(Class c, MemberVariable v) {
33
33
) and
34
34
// If the size is taken, then arithmetic is performed on the result at least once
35
35
(
36
+ // `sizeof(c)` is not taken
36
37
not exists ( SizeofOperator so |
37
- // `sizeof(c)` is taken
38
38
so .( SizeofTypeOperator ) .getTypeOperand ( ) .getUnspecifiedType ( ) = c or
39
39
so .( SizeofExprOperator ) .getExprOperand ( ) .getUnspecifiedType ( ) = c
40
40
)
41
41
or
42
+ // or `sizeof(c)` is taken
42
43
exists ( SizeofOperator so |
43
- // `sizeof(c)` is taken
44
44
so .( SizeofTypeOperator ) .getTypeOperand ( ) .getUnspecifiedType ( ) = c or
45
45
so .( SizeofExprOperator ) .getExprOperand ( ) .getUnspecifiedType ( ) = c
46
46
|
47
- // arithmetic is performed on the result
47
+ // and arithmetic is performed on the result
48
48
so .getParent * ( ) instanceof AddExpr
49
49
)
50
50
)
You can’t perform that action at this time.
0 commit comments