[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

Kees Cook via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 29 23:28:09 PDT 2022


kees added inline comments.


================
Comment at: clang/test/CodeGen/bounds-checking-fam.c:23
 };
 
 // CHECK-LABEL: define {{.*}} @{{.*}}test_one{{.*}}(
----------------
I would expect to see here:

```
struct Zero {
  int a[0];
};

// CHECK-LABEL: define {{.*}} @{{.*}}test_zero{{.*}}(
int test_one(struct One *p, int i) {
  // CHECK-STRICT-0-NOT: @__ubsan
  // CHECK-STRICT-1-NOT: @__ubsan
  // CHECK-STRICT-2-NOT: @__ubsan
  // CHECK-STRICT-3:     call void @__ubsan_handle_out_of_bounds_abort(
  return p->a[i] + (p->a)[i];
}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134902



More information about the cfe-commits mailing list