rapidsna added a comment.

> Future additions will include supporting, FAMs and counts in

sub-structures.

For sub-structures, are you referring to cases like this?

  struct outer {
    struct {
      int count;
    } sub;
    int flex[__attribute__((counted_by(sub.count)))];
  };

For `-fbounds-safety` we would limit it to anonymous sub-structs only because 
otherwise the code can create a pointer to sub-struct and its count can easily 
be updated to an invalid count. Were you considering the same restrictions for 
this?

  void foo(struct outer *p1, struct sub *p2) {
    p1 = (int*)malloc(sizeof(int) *10);
    p1->count = 10;
  
    p2->count = INT_MAX;
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148381/new/

https://reviews.llvm.org/D148381

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to