Skip to content

Invertibility for unchecked pointers #1126

Closed
@secure-sw-dev-bot

Description

@secure-sw-dev-bot

This issue was copied from checkedc/checkedc-clang#1127


Fixes #1123

This PR allows pointer arithmetic expressions with unchecked pointer type to be invertible. This means that unchecked pointers with bounds-safe interfaces in unchecked scopes can have inverses.

For example:

void f(int *p : count(1)) _Unchecked {
  p = p + 1;
}

In the body of f, p has the unchecked pointer type int * since it is in an unchecked scope. Before this PR, p would have no inverse in the expression p + 1. After this PR, p has the inverse p - 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions