Skip to content

Commit 56a525b

Browse files
authored
Merge pull request #84152 from Xazax-hun/add-nullptr-to-metadata
[cxx-interop] Make the size of anonymous types metadata is unchanged
2 parents e5f9ffc + cae23fd commit 56a525b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/IRGen/GenMeta.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6939,11 +6939,13 @@ namespace {
69396939
}
69406940

69416941
void addValueWitnessTable() {
6942+
llvm::Constant* vwtPointer = nullptr;
69426943
if (auto cd = Target->getClangDecl())
69436944
if (auto rd = dyn_cast<clang::RecordDecl>(cd))
69446945
if (rd->isAnonymousStructOrUnion())
6945-
return;
6946-
auto vwtPointer = emitValueWitnessTable(/*relative*/ false).getValue();
6946+
vwtPointer = llvm::Constant::getNullValue(IGM.WitnessTablePtrTy);
6947+
if (!vwtPointer)
6948+
vwtPointer = emitValueWitnessTable(/*relative*/ false).getValue();
69476949
B.addSignedPointer(vwtPointer,
69486950
IGM.getOptions().PointerAuth.ValueWitnessTable,
69496951
PointerAuthEntity());

0 commit comments

Comments
 (0)