[clang] [UBSAN] add null and alignment checks for aggregates (PR #164548)

Tony Varghese via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 22 00:17:35 PDT 2025


================
@@ -2249,6 +2249,21 @@ void CodeGenFunction::EmitAggregateCopy(LValue Dest, LValue Src, QualType Ty,
                                         bool isVolatile) {
   assert(!Ty->isAnyComplexType() && "Shouldn't happen for complex");
 
+  if (SanOpts.hasOneOf(SanitizerKind::Null | SanitizerKind::Alignment)) {
----------------
tonykuttai wrote:

Can you add comment block here to explain
- why we need this `if block`
- what is it doing.?

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


More information about the cfe-commits mailing list