File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
cpp/ql/src/semmle/code/cpp/commons Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,12 @@ predicate memberMayBeVarSize(Class c, MemberVariable v) {
3333 // `sizeof(c)` is taken
3434 so .( SizeofTypeOperator ) .getTypeOperand ( ) .getUnspecifiedType ( ) = c or
3535 so .( SizeofExprOperator ) .getExprOperand ( ) .getType ( ) .getUnspecifiedType ( ) = c |
36- // Check all ancestor nodes except the immediate parent for
37- // allocations.
38- isStdLibAllocationExpr ( so .getParent ( ) . ( Expr ) . getParent + ( ) )
36+
37+ // arithmetic is performed on the result
38+ so .getParent * ( ) instanceof BinaryArithmeticOperation
3939 ) or exists ( AddressOfExpr aoe |
4040 // `&(c.v)` is taken
41- aoe .getAddressable ( ) = v and
42- isStdLibAllocationExpr ( aoe .getParent ( ) .( Expr ) .getParent + ( ) )
41+ aoe .getAddressable ( ) = v
4342 )
4443 )
4544}
You can’t perform that action at this time.
0 commit comments