Skip to content

Indirection in member bounds should not be allowed #1055

Open
@secure-sw-dev-bot

Description

@secure-sw-dev-bot

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions