[clang] [TBAA] Correctly specify path to base type for aggregate assignment (PR #198590)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 3 17:05:59 PST 2026


================
@@ -496,8 +493,11 @@ CodeGenTBAA::CollectFields(uint64_t BaseOffset,
   /* Otherwise, treat whatever it is as a field. */
   uint64_t Offset = BaseOffset;
   uint64_t Size = Context.getTypeSizeInChars(QTy).getQuantity();
-  llvm::MDNode *TBAAType = MayAlias ? getChar() : getTypeInfo(QTy);
-  llvm::MDNode *TBAATag = getAccessTagInfo(TBAAAccessInfo(TBAAType, Size));
+  llvm::MDNode *TBAATag;
+  if (MayAlias || !BaseType)
----------------
efriedma-quic wrote:

BaseType can't actually be null here?

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


More information about the cfe-commits mailing list