diff --git a/clang/lib/CodeGen/ConstantInitBuilder.cpp b/clang/lib/CodeGen/ConstantInitBuilder.cpp --- a/clang/lib/CodeGen/ConstantInitBuilder.cpp +++ b/clang/lib/CodeGen/ConstantInitBuilder.cpp @@ -129,7 +129,7 @@ ConstantAggregateBuilderBase::getRelativeOffset(llvm::IntegerType *offsetType, llvm::Constant *target) { return getRelativeOffsetToPosition(offsetType, target, - Builder.SelfReferences.size()); + Builder.Buffer.size() - Begin); } llvm::Constant *ConstantAggregateBuilderBase::getRelativeOffsetToPosition(