summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-04-14 18:32:54 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-04-14 18:32:54 +0000
commit9c4fb0a8331cae2d4e2e4beaa4e7af06062a6b58 (patch)
tree226910df76640ba421b4c31ceba435ac67406e47
parentacc50e0a998ec9a59bbf2ebd615a9fb756614bd7 (diff)
downloadbcm5719-llvm-9c4fb0a8331cae2d4e2e4beaa4e7af06062a6b58.tar.gz
bcm5719-llvm-9c4fb0a8331cae2d4e2e4beaa4e7af06062a6b58.zip
Fix off-by-one error in worst-case number of offsets needed for an AST record.
llvm-svn: 266353
-rw-r--r--clang/include/clang/Serialization/ASTWriter.h3
-rw-r--r--clang/test/Modules/Inputs/cxx-decls-imported.h5
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/include/clang/Serialization/ASTWriter.h b/clang/include/clang/Serialization/ASTWriter.h
index 5ca94b2c361..a5915e7c7eb 100644
--- a/clang/include/clang/Serialization/ASTWriter.h
+++ b/clang/include/clang/Serialization/ASTWriter.h
@@ -704,7 +704,8 @@ class ASTRecordWriter {
/// declaration or type.
SmallVector<Stmt *, 16> StmtsToEmit;
- static const int MaxOffsetIndices = 4;
+ /// Worst case: bases, vbases, visible and lexical contents, local redecls.
+ static const int MaxOffsetIndices = 5;
/// \brief Indices of record elements that describe offsets within the
/// bitcode. These will be converted to offsets relative to the current
/// record when emitted.
diff --git a/clang/test/Modules/Inputs/cxx-decls-imported.h b/clang/test/Modules/Inputs/cxx-decls-imported.h
index a4910fee753..0a172150fc1 100644
--- a/clang/test/Modules/Inputs/cxx-decls-imported.h
+++ b/clang/test/Modules/Inputs/cxx-decls-imported.h
@@ -50,3 +50,8 @@ namespace Alias = Aliased;
struct InhCtorA { InhCtorA(int); };
struct InhCtorB : InhCtorA { using InhCtorA::InhCtorA; };
+
+struct ClassWithVBases : HasFriends, virtual HasNontrivialDefaultConstructor {
+ int n;
+};
+struct ClassWithVBases;
OpenPOWER on IntegriCloud