[clang] [UBSAN] [NFC] add coverage for null and alignment checks (PR #176210)

VASU SHARMA via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 19 00:42:08 PST 2026


vasu-the-sharma wrote:

> I am also a bit confused about what your test is checking. Is it verifying the lack of support from the `null` and `aligned` sanitizers? I see very few `CHECK` lines looking for sanitizer intrinsics, just a bunch of memcpy ops which are emitted even when the sanitizers are off.
> 
> Is your test documenting a gap or testing a functionality of these sanitizers?

This test is meant to document the current behavior as a baseline, so that when we implement `UBSAN` null/alignment checks for aggregate copies in a follow-up PR, we can update the test accordingly and verify the before/after changes.

The idea is:
- **This PR (NFC):** Establish a baseline document that memcpy is emitted but no sanitizer checks exist yet
- **Follow-up PR:** Implement the actual `UBSAN` instrumentation for aggregate copies, then update this test to check for `__ubsan_handle_type_mismatch_v1_abort` calls before the `memcpy`

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


More information about the cfe-commits mailing list