(Hoping the formatting works as one would expect)
Motivating examples:
Pre-patch:
__builtin_object_size((char*)&foo, 0) != __builtin_object_size(&foo, 0) // if __builtin_object_size(&foo, 0) != -1 __builtin_object_size(&foo[1].bar[-1].baz, 1) == -1. // Always.
Post-patch:
Both act as one would expect. This was accomplished by making three changes:
- Adding a flag to PointerExprEvaluator that makes it more accepting of reinterpret_casts.
- Making array index/pointer offset less coupled in PointerExprEvaluator (we now carry around an extra Offset field that denotes how far we are away from an object boundary).
- Adding an OutermostMemberEvaluator that ignores foo[1].bar[-1] in foo[1].bar[-1].baz, and is more relaxed with casts/pointer arithmetic/etc. (Not 100% sold on the name)
Do you need <iostream>?