[PATCH] D128643: [clang] -fsanitize=array-bounds: treat all trailing size-1 arrays as flexible

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 27 08:04:34 PDT 2022


serge-sans-paille added inline comments.


================
Comment at: clang/include/clang/AST/Expr.h:455
+  bool isFlexibleArrayMember(ASTContext &Ctx, int StrictFlexArraysLevel,
+                             bool IgnoreSizeFromMacro) const;
 
----------------
Maybe default to `false` here?


================
Comment at: clang/test/CodeGen/bounds-checking.c:69
+int f7(struct Macro *m, int i) {
+  // CHECK-NOT: call {{.*}} @llvm.ubsantrap
+  return m->a[i];
----------------
The above checks look for `CHECK-NOT: call {{.*}} @llvm.{{(ubsan)?trap}}`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128643



More information about the cfe-commits mailing list