CPP: Support builtin offsetof.

This commit is contained in:
Geoffrey White
2018-10-25 15:16:55 +01:00
committed by Robert Marsh
parent 79ff559f7a
commit 313624fd2e

View File

@@ -39,6 +39,9 @@ predicate memberMayBeVarSize(Class c, MemberVariable v) {
) or exists(AddressOfExpr aoe |
// `&(c.v)` is taken
aoe.getAddressable() = v
) or exists(BuiltInOperationOffsetOf oo |
// `offsetof(c, v)` using a builtin
oo.getAChild().(VariableAccess).getTarget() = v
)
)
}