]> granicus.if.org Git - clang/commitdiff
Fix off-by-one error in worst-case number of offsets needed for an AST record.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 14 Apr 2016 18:32:54 +0000 (18:32 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 14 Apr 2016 18:32:54 +0000 (18:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266353 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Serialization/ASTWriter.h
test/Modules/Inputs/cxx-decls-imported.h

index 5ca94b2c36137496361cc288b7c3f7019d6cbbac..a5915e7c7ebc0d4f71f4ace3a537a9f257b4ed79 100644 (file)
@@ -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.
index a4910fee753e792b583de082439fdb3e5c14c9d5..0a172150fc145c5c06bb99ff6fb7be4959adf627 100644 (file)
@@ -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;