checkedc icon indicating copy to clipboard operation
checkedc copied to clipboard

Update spec to include missing cases for bounds-safe interface assignment compatibility

Open kkjeer opened this issue 4 years ago • 0 comments

The current rules for assignment compatibility of expressions involving bounds-safe interfaces are missing two cases.

The first case is related to assignments involving nested pointers. An assignment *p = e can pass type checking if:

  • p has an unchecked pointer type and a bounds-safe interface, and
  • e has a checked pointer type, and
  • the referent type of e is assignment compatible with the referent type of the referent type of p

The second case is related to assignments of an unchecked pointer with an _Nt_array_ptr bounds-safe interface to an _Nt_array_ptr variable. An assignment v = e can pass type checking if:

  • v has type _Nt_array_ptr<T>, and
  • e has unchecked pointer type and a bounds-safe interface of _Nt_array_ptr<U>, and
  • the referent types T and U are assignment compatible.

kkjeer avatar Mar 20 '20 00:03 kkjeer