checkedc / checkedc-clang

This repo contains a version of clang that is being modified to support Checked C. Checked C is an extension to C that lets programmers write C code that is guaranteed by the compiler to be type-safe.
https://www.checkedc.org
496 stars 72 forks source link

Bounds checking bounds-safe interfaces in unchecked scopes #1169

Closed kkjeer closed 3 years ago

kkjeer commented 3 years ago

Fixes #1158

This PR updates the bounds checking behavior for lvalue expressions with bounds-safe interfaces in unchecked scopes.

If:

  1. A statement S is in an unchecked scope, and:
  2. An lvalue expression e has unchecked pointer type (its bounds were declared using a bounds-safe interface), and:
  3. S does not contain an assignment e = e1 where e1 is a checked pointer, then:

The bounds of e are not validated after checking S.