[clang] [Clang][counted_by] Don't re-evaluate the base of a counted_by pointer access for -fsanitize=array-bounds (PR #232228)

Justin Stitt via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 19 16:11:22 PDT 2026


JustinStitt wrote:

can we miss adding alignment asumption checks?

the manual calling of `EmitLoadOfLValue()` hits `RValue EmitLoadOfLValue(LValue V, SourceLocation Loc)` in CodeGenFunction.h +4517 which doesn't have the same alignment check that ./clang/lib/CodeGen/CGExprScalar.cpp +377 has:
```
Value *EmitLoadOfLValue(const Expr *E) {
  Value *V = EmitLoadOfLValue(EmitCheckedLValue(E, CodeGenFunction::TCK_Load),
                              E->getExprLoc());

  EmitLValueAlignmentAssumption(E, V);
  return V;
}
```

https://github.com/llvm/llvm-project/pull/232228


More information about the cfe-commits mailing list