Skip to content

Commit cae23fd

Browse files
author
Gabor Horvath
committed
[cxx-interop] Make the size of anonymous types metadata is unchanged
Add a null pointer to the value witness table instead of completely skipping emitting the pointer.
1 parent aa3a075 commit cae23fd

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
@@ -6940,11 +6940,13 @@ namespace {
69406940
}
69416941

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

0 commit comments

Comments
 (0)