mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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.
This commit is contained in:
@@ -6940,11 +6940,13 @@ namespace {
|
||||
}
|
||||
|
||||
void addValueWitnessTable() {
|
||||
llvm::Constant* vwtPointer = nullptr;
|
||||
if (auto cd = Target->getClangDecl())
|
||||
if (auto rd = dyn_cast<clang::RecordDecl>(cd))
|
||||
if (rd->isAnonymousStructOrUnion())
|
||||
return;
|
||||
auto vwtPointer = emitValueWitnessTable(/*relative*/ false).getValue();
|
||||
vwtPointer = llvm::Constant::getNullValue(IGM.WitnessTablePtrTy);
|
||||
if (!vwtPointer)
|
||||
vwtPointer = emitValueWitnessTable(/*relative*/ false).getValue();
|
||||
B.addSignedPointer(vwtPointer,
|
||||
IGM.getOptions().PointerAuth.ValueWitnessTable,
|
||||
PointerAuthEntity());
|
||||
|
||||
Reference in New Issue
Block a user