[clang] [UBSAN] add null, alignment and array-bounds checks (PR #190739)

VASU SHARMA via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 9 05:00:36 PDT 2026


vasu-the-sharma wrote:

> There is no need to mark this PR "FC" as opposed to "NFC".
> 
> Also, why did the scope of this reduce from handling both the LHS and RHS (in #164548) to handling just the RHS?

Thanks @hubert-reinterpretcast I have updated the PR title as suggested and updated the test checks to match the string exactly, not just the substring.

Regarding the scope, currently this PR adds checks for the `RHS (source)` only for simple pointer dereferences like `*dest = *src`

The `LHS` is only checked when accessed via member expressions like `c->inner`
For simple *`dest = *src` tests, there is only `ONE ubsan call (for RHS only)`. The `LHS dest` is NOT checked.
```
test_nested_member_plain_arr_idx (c->inner = arr[0])
test_nested_member_plain_deref_ptr (c->inner = *ap)
```

Therefore, can you please let me know if we need LHS checks for simple pointer dereferences as well? If so, I can add them in this PR.

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


More information about the cfe-commits mailing list