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 @@ -34,13 +34,12 @@ predicate memberMayBeVarSize(Class c, MemberVariable v) {
3434 // `sizeof(c)` is taken
3535 so .( SizeofTypeOperator ) .getTypeOperand ( ) .getUnspecifiedType ( ) = c or
3636 so .( SizeofExprOperator ) .getExprOperand ( ) .getType ( ) .getUnspecifiedType ( ) = c |
37- // Check all ancestor nodes except the immediate parent for
38- // allocations.
39- isStdLibAllocationExpr ( so .getParent ( ) . ( Expr ) . getParent + ( ) )
37+
38+ // arithmetic is performed on the result
39+ so .getParent * ( ) instanceof BinaryArithmeticOperation
4040 ) or exists ( AddressOfExpr aoe |
4141 // `&(c.v)` is taken
42- aoe .getAddressable ( ) = v and
43- isStdLibAllocationExpr ( aoe .getParent ( ) .( Expr ) .getParent + ( ) )
42+ aoe .getAddressable ( ) = v
4443 )
4544 )
4645}
You can’t perform that action at this time.
0 commit comments