efriedma-quic wrote:

Trying to discuss both __bdos and the array bounds sanitizer changes in the 
same review is making things confusing to discuss.  It seems like they have 
significant differences.

For array bounds sanitizer, take your example:

```
struct s {
  struct s *p;
  int count;
  int array[] __attribute__((count));
};

int foo(struct s *p, int index) {
  return p->p->p->array[index];
}
```

When we visit the ArraySubscriptExpr, without sanitization, we call EmitLValue 
on `p->p->p->array`.  My proposal is that, when we're doing sanitization, we 
don't do that.  Instead, we call EmitPointerWithAlignment on `p->p->p`, then 
use the returned pointer to load `count` and index to `array`.

https://github.com/llvm/llvm-project/pull/73730
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to