Fix ConstantAggregateBuilderBase::getRelativeOffset

Summary:
If a record has a mix of relative pointers and other fields they
wouldn't necessarily be the same.

Fallout from D77592.

rdar://64309883

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81857
This commit is contained in:
Arnold Schwaighofer 2020-06-15 10:28:06 -07:00
parent 3495b884de
commit 4a8120ca9f

View File

@ -129,7 +129,7 @@ llvm::Constant *
ConstantAggregateBuilderBase::getRelativeOffset(llvm::IntegerType *offsetType,
llvm::Constant *target) {
return getRelativeOffsetToPosition(offsetType, target,
Builder.SelfReferences.size());
Builder.Buffer.size() - Begin);
}
llvm::Constant *ConstantAggregateBuilderBase::getRelativeOffsetToPosition(