CPP: Support builtin offsetof.

This commit is contained in:
Geoffrey White
2018-10-25 15:16:55 +01:00
parent 4c6cc3abdb
commit c9ed0396c5

View File

@@ -40,6 +40,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
)
)
}