Open
Description
This issue was copied from checkedc/checkedc-clang#1055
We should not allow indirection in member bounds due to aliasing concerns. For example:
struct S {
int a;
};
struct T {
ptr<struct S> p;
array_ptr<int> m : count(p->a);
}
The declared bounds count(p->a)
of T::m
should not be allowed since p
may be an alias. For example:
void f(struct T y) {
(y.p)->a = 5;
}
Each struct T
in memory may have its bounds invalidated by the assignment (y.p)->a = 5
.