[clang] [clang][CodeGen] Fix a crash caused by inconsistent addrspace (PR #236752)
Ben Shi via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 29 22:12:02 PDT 2026
================
@@ -176,9 +176,11 @@ bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) {
// requires explicit comdat support in the IL.
if (llvm::GlobalValue::isWeakForLinker(TargetLinkage))
return true;
- // Create the alias with no name.
- auto *Alias = llvm::GlobalAlias::create(AliasValueType, 0, Linkage, "",
- Aliasee, &getModule());
+
+ // Create the alias with no name, in the same address space as the aliasee.
+ auto *Alias = llvm::GlobalAlias::create(
+ AliasValueType, getDataLayout().getProgramAddressSpace(), Linkage, "",
----------------
benshi001 wrote:
I will correct my comment, but which way is better?
https://github.com/llvm/llvm-project/pull/236752
More information about the cfe-commits
mailing list